123456789101112131415161718192021222324252627282930313233343536373839 |
- # vim: ft=gentoo-make-conf:cc=80:
- _MARCH=native
- _SAFEST_FAST_MATH="-fno-math-errno -fno-trapping-math"
- _UNSAFE_MATH="-fno-signed-zeros -fassociative-math -freciprocal-math"
- _FAST_MATH="-fno-math-errno -ffinite-math-only -fno-rounding-math"
- _MATH_FLAGS="${_SAFEST_FAST_MATH} ${_FAST_MATH} ${_UNSAFE_MATH}"
- _F_OPTIMIZE="-falign-functions=32 -ftree-vectorize -funroll-loops"
- _SAFE_FLAGS="-march=${_MARCH} -O3 -flto -fPIC ${_F_OPTIMIZE}"
- _OPT="${_SAFE_FLAGS} ${_MATH_FLAGS}"
- _SECURITY_STACK="-fstack-protector-all -fstack-protector-strong
- -fstack-clash-protection"
- _SECURITY="${_SECURITY_STACK} -fPIE -fcf-protection -D_FORTIFY_SOURCE=2 ${_HARDENING_CFLAGS}"
- _LD_SECURITY="-Wl,-z,now -Wl,-z,relro ${_HARDENING_LDFLAGS}"
- _MUSL_FLAGS="-D_LARGEFILE64_SOURCE"
- _RUST_STATIC="-Ctarget-feature=-crt-static"
- #_RUST_STATIC="${_RUST_STATIC} -Clink-self-contained=yes"
- _RUST_OPT="-Ctarget-cpu=${_MARCH} -Copt-level=3"
- _RUST_LINK="--defsym=__dm9pZCAq_binary__=0x0c,-O4,--as-needed,-z,now,-z,relro"
- RUSTFLAGS="${RUSTFLAGS} -Clink-args=-Wl,${_RUST_LINK} ${_RUST_OPT} ${_RUST_STATIC}"
- COMMON_FLAGS="${COMMON_FLAGS} -pipe ${_OPT} ${_SECURITY} ${_MUSL_FLAGS} "
- LDFLAGS="${LDFLAGS} -Wl,-O4 -Wl,--as-needed ${_LD_SECURITY}"
- #ECARGO_EXTRA_ARGS="--target=x86_64-unknown-linux-musl"
|