| git.druid.rocks | index | druid520 | mp | mk.conf |
mk.conf
src="src"
out="out"
plugins="plugins"
mpx_src="$src/mpx.c $src/util.c $src/conf.c $src/fstree.c $src/sandbox.c $src/stage.c $src/runsh.c $src/version.c $src/merge.c"
mpx_bin="$out/mpx"
cc="${CC:-cc}"
ln="ln"
lnflgs="-sf"
ccflgs="-std=c89 -Wall -Wextra -Wshadow -Werror -Wtrampolines -Wcast-qual \
-pedantic-errors -Wpedantic -Wsign-conversion -Wconversion -Warith-conversion \
-Wnull-dereference -Wdouble-promotion -Wformat=2 -Wformat-security \
-Wformat-overflow=2 -Wformat-truncation=2 -Wstrict-aliasing=3 \
-Wstrict-overflow=5 -Wstringop-overflow=4 -Wstringop-overread \
-Warray-bounds=2 -Wunsafe-loop-optimizations \
-Wswitch-default -Wswitch-enum -Wundef -Wuninitialized -Winit-self \
-Wmissing-include-dirs -Wredundant-decls -Wmissing-prototypes \
-Wstrict-prototypes -Wold-style-definition -Wmissing-declarations \
-Wjump-misses-init -Wvla -Wstringop-truncation -Wshift-overflow=2 \
-Walloc-zero -Wduplicated-branches -Warray-parameter \
-Wduplicated-cond -Wlogical-op -Wempty-body -Wclobbered \
-Wunsuffixed-float-constants -Wfloat-equal -Wfloat-conversion \
-Wtautological-compare -Wimplicit-fallthrough=5 -Wmisleading-indentation \
-Wrestrict -Wuse-after-free=3 -Wabsolute-value -Wnested-externs \
-Wcast-function-type -Wformat-nonliteral -Wformat-y2k -Wbidi-chars=any \
-Wframe-larger-than=65536 -Wstack-usage=65536 \
-Werror=implicit-function-declaration -Werror=int-conversion \
-Werror=incompatible-pointer-types -fanalyzer \
-fno-omit-frame-pointer -fstack-protector-strong -fstack-clash-protection \
-fcf-protection=full -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \
-Wpointer-arith -Wwrite-strings -Wcast-align -Wl,-z,noexecstack \
-static -fno-pie -no-pie -Os -pipe -s -g0 -I$src"
# only added when the directory genuinely exists: -Wmissing-include-dirs
# (enabled above) turns a missing -isystem target into a hard build
# error, which every native (non-sysroot) build of mp itself would hit
# unconditionally otherwise -- MP_PREFIX/include only exists inside a
# sysroot-shaped tree (see this file's own git history for why it's
# needed there at all: mpx's own cc there has no built-in path to the
# tree's real libc headers).
#
# ${MP_PREFIX_BASE:-$MP_PREFIX}, not bare MP_PREFIX: under "mp reinstall
# --inplace", MP_PREFIX is mp's own EPHEMERAL scratch install target,
# which has no include/ at all until this same build's own "make
# install" populates it later -- the real, already-installed libc
# headers this build needs to find live under the live root's
# MP_PREFIX_BASE instead. hit for real: mp's own --inplace self-rebuild
# failed outright ("fatal error: stdio.h: No such file or directory")
# because the [ -d ... ] probe below silently found nothing and skipped
# -isystem entirely, falling back to gcc's own built-in search path
# (which doesn't include this tree's non-standard /include layout). a
# normal, non-inplace build never sets MP_PREFIX_BASE, so this keeps
# that case identical to before.
mp_hdr_base="${MP_PREFIX_BASE:-${MP_PREFIX:-/}}"
if [ -d "$mp_hdr_base/include" ]; then
ccflgs="$ccflgs -isystem $mp_hdr_base/include"
fi
# runtime sanitizers need the toolchain's libsanitizer spec files, which
# some systems don't ship (a pkgsrc-built gcc, for example, dies with
# "cannot read spec file libsanitizer.spec") -- kept separate from ccflgs
# and only appended by mk/b.sh when a probe compile proves they work.
sanflgs="-fsanitize=undefined,bounds-strict -fno-sanitize-recover=all"