]> git.wh0rd.org Git - patches.git/blob - 5005_all_glibc-relative-linker-scripts.patch
more random patches. who knows.
[patches.git] / 5005_all_glibc-relative-linker-scripts.patch
1 --- Makerules
2 +++ Makerules
3 @@ -972,6 +972,14 @@ ifndef subdir
4  # We need to use absolute paths since otherwise local copies (if they exist)
5  # of the files are taken by the linker.
6  install: $(inst_libdir)/libc.so
7 +
8 +ifeq ($(slibdir),$(libdir))
9 +ldscript_slibdir =
10 +ldscript_libdir =
11 +else
12 +ldscript_slibdir = $(slibdir)/
13 +ldscript_libdir = $(libdir)/
14 +endif
15  $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
16                         $(common-objpfx)libc.so$(libc.so-version) \
17                         $(inst_libdir)/$(patsubst %,$(libtype.oS),\
18 @@ -981,9 +989,9 @@ $(inst_libdir)/libc.so: $(common-objpfx)
19          echo '   Use the shared library, but some functions are only in';\
20          echo '   the static library, so try that secondarily.  */';\
21          cat $<; \
22 -        echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
23 -             '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
24 -             ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
25 +        echo 'GROUP ( $(ldscript_slibdir)libc.so$(libc.so-version)' \
26 +             '$(ldscript_libdir)$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
27 +             ' AS_NEEDED (' $(ldscript_slibdir)$(rtld-installed-name) ') )' \
28         ) > $@.new
29         mv -f $@.new $@
30  
31 --- nptl/Makefile
32 +++ nptl/Makefile
33 @@ -368,6 +368,13 @@ lib-noranlib: $(addprefix $(objpfx),$(ex
34  # of the files are taken by the linker.
35  install: $(inst_libdir)/libpthread.so
36  
37 +ifeq ($(slibdir),$(libdir))
38 +ldscript_slibdir =
39 +ldscript_libdir =
40 +else
41 +ldscript_slibdir = $(slibdir)/
42 +ldscript_libdir = $(libdir)/
43 +endif
44  $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
45                               $(objpfx)libpthread.so$(libpthread.so-version) \
46                               $(inst_libdir)/$(patsubst %,$(libtype.oS),\
47 @@ -377,8 +384,8 @@ $(inst_libdir)/libpthread.so: $(common-o
48          echo '   Use the shared library, but some functions are only in';\
49          echo '   the static library, so try that secondarily.  */';\
50          cat $<; \
51 -        echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
52 -             '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
53 +        echo 'GROUP ( $(ldscript_slibdir)libpthread.so$(libpthread.so-version)' \
54 +             '$(ldscript_libdir)$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
55               ')' \
56         ) > $@.new
57         mv -f $@.new $@