summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-12-20 09:29:29 +0100
committerThomas Schwinge <thomas@codesourcery.com>2013-12-20 09:29:29 +0100
commita65dd355fb80a05215e15ae97649de52aec885e3 (patch)
tree81701bb0c6b648630f2bf1729a85d7f5eb49e67b /Makerules
parent296a5732f94abe4d5699dc981e4ccfb950b48cee (diff)
parentb4578bab30f72cddd2cf38abfb39f9c8dc892249 (diff)
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules53
1 files changed, 42 insertions, 11 deletions
diff --git a/Makerules b/Makerules
index 8a8ddc9e42..6a9c4cfd39 100644
--- a/Makerules
+++ b/Makerules
@@ -93,7 +93,7 @@ before-compile := $(filter $(common-objpfx)mach% $(common-objpfx)hurd%,\
$(before-compile))
# Even before that, we need abi-versions.h which is generated right here.
-ifeq ($(versioning),yes)
+ifeq ($(build-shared),yes)
ifndef avoid-generated
before-compile := $(common-objpfx)abi-versions.h $(before-compile)
$(common-objpfx)abi-versions.h: $(..)scripts/abi-versions.awk \
@@ -106,7 +106,7 @@ $(common-objpfx)%.latest: $(common-objpfx)abi-versions.h
$(common-objpfx)abi-versions.h > $@T
mv -f $@T $@
endif # avoid-generated
-endif # $(versioning) = yes
+endif # $(build-shared) = yes
ifndef avoid-generated
before-compile := $(common-objpfx)libc-abis.h $(before-compile)
@@ -283,7 +283,7 @@ endif
# Generate version maps, but wait until sysdep-subdirs is known
ifeq ($(sysd-sorted-done),t)
-ifeq ($(versioning),yes)
+ifeq ($(build-shared),yes)
-include $(common-objpfx)sysd-versions
$(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
common-generated += $(version-maps)
@@ -324,7 +324,7 @@ $(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \
) > $@T
mv -f $@T $@
endif # avoid-generated
-endif # $(versioning) = yes
+endif # $(build-shared) = yes
endif # sysd-sorted-done
# Generate .dT files as we compile.
@@ -400,9 +400,9 @@ elide-routines.og += $(shared-only-routines)
ifeq (yes,$(build-shared))
-# Reference map file only when versioning is selected and a map file name
+# Reference map file only when shared libraries are built and a map file name
# is given.
-ifeq ($(versioning),yes)
+ifeq ($(build-shared),yes)
map-file = $(firstword $($(@F:.so=-map)) \
$(addprefix $(common-objpfx), \
$(filter $(@F:.so=.map),$(version-maps))))
@@ -604,17 +604,48 @@ generated += libc_pic.opts libc_pic.os.clean
libc_pic_clean := .clean
endif
-# Do not filter ld.so out of libc.so link.
+# Build a possibly-modified version of libc_pic.a for use in building
+# linkobj/libc.so.
+ifeq (,$(filter sunrpc,$(subdirs)))
+$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a
+ $(make-target-directory)
+ ln -f $< $@
+else
+$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a \
+ $(common-objpfx)sunrpc/librpc_compat_pic.a
+ $(make-target-directory)
+ (cd $(common-objpfx)linkobj; \
+ $(AR) x ../libc_pic.a; \
+ rm $$($(AR) t ../sunrpc/librpc_compat_pic.a | sed 's/^compat-//'); \
+ $(AR) x ../sunrpc/librpc_compat_pic.a; \
+ $(AR) cr libc_pic.a *.os; \
+ rm *.os)
+endif # $(subdirs) contains sunrpc
+
+# Clear link-libc-deps for the libc.so libraries so build-shlibs does not
+# filter ld.so out of the list of linked objects.
$(common-objpfx)libc.so: link-libc-deps = # empty
+$(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
-# Use our own special initializer and finalizer files for libc.so.
+# Use our own special initializer and finalizer files for the libc.so
+# libraries.
$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
$(common-objpfx)libc_pic.os$(libc_pic_clean) \
$(elfobjdir)/sofini.os \
- $(elfobjdir)/interp.os $(elfobjdir)/ld.so \
+ $(elfobjdir)/interp.os \
+ $(elfobjdir)/ld.so \
$(shlib-lds)
$(build-shlib)
-ifeq ($(versioning),yes)
+
+$(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os \
+ $(common-objpfx)linkobj/libc_pic.a \
+ $(elfobjdir)/sofini.os \
+ $(elfobjdir)/interp.os \
+ $(elfobjdir)/ld.so \
+ $(shlib-lds)
+ $(build-shlib)
+
+ifeq ($(build-shared),yes)
$(common-objpfx)libc.so: $(common-objpfx)libc.map
endif
common-generated += libc.so libc_pic.os
@@ -1171,7 +1202,7 @@ endif
CPPFLAGS-nonlib = -DNOT_IN_libc=1
-ifeq ($(versioning),yes)
+ifeq ($(build-shared),yes)
# Generate normalized lists of symbols, versions, and data sizes.
# This is handy for checking against existing library binaries.