Created attachment 470114 [details] build log of =dev-libs/libffi-3.2.1 During the linking-phase of libffi the LDFLAGS are stripped. e.g with CFLAGS and LDFLAGS like CFLAGS="-march=native -mtune=native -w -pthread -pipe -fPIC -fdata-sections -ffunction-sections -g0 -O2 -flto=2 -fuse-linker-plugin -flto-partition=none -fomit-frame-pointer -ftree-vectorize -fira-loop-pressure -fno-aggressive-loop-optimizations -funswitch-loops -fgcse-sm -fgcse-las -fgcse-after-reload -fopenmp-simd -fopenmp -ftree-partial-pre -finline-functions -funroll-loops -mvzeroupper -malign-data=cacheline -maccumulate-outgoing-args -fschedule-insns -fsched-pressure -fmodulo-sched -fmodulo-sched-allow-regmoves --param prefetch-latency=600" LDFLAGS="-Wl,-O1,--icf=all,--icf-iterations=4,--gc-sections,--as-needed,--hash-style=gnu ${CFLAGS}" the resulting command invocation looks like this. please see the incorrect "--param". -march=native -mtune=native -pthread -O2 -flto=2 -fuse-linker-plugin -flto-partition=none -fopenmp -mvzeroupper -malign-data=cacheline -maccumulate-outgoing-args -Wl,-O1 -Wl,--icf=all -Wl,--icf-iterations=4 -Wl,--gc-sections -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mtune=native -pthread -fPIC -fdata-sections -ffunction-sections -O2 -flto=2 -fuse-linker-plugin -flto-partition=none -fomit-frame-pointer -ftree-vectorize -fira-loop-pressure -fno-aggressive-loop-optimizations -funswitch-loops -fgcse-sm -fgcse-las -fgcse-after-reload -fopenmp-simd -fopenmp -ftree-partial-pre -finline-functions -funroll-loops -mvzeroupper -malign-data=cacheline -maccumulate-outgoing-args -fschedule-insns -fsched-pressure -fmodulo-sched --param -fmodulo-sched-allow-regmoves -fuse-ld=gold -Wl,-O1 -Wl,--icf=all -Wl,--icf-iterations=4 -Wl,--gc-sections -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mtune=native -pthread -O2 -flto=2 -fuse-linker-plugin -flto-partition=none -fopenmp -mvzeroupper -malign-data=cacheline -maccumulate-outgoing-args -pthread -fopenmp -Wl,-soname -Wl,libffi.so.6 -o .libs/libffi.so.6.0.4 The combination of CFLAGS and LDFLAGS is needed for LTO. Even though LTO is not officially supported (my last information), incorrect stripping is always bad.
libtool performs parameter reordering to accomodate toolchain deficiencies: reorder libraries, sort CFLAGS, objects, libraries and so on. Unfortunatly that means it has to understand multi-arguments flags like CFLAGS="... --param prefetch-latency=600 ..." libtool does not understand them. The workaround is to use single-argument form: CFLAGS="... --param=prefetch-latency=600 ..."
Running 'elibtoolize' produces the same broken behaviour. Reassigning to base-system@ to triage further and maybe ask upstream to enhance option parsing.
Here is a libtool's flag whitelist: https://git.savannah.gnu.org/cgit/libtool.git/tree/build-aux/ltmain.in#n5365