diff options
-rw-r--r-- | platforms/toolchain_options.in | 7 | ||||
-rw-r--r-- | scripts/wrapper/libwrapper.sh | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/platforms/toolchain_options.in b/platforms/toolchain_options.in index 59a8ac81f..1c4cb07fb 100644 --- a/platforms/toolchain_options.in +++ b/platforms/toolchain_options.in @@ -31,6 +31,13 @@ choice add "--hash-style=both" to the linker options endchoice +config TARGET_LINKER_AS_NEEDED + bool + prompt "Link only needed libraries (ld --as-needed)" + help + tell the linker to link in the produced binary only the libraries + containing symbols actually used by the binary itself. + config TARGET_EXTRA_CPPFLAGS string prompt "Extra CPPFLAGS (cpp)" diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh index e45ad35cb..a20a46f32 100644 --- a/scripts/wrapper/libwrapper.sh +++ b/scripts/wrapper/libwrapper.sh @@ -101,6 +101,7 @@ add_ld_args() { add_opt_arg TARGET_LINKER_HASH_GNU "${1}--hash-style=gnu" add_opt_arg TARGET_LINKER_HASH_SYSV "${1}--hash-style=sysv" add_opt_arg TARGET_LINKER_HASH_BOTH "${1}--hash-style=both" + add_opt_arg TARGET_LINKER_AS_NEEDED "${1}--as-needed" } ld_add_ld_args() { |