Skip to content

Commit

Permalink
Link as-needed against ld.so.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland McGrath committed Apr 19, 2010
1 parent c98d421 commit 7e2b0c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2010-04-19 Roland McGrath <[email protected]>

* Makeconfig (as-needed, no-as-needed): New variables.
(link-libc): Add ld.so inside --as-needed.

* stdio-common/tst-fmemopen.c (TEST_FILE): Macro removed.
(main): Take arguments. Construct test file name from ARGV[0].

Expand Down
11 changes: 10 additions & 1 deletion Makeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@ ifeq ($(elf),yes)
have-initfini = yes
endif

ifeq ($(have-as-needed),yes)
as-needed := -Wl,--as-needed
no-as-needed := -Wl,--no-as-needed
else
as-needed :=
no-as-needed :=
endif

# Installed name of the startup code.
ifneq ($(have-initfini),yes)
# When not having init/fini, there is just one startfile, called crt0.o.
Expand Down Expand Up @@ -484,7 +492,8 @@ ifeq ($(elf),yes)
# run the linked programs.
link-libc = -Wl,-rpath-link=$(rpath-link) \
$(common-objpfx)libc.so$(libc.so-version) \
$(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
$(common-objpfx)$(patsubst %,$(libtype.oS),c) \
$(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib)
# This is how to find at build-time things that will be installed there.
rpath-dirs = math elf dlfcn nss nis rt resolv crypt
endif
Expand Down

0 comments on commit 7e2b0c8

Please sign in to comment.