This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/pr22362/symlink created. glibc-2.26.9000-678-gd7ca99d


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr22362/symlink has been created
        at  d7ca99d742d11803ab0e2b594ab828886bc069dc (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d7ca99d742d11803ab0e2b594ab828886bc069dc

commit d7ca99d742d11803ab0e2b594ab828886bc069dc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Oct 29 12:03:03 2017 -0700

    nptl: Simplify libpthread.so rules
    
    libpthread.so must be created against a special crti.o and when multi-lib
    GCC is used to build glibc, the special crti.o must be placed under the
    `gcc -print-multi-directory` subdirectory so that -B$(common-objpfx)nptl/
    will pick it up.  This patch compiles the special crti.o directly with
    "-include pt-crti.h" and uses the new make-link-multidir from the fix
    for [BZ #22362] to create the symlink for the multi-lib subdirectory.
    It simplifies libpthread.so rules to support -B$(common-objpfx)nptl/
    and -B$(common-objpfx)/ for correct crt*.o files.
    
    Tested on x86-64 for x86-64, i686 and x32.
    
    	* nptl/Makefile (multidir.mk): Don't generate.
    	($(objpfx)multidir.mk): Removed.
    	(crtn-objs): Likewise.
    	(generated-dirs): Don't add $(multidir).
    	(multilib-crti-objs): New.
    	(extra-objs): Use $(multilib-crti-objs).  Don't add pt-crti.o.
    	($(objpfx)libpthread.so): Removed.
    	(CPPFLAGS-crti.o): New.
    	($(objpfx)crti.o): Removed.
    	($(objpfx)$(multidir)/crti.o): Likewise.
    	($(objpfx)$(multidir)/crtn.o): Likewise.
    	($(addprefix $(objpfx)$(multidir)/, $(crti-objs))): New target.
    	(generated): Remove multidir.mk.
    	* nptl/pt-crti.S: Renamed to ...
    	* nptl/pt-crti.h: This.  Don't include <crti.S>.

diff --git a/nptl/Makefile b/nptl/Makefile
index d819349..f2550cf 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -401,27 +401,13 @@ tests: $(test-modules)
 endif
 
 ifeq ($(build-shared),yes)
-
-# Set the `multidir' variable by grabbing the variable from the compiler.
-# We do it once and save the result in a generated makefile.
--include $(objpfx)multidir.mk
-$(objpfx)multidir.mk: $(common-objpfx)config.make
-	$(make-target-directory)
-	dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
-	echo "multidir := $$dir" > $@T
-	mv -f $@T $@
-
 crti-objs := crti.o
-crtn-objs := crtn.o
-ifneq (,$(patsubst .,,$(multidir)))
-generated-dirs += $(firstword $(subst /, , $(multidir)))
-crti-objs += $(multidir)/crti.o
-crtn-objs += $(multidir)/crtn.o
-$(objpfx)$(multidir):
-	mkdir -p $@
+extra-objs += $(crti-objs)
+
+ifneq ($(multidir),.)
+multilib-crti-objs := $(addprefix $(multidir)/, $(crti-objs))
+extra-objs += $(multilib-crti-objs)
 endif
-extra-objs += $(crti-objs) $(crtn-objs)
-extra-objs += pt-crti.o
 endif
 
 CFLAGS-flockfile.c = $(libio-mtsafe)
@@ -623,9 +609,7 @@ LDLIBS-tst-cancel24 = $(no-as-needed) -lstdc++
 LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24)
 
 extra-B-pthread.so = -B$(common-objpfx)nptl/
-$(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))
+CPPFLAGS-crti.o = -include pt-crti.h
 
 # Make sure we link with the thread library.
 ifeq ($(build-shared),yes)
@@ -659,19 +643,13 @@ $(objpfx)tst-cleanup0-cmp.out: tst-cleanup0.expect $(objpfx)tst-cleanup0.out
 	cmp $^ > $@; \
 	$(evaluate-test)
 
-$(objpfx)crti.o: $(objpfx)pt-crti.o
-	ln -f $< $@
-
 ifneq ($(multidir),.)
-$(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/
-	ln -f $< $@
-
-$(objpfx)$(multidir)/crtn.o: $(objpfx)crtn.o $(objpfx)$(multidir)/
-	ln -f $< $@
+$(addprefix $(objpfx)$(multidir)/, $(crti-objs)): $(addprefix $(objpfx), $(crti-objs))
+	$(make-link-multidir)
 endif
 
 generated += libpthread_nonshared.a \
-	     multidir.mk tst-atfork2.mtrace tst-cancel-wrappers.out \
+	     tst-atfork2.mtrace tst-cancel-wrappers.out \
 	     tst-tls6.out
 
 generated += $(objpfx)tst-atfork2.mtrace \
diff --git a/nptl/pt-crti.S b/nptl/pt-crti.h
similarity index 99%
rename from nptl/pt-crti.S
rename to nptl/pt-crti.h
index d2371bc..f7b2c61 100644
--- a/nptl/pt-crti.S
+++ b/nptl/pt-crti.h
@@ -39,5 +39,3 @@
 
 #define PREINIT_FUNCTION __pthread_initialize_minimal_internal
 #define PREINIT_FUNCTION_WEAK 0
-
-#include <crti.S>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3242db2138de7e0786ee3806f8bd016925d06099

commit 3242db2138de7e0786ee3806f8bd016925d06099
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Oct 28 17:41:16 2017 -0700

    Use newly built crt*.o files to build shared objects [BZ #22362]
    
    When multi-lib GCC is used to build glibc, the search order of GCC driver
    for crt*.o is -B*/`gcc -print-multi-directory`, the installed diretory,
    -B*/.  This patch adds multi-lib support to csu/Makefile so that
    -B/glibc-build-directory/csu/ will pick up the newly built crt*.o.
    
    Tested on x86-64 for i686 and x32.
    
    	[BZ #22362]
    	* Makerules (make-link-multidir): New.
    	* config.make.in (multidir): New.
    	* configure.ac (libc_cv_multidir): New.  AC_SUBST.
    	* configure: Regenerated.
    	* csu/Makefile [$(multidir) != .](multilib-extra-objs): New.
    	[$(multidir) != .](extra-objs): Add $(multilib-extra-objs).
    	[$(multidir) != .]($(addprefix $(objpfx)$(multidir)/, $(install-lib))):
    	New target.

diff --git a/Makerules b/Makerules
index bbfbefe..522de25 100644
--- a/Makerules
+++ b/Makerules
@@ -1079,6 +1079,11 @@ rm -f $@.new
 $(SHELL) $(..)scripts/rellns-sh $< $@.new
 mv -f $@.new $@
 endef
+define make-link-multidir
+$(patsubst %/,cd %,$(objpfx)); \
+  $(LN_S) . $(multidir) 2> /dev/null; \
+  test -L $(multidir)
+endef
 else
 # If we have no symbolic links don't bother with rellns-sh.
 define make-link
@@ -1086,6 +1091,10 @@ rm -f $@.new
 $(LN_S) $< $@.new
 mv -f $@.new $@
 endef
+define make-link-multidir
+$(make-target-directory)
+ln -f $(objpfx)/$(@F) $@
+endef
 endif
 
 ifeq (yes,$(build-shared))
diff --git a/config.make.in b/config.make.in
index fd2dbc9..bd84a57 100644
--- a/config.make.in
+++ b/config.make.in
@@ -21,6 +21,7 @@ includedir = @includedir@
 datarootdir = @datarootdir@
 localstatedir = @libc_cv_localstatedir@
 localedir = @localedir@
+multidir= @libc_cv_multidir@
 
 # Should we use and build ldconfig?
 use-ldconfig = @use_ldconfig@
diff --git a/configure b/configure
index 6010977..c8697d9 100755
--- a/configure
+++ b/configure
@@ -594,6 +594,7 @@ mach_interface_list
 DEFINES
 static_nss
 profile
+libc_cv_multidir
 libc_cv_pie_default
 libc_cv_pic_default
 shared
@@ -6698,6 +6699,11 @@ fi
 $as_echo "$libc_cv_pie_default" >&6; }
 
 
+# Set the `multidir' variable by grabbing the variable from the compiler.
+# We do it once and save the result in a generated makefile.
+libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
+
+
 
 
 
diff --git a/configure.ac b/configure.ac
index 148f7d1..9f25c9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1783,6 +1783,11 @@ fi
 rm -f conftest.*])
 AC_SUBST(libc_cv_pie_default)
 
+# Set the `multidir' variable by grabbing the variable from the compiler.
+# We do it once and save the result in a generated makefile.
+libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
+AC_SUBST(libc_cv_multidir)
+
 AC_SUBST(profile)
 AC_SUBST(static_nss)
 
diff --git a/csu/Makefile b/csu/Makefile
index fd668a5..e42a32b 100644
--- a/csu/Makefile
+++ b/csu/Makefile
@@ -77,6 +77,11 @@ crtstuff = crti crtn
 install-lib += $(crtstuff:=.o)
 extra-objs += $(crtstuff:=.o)
 
+ifneq ($(multidir),.)
+multilib-extra-objs = $(addprefix $(multidir)/, $(install-lib))
+extra-objs += $(multilib-extra-objs)
+endif
+
 extra-objs += abi-note.o init.o
 asm-CPPFLAGS += -I$(objpfx).
 
@@ -147,3 +152,8 @@ $(objpfx)abi-tag.h: $(..)abi-tags
 	done
 	if test -r $@.new; then mv -f $@.new $@; \
 	else echo >&2 'This configuration not matched in $<'; exit 1; fi
+
+ifneq ($(multidir),.)
+$(addprefix $(objpfx)$(multidir)/, $(install-lib)): $(addprefix $(objpfx), $(install-lib))
+	$(make-link-multidir)
+endif

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]