Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From c1beab8a11985f96f5eb644e7103d343b705afc6 Mon Sep 17 00:00:00 2001 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 18 Mar 2015 01:57:01 +0000 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 4 | Subject: [PATCH 21/27] eglibc: Install PIC archives |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | Forward port from eglibc |
| 7 | |
| 8 | 2008-02-07 Joseph Myers <joseph@codesourcery.com> |
| 9 | |
| 10 | * Makerules (install-extras, install-map): New variables. |
| 11 | (installed-libcs): Add libc_pic.a. |
| 12 | (install-lib): Include _pic.a files for versioned shared |
| 13 | libraries. |
| 14 | (install-map-nosubdir, install-extras-nosubdir): Add rules for |
| 15 | installing extra files. |
| 16 | (install-no-libc.a-nosubdir): Depend on install-map-nosubdir and |
| 17 | install-extras-nosubdir. |
| 18 | |
| 19 | 2008-04-01 Maxim Kuvyrkov <maxim@codesourcery.com> |
| 20 | |
| 21 | * Makerules (install-lib): Don't install libpthread_pic.a. |
| 22 | (install-map): Don't install libpthread_pic.map. |
| 23 | |
| 24 | Upstream-Status: Pending |
| 25 | |
| 26 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 27 | --- |
| 28 | Makerules | 42 ++++++++++++++++++++++++++++++++++++++++-- |
| 29 | 1 file changed, 40 insertions(+), 2 deletions(-) |
| 30 | |
| 31 | diff --git a/Makerules b/Makerules |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 32 | index ef6abeac6d..eeaa667f49 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 33 | --- a/Makerules |
| 34 | +++ b/Makerules |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 35 | @@ -778,6 +778,9 @@ ifeq ($(build-shared),yes) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 36 | $(common-objpfx)libc.so: $(common-objpfx)libc.map |
| 37 | endif |
| 38 | common-generated += libc.so libc_pic.os |
| 39 | +ifndef subdir |
| 40 | +install-extras := soinit.o sofini.o |
| 41 | +endif |
| 42 | ifdef libc.so-version |
| 43 | $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so |
| 44 | $(make-link) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 45 | @@ -1029,6 +1032,7 @@ endif |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 46 | |
| 47 | install: check-install-supported |
| 48 | |
| 49 | +installed-libcs := $(installed-libcs) $(inst_libdir)/libc_pic.a |
| 50 | install: $(installed-libcs) |
| 51 | $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force) |
| 52 | $(make-target-directory) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | @@ -1057,6 +1061,22 @@ versioned := $(strip $(foreach so,$(install-lib.so),\ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 54 | install-lib.so-versioned := $(filter $(versioned), $(install-lib.so)) |
| 55 | install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so)) |
| 56 | |
| 57 | +# Install the _pic.a files for versioned libraries, and corresponding |
| 58 | +# .map files. |
| 59 | +# libpthread_pic.a breaks mklibs, so don't install it and its map. |
| 60 | +install-lib := $(install-lib) $(install-lib.so-versioned:%.so=%_pic.a) |
| 61 | +install-lib := $(filter-out libpthread_pic.a,$(install-lib)) |
| 62 | +# Despite having a soname libhurduser and libmachuser do not use symbol |
| 63 | +# versioning, so don't install the corresponding .map files. |
| 64 | +ifeq ($(build-shared),yes) |
| 65 | +install-map := $(patsubst %.so,%.map,\ |
| 66 | + $(foreach L,$(install-lib.so-versioned),$(notdir $L))) |
| 67 | +install-map := $(filter-out libhurduser.map libmachuser.map libpthread.map,$(install-map)) |
| 68 | +ifndef subdir |
| 69 | +install-map := $(install-map) libc.map |
| 70 | +endif |
| 71 | +endif |
| 72 | + |
| 73 | # For versioned libraries, we install three files: |
| 74 | # $(inst_libdir)/libfoo.so -- for linking, symlink or ld script |
| 75 | # $(inst_slibdir)/libfoo.so.NN -- for loading by SONAME, symlink |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 76 | @@ -1311,9 +1331,22 @@ $(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 77 | endif # headers-nonh |
| 78 | endif # headers |
| 79 | |
| 80 | +ifdef install-map |
| 81 | +$(addprefix $(inst_libdir)/,$(patsubst lib%.map,lib%_pic.map,$(install-map))): \ |
| 82 | + $(inst_libdir)/lib%_pic.map: $(common-objpfx)lib%.map $(+force) |
| 83 | + $(do-install) |
| 84 | +endif |
| 85 | + |
| 86 | +ifdef install-extras |
| 87 | +$(addprefix $(inst_libdir)/libc_pic/,$(install-extras)): \ |
| 88 | + $(inst_libdir)/libc_pic/%.o: $(elf-objpfx)%.os $(+force) |
| 89 | + $(do-install) |
| 90 | +endif |
| 91 | + |
| 92 | .PHONY: install-bin-nosubdir install-bin-script-nosubdir \ |
| 93 | install-rootsbin-nosubdir install-sbin-nosubdir install-lib-nosubdir \ |
| 94 | - install-data-nosubdir install-headers-nosubdir |
| 95 | + install-data-nosubdir install-headers-nosubdir install-map-nosubdir \ |
| 96 | + install-extras-nosubdir |
| 97 | install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin)) |
| 98 | install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script)) |
| 99 | install-rootsbin-nosubdir: \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 100 | @@ -1326,6 +1359,10 @@ install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data)) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 101 | install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers)) |
| 102 | install-others-nosubdir: $(install-others) |
| 103 | install-others-programs-nosubdir: $(install-others-programs) |
| 104 | +install-map-nosubdir: $(addprefix $(inst_libdir)/,\ |
| 105 | + $(patsubst lib%.map,lib%_pic.map,$(install-map))) |
| 106 | +install-extras-nosubdir: $(addprefix $(inst_libdir)/libc_pic/,\ |
| 107 | + $(install-extras)) |
| 108 | |
| 109 | # We need all the `-nosubdir' targets so that `install' in the parent |
| 110 | # doesn't depend on several things which each iterate over the subdirs. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 111 | @@ -1335,7 +1372,8 @@ install-%:: install-%-nosubdir ; |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 112 | |
| 113 | .PHONY: install install-no-libc.a-nosubdir |
| 114 | install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir \ |
| 115 | - install-lib-nosubdir install-others-nosubdir |
| 116 | + install-lib-nosubdir install-others-nosubdir \ |
| 117 | + install-map-nosubdir install-extras-nosubdir |
| 118 | ifeq ($(build-programs),yes) |
| 119 | install-no-libc.a-nosubdir: install-bin-nosubdir install-bin-script-nosubdir \ |
| 120 | install-rootsbin-nosubdir install-sbin-nosubdir \ |
| 121 | -- |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 122 | 2.16.1 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 123 | |