From f47b542968bd33a66400bff45647a8eff1484f8c Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 16 Dec 2012 13:46:42 +0100 Subject: wrapper: add options for --as-needed Signed-off-by: Michael Olbrich --- platforms/toolchain_options.in | 7 +++++++ scripts/wrapper/libwrapper.sh | 1 + 2 files changed, 8 insertions(+) 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() { -- cgit v1.2.3