This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Add dependencies on libc_nonshared.a for some tests
- From: Daniel Jacobowitz <drow at false dot org>
- To: Roland McGrath <roland at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Mon, 10 Oct 2005 15:28:31 -0400
- Subject: Re: Add dependencies on libc_nonshared.a for some tests
- References: <20050425222224.GA29509@nevyn.them.org> <200504252233.j3PMXLqJ010580@magilla.sf.frob.com>
On Mon, Apr 25, 2005 at 03:33:21PM -0700, Roland McGrath wrote:
> You should make a variable for the common dependencies that go with using
> $(build-module), and change all the rules to use that. Also, remember that
> some dirs have their own ChangeLogs.
Here's an update of the patch I posted in May, without the bits for the
removed LinuxThreads. As a reminder, this patch makes sure that all
shared objects built for the testsuite are linked with
libc_nonshared.a if they are linked with -lc.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-10-10 Daniel Jacobowitz <dan@codesourcery.com>
* extra-modules.mk: Add a build rule.
* dlfcn/Makefile: Remove $(build-module) rules.
* elf/Makefile: Likewise. Create all-modules-names and move
filtmod1 to there from modules-names. Use libc_nonshared.a
for filtmod1.so.
nptl/
2005-10-10 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile: Remove $(build-module) rules.
Index: extra-modules.mk
===================================================================
--- extra-modules.mk.orig 2005-10-10 11:05:42.000000000 -0400
+++ extra-modules.mk 2005-10-10 15:24:11.000000000 -0400
@@ -7,3 +7,7 @@ module := $(firstword $(extra-modules-le
extra-modules-left := $(filter-out $(module),$(extra-modules-left))
CPPFLAGS-$(module).c += -DNOT_IN_libc
+
+$(objpfx)$(module).so: $(objpfx)$(module).os $(common-objpfx)shlib.lds \
+ $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
+ $(build-module)
Index: dlfcn/Makefile
===================================================================
--- dlfcn/Makefile.orig 2005-10-10 11:05:42.000000000 -0400
+++ dlfcn/Makefile 2005-10-10 15:24:11.000000000 -0400
@@ -68,8 +68,6 @@ generated := $(modules-names:=.so)
include ../Rules
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
-$(test-modules): $(objpfx)%.so: $(objpfx)%.os $(common-objpfx)shlib.lds
- $(build-module)
ifeq ($(build-shared),yes)
# Build all the modules even when not actually running test programs.
Index: elf/Makefile
===================================================================
--- elf/Makefile.orig 2005-10-10 11:05:42.000000000 -0400
+++ elf/Makefile 2005-10-10 15:24:11.000000000 -0400
@@ -182,7 +182,7 @@ modules-names = testobj1 testobj2 testob
testobj1_1 failobj constload2 constload3 unloadmod \
dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
$(modules-nodelete-$(have-z-nodelete)) \
- $(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \
+ $(modules-nodlopen-$(have-z-nodlopen)) filtmod2 \
reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
neededobj1 neededobj2 neededobj3 neededobj4 \
@@ -219,9 +219,14 @@ modules-nodelete-yes = nodelmod1 nodelmo
nodel2mod1 nodel2mod2 nodel2mod3
modules-nodlopen-yes = nodlopenmod nodlopenmod2
modules-execstack-yes = tst-execstack-mod
-extra-objs += $(addsuffix .os,$(strip $(modules-names)))
+
+# filtmod1 has a special link rule, so it is not in $(modules-names)
+CPPFLAGS-filtmod1.c += -DNOT_IN_libc
+all-modules-names := $(modules-names) filtmod1
+
+extra-objs += $(addsuffix .os,$(strip $(all-modules-names)))
# We need this variable to be sure the test modules get the right CPPFLAGS.
-test-extras += $(modules-names)
+test-extras += $(all-modules-names)
include ../Rules
@@ -385,8 +390,8 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS)
CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
-test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
-generated += $(addsuffix .so,$(strip $(modules-names)))
+test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(all-modules-names))))
+generated += $(addsuffix .so,$(strip $(all-modules-names)))
ifeq (yes,$(build-shared))
ifeq ($(cross-compiling),no)
@@ -490,10 +495,6 @@ reldep9mod1.so-no-z-defs = yes
unload3mod4.so-no-z-defs = yes
unload4mod1.so-no-z-defs = yes
-# filtmod1.so has a special rule
-$(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os
- $(build-module)
-
ifeq ($(build-shared),yes)
# Build all the modules even when not actually running test programs.
tests: $(test-modules)
@@ -599,11 +600,13 @@ $(objpfx)nodlopenmod2.so: $(objpfx)nodlo
$(objpfx)nodlopen2: $(libdl)
$(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so
-$(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
+$(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so \
+ $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
$(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
-L$(subst :, -L,$(rpath-link)) \
-Wl,-rpath-link=$(rpath-link) \
- $< -Wl,-F,$(objpfx)filtmod2.so
+ $< -Wl,-F,$(objpfx)filtmod2.so \
+ $(common-objpfx)libc_nonshared.a
$(objpfx)filter: $(objpfx)filtmod1.so
$(objpfx)unload: $(libdl)
Index: nptl/Makefile
===================================================================
--- nptl/Makefile.orig 2005-10-10 11:05:42.000000000 -0400
+++ nptl/Makefile 2005-10-10 15:24:11.000000000 -0400
@@ -295,9 +295,6 @@ tst-tls5modd.so-no-z-defs = yes
tst-tls5mode.so-no-z-defs = yes
tst-tls5modf.so-no-z-defs = yes
-$(test-modules): $(objpfx)%.so: $(objpfx)%.os $(common-objpfx)shlib.lds
- $(build-module)
-
ifeq ($(build-shared),yes)
# Build all the modules even when not actually running test programs.
tests: $(test-modules)