Linker flags used by buildworld/kernel

Erik Cederstrand erik at cederstrand.dk
Fri Jul 27 12:42:53 UTC 2012


Hi guys,

I want to know which linker flags are used when building FreeBSD, i.e. which flags a system linker must support. I created a wrapper for /usr/bin/ld that simply dumps the arguments to a file before calling /usr/bin/ld. I then added "LD=/path/to/wrapper" to /etc/make.conf and ran "make buildworld && make buildkernel". This results in the appended list (for CURRENT).

Is this a comprehensive list? I also tried gripping the source, but neither LD nor LDFLAGS are used consistently, and some uses of LDFLAGS are reserved for building other OS'es. I considered replacing /usr/bin/ld with my wrapper, but a new ld is built in the very beginning as part of the new toolchain, AFAIK.

Thanks,
Erik


--gc-sections
--no-warn-mismatch
--whole-archive
-Bdynamic
-N
-T
-Tfoo
-Ttext
-X
-Y
-ashared
-b
-c,text
-d
-dynamic-linker
-export-dynamic
-m
-nostdlib
-o
-r
-static
-warn-common


More information about the freebsd-toolchain mailing list