diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-08 13:32:08 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-08 14:34:22 +0200 |
commit | dd7a8ad7ba25cb2269b306758c7d97d4a95527e6 (patch) | |
tree | 2b2ad1c4cc26eec1dedbc8452edc23943ecd26aa | |
parent | 314a431d37757ad179e89b83c3cb5720bae26e60 (diff) | |
download | glibc-dd7a8ad7ba25cb2269b306758c7d97d4a95527e6.zip glibc-dd7a8ad7ba25cb2269b306758c7d97d4a95527e6.tar.gz glibc-dd7a8ad7ba25cb2269b306758c7d97d4a95527e6.tar.bz2 |
pthread: Move back linking rules to nptl and htl
d6d74ec16 ('htl: Enable more tests') moved the linking rules from
nptl/Makefile and htl/Makefile to the shared sysdeps/pthread/Makefile. But
e.g. on powerpc some tests are added in sysdeps/powerpc/Makefile, which is
included *after* sysdeps/pthread/Makefile, and thus the tests don't get
affected by the rules and fail to link. For now let's just copy over the
set of rules in both nptl/Makefile and htl/Makefile.
* sysdeps/pthread/Makefile: Move libpthread linking rules to...
* htl/Makefile: ... here and...
* nptl/Makefile: ... there.
-rw-r--r-- | htl/Makefile | 18 | ||||
-rw-r--r-- | nptl/Makefile | 18 | ||||
-rw-r--r-- | sysdeps/pthread/Makefile | 18 |
3 files changed, 36 insertions, 18 deletions
diff --git a/htl/Makefile b/htl/Makefile index f647e4a..2de98e1 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -203,3 +203,21 @@ libc-link.so = $(common-objpfx)libc.so extra-B-pthread.so = -B$(common-objpfx)htl/ include ../Rules + +# Make sure we link with the thread library. +ifeq ($(build-shared),yes) +$(addprefix $(objpfx), \ + $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \ + $(tests-nolibpthread), \ + $(tests) $(tests-internal) $(xtests) $(test-srcs) $(tests-container))): \ + $(objpfx)libpthread.so +$(objpfx)tst-unload: $(libdl) +# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so, +# since otherwise libpthread.so comes before libc.so when linking. +$(addprefix $(objpfx), $(tests-reverse)): \ + $(objpfx)../libc.so $(objpfx)libpthread.so +$(objpfx)../libc.so: $(common-objpfx)libc.so ; +$(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(objpfx)libpthread.a +else +$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a +endif diff --git a/nptl/Makefile b/nptl/Makefile index 3f0b107..55cd147 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -569,6 +569,24 @@ $(objpfx)libpthread.so: $(addprefix $(objpfx),$(crti-objs) $(crtn-objs)) $(objpfx)libpthread.so: +preinit += $(addprefix $(objpfx),$(crti-objs)) $(objpfx)libpthread.so: +postinit += $(addprefix $(objpfx),$(crtn-objs)) +# Make sure we link with the thread library. +ifeq ($(build-shared),yes) +$(addprefix $(objpfx), \ + $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \ + $(tests-nolibpthread), \ + $(tests) $(tests-internal) $(xtests) $(test-srcs) $(tests-container))): \ + $(objpfx)libpthread.so +$(objpfx)tst-unload: $(libdl) +# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so, +# since otherwise libpthread.so comes before libc.so when linking. +$(addprefix $(objpfx), $(tests-reverse)): \ + $(objpfx)../libc.so $(objpfx)libpthread.so +$(objpfx)../libc.so: $(common-objpfx)libc.so ; +$(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(objpfx)libpthread.a +else +$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a +endif + ifeq ($(build-shared),yes) $(objpfx)crti.o: $(objpfx)pt-crti.o ln -f $< $@ diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index 2d483c8..8d094b2 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -228,22 +228,4 @@ LDFLAGS-tst-join7mod.so = -Wl,-soname,tst-join7mod.so CFLAGS-tst-unwind-thread.c += -funwind-tables -# Make sure we link with the thread library. -ifeq ($(build-shared),yes) -$(addprefix $(objpfx), \ - $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \ - $(tests-nolibpthread), \ - $(tests) $(tests-internal) $(xtests) $(test-srcs) $(tests-container))): \ - $(objpfx)libpthread.so -$(objpfx)tst-unload: $(libdl) -# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so, -# since otherwise libpthread.so comes before libc.so when linking. -$(addprefix $(objpfx), $(tests-reverse)): \ - $(objpfx)../libc.so $(objpfx)libpthread.so -$(objpfx)../libc.so: $(common-objpfx)libc.so ; -$(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(objpfx)libpthread.a -else -$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a -endif - endif |