about summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-09-24 17:31:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-09-24 17:31:36 -0700
commit94b32c39127967ea58adac3d737a1e5d6116fb77 (patch)
tree2265e2bd2c5ce6def39f5a7c80ba32e932ac955f
parent15055a1cd7e2c249093a5f6d57eca817767d8b85 (diff)
downloadglibc-94b32c39127967ea58adac3d737a1e5d6116fb77.tar.gz
glibc-94b32c39127967ea58adac3d737a1e5d6116fb77.tar.xz
glibc-94b32c39127967ea58adac3d737a1e5d6116fb77.zip
Use static link by default for --disable-shared
-rw-r--r--ChangeLog7
-rw-r--r--Makeconfig44
-rw-r--r--NEWS10
3 files changed, 40 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c7dfe610f..43ba419355 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-09-24  H.J. Lu  <hongjiu.lu@intel.com>
 
+	[BZ #13679]
+	* Makeconfig (+link): Defined as $(+link-static) if
+	$(build-shared) isn't yes.
+	(link-tests): Defined as $(+link-static-tests) if $(build-shared)
+	isn't yes.
+	(static-gnulib): Add -lgcc_eh if $(build-shared) isn't yes.
+
 	* Makeconfig (+postctorT): Replace crtendS.o with crtend.o.
 
 	[BZ #14562]
diff --git a/Makeconfig b/Makeconfig
index 42b836ee18..e96ebc7e96 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -411,22 +411,6 @@ LDFLAGS.so += $(hashstyle-LDFLAGS)
 LDFLAGS-rtld += $(hashstyle-LDFLAGS)
 endif
 
-# Commands for linking programs with the C library.
-ifndef +link
-+link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
-	      $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
-	      $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
-	      $(addprefix $(csu-objpfx),$(start-installed-name)) \
-	      $(+preinit) $(+prector) \
-	      $(filter-out $(addprefix $(csu-objpfx),start.o \
-						     $(start-installed-name))\
-			   $(+preinit) $(link-extra-libs) \
-			   $(common-objpfx)libc% $(+postinit),$^) \
-	      $(link-extra-libs)
-+link-after-libc = $(+postctor) $(+postinit)
-+link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
-+link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
-endif
 # Command for linking PIE programs with the C library.
 ifndef +link-pie
 +link-pie = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
@@ -457,6 +441,27 @@ ifndef +link-static
 +link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
 		     $(+link-static-after-libc)
 endif
+# Commands for linking programs with the C library.
+ifndef +link
+ifeq (yes,$(build-shared))
++link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
+	      $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+	      $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
+	      $(addprefix $(csu-objpfx),$(start-installed-name)) \
+	      $(+preinit) $(+prector) \
+	      $(filter-out $(addprefix $(csu-objpfx),start.o \
+						     $(start-installed-name))\
+			   $(+preinit) $(link-extra-libs) \
+			   $(common-objpfx)libc% $(+postinit),$^) \
+	      $(link-extra-libs)
++link-after-libc = $(+postctor) $(+postinit)
++link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
++link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
+else
++link = $(+link-static)
++link-tests = $(+link-static-tests)
+endif
+endif
 # Command for statically linking bounded-pointer programs with the C library.
 ifndef +link-bounded
 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
@@ -568,7 +573,14 @@ gnulib-arch =
 gnulib = -lgcc $(gnulib-arch)
 gnulib-tests := -lgcc $(libgcc_eh)
 static-gnulib-arch =
+# By default, elf/static-stubs.o, instead of -lgcc_eh, is used to
+# statically link programs.  When --disable-shared is used, we use
+# -lgcc_eh since elf/static-stubs.o isn't sufficient.
+ifeq (yes,$(build-shared))
 static-gnulib = -lgcc $(static-gnulib-arch)
+else
+static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch)
+endif
 static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
 libc.so-gnulib := -lgcc
 endif
diff --git a/NEWS b/NEWS
index 13523ac265..0933b30a7c 100644
--- a/NEWS
+++ b/NEWS
@@ -10,11 +10,11 @@ Version 2.17
 * The following bugs are resolved with this release:
 
   1349, 3479, 5044, 5400, 6778, 6808, 9685, 9914, 10014, 10038, 11607,
-  13412, 13542, 13717, 13696, 13939, 13966, 14042, 14090, 14166, 14150,
-  14151, 14154, 14157, 14166, 14173, 14195, 14237, 14252, 14283, 14298,
-  14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14459, 14476,
-  14505, 14510, 14516, 14518, 14519, 14532, 14538, 14544, 14545, 14562,
-  14576, 14579, 14583, 14587.
+  13412, 13542, 13679, 13717, 13696, 13939, 13966, 14042, 14090, 14166,
+  14150, 14151, 14154, 14157, 14166, 14173, 14195, 14237, 14252, 14283,
+  14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14459,
+  14476, 14505, 14510, 14516, 14518, 14519, 14532, 14538, 14544, 14545,
+  14562, 14576, 14579, 14583, 14587.
 
 * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
   Optimized versions of memcpy, memset, and memcmp added for System z10 and