diff mbox

Consistently use $(elf-objpfx)

Message ID Pine.LNX.4.64.1405192152211.743@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers May 19, 2014, 9:54 p.m. UTC
As previously noted
<https://sourceware.org/ml/libc-alpha/2013-05/msg00696.html>,
$(elf-objpfx) and $(elfobjdir) are redundant and should be
consolidated.  This patch consolidates on $(elf-objpfx) (for
consistency with $(csu-objpfx)), also changing direct uses of
$(common-objpfx)elf/ to use $(elf-objpfx).

Tested x86_64, including that installed shared libraries are unchanged
by the patch.

2014-05-19  Joseph Myers  <joseph@codesourcery.com>

	* Makeconfig [$(build-hardcoded-path-in-tests) = yes]
	(rtld-tests-LDFLAGS): Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.
	(link-libc-before-gnulib): Likewise.
	(elfobjdir): Remove variable.
	* Makefile (install): Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.
	* Makerules (link-libc-args): Use $(elf-objpfx) instead of
	$(elfobjdir)/.
	(link-libc-deps): Likewise.
	($(common-objpfx)libc.so): Likewise.
	($(common-objpfx)linkobj/libc.so): Likewise.
	[$(cross-compiling) = no] (symbolic-link-prog): Use $(elf-objpfx)
	instead of $(common-objpfx)elf/.
	(symbolic-link-list): Likewise.
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Likewise.
	* sysdeps/arm/Makefile (gnulib-arch): Use $(elf-objpfx) instead of
	$(elfobjdir)/.
	(static-gnulib-arch): Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.

localedata/ChangeLog:
2014-05-19  Joseph Myers  <joseph@codesourcery.com>

	* Makefile (LOCALEDEF): Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.

Comments

Siddhesh Poyarekar May 20, 2014, 4:36 a.m. UTC | #1
On Mon, May 19, 2014 at 09:54:26PM +0000, Joseph S. Myers wrote:
> As previously noted
> <https://sourceware.org/ml/libc-alpha/2013-05/msg00696.html>,
> $(elf-objpfx) and $(elfobjdir) are redundant and should be
> consolidated.  This patch consolidates on $(elf-objpfx) (for
> consistency with $(csu-objpfx)), also changing direct uses of
> $(common-objpfx)elf/ to use $(elf-objpfx).
> 
> Tested x86_64, including that installed shared libraries are unchanged
> by the patch.

Looks good to me.

Siddhesh

> 
> 2014-05-19  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* Makeconfig [$(build-hardcoded-path-in-tests) = yes]
> 	(rtld-tests-LDFLAGS): Use $(elf-objpfx) instead of
> 	$(common-objpfx)elf/.
> 	(link-libc-before-gnulib): Likewise.
> 	(elfobjdir): Remove variable.
> 	* Makefile (install): Use $(elf-objpfx) instead of
> 	$(common-objpfx)elf/.
> 	* Makerules (link-libc-args): Use $(elf-objpfx) instead of
> 	$(elfobjdir)/.
> 	(link-libc-deps): Likewise.
> 	($(common-objpfx)libc.so): Likewise.
> 	($(common-objpfx)linkobj/libc.so): Likewise.
> 	[$(cross-compiling) = no] (symbolic-link-prog): Use $(elf-objpfx)
> 	instead of $(common-objpfx)elf/.
> 	(symbolic-link-list): Likewise.
> 	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
> 	[$(cross-compiling) = no]: Likewise.
> 	* sysdeps/arm/Makefile (gnulib-arch): Use $(elf-objpfx) instead of
> 	$(elfobjdir)/.
> 	(static-gnulib-arch): Likewise.
> 	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
> 	[$(cross-compiling) = no]: Use $(elf-objpfx) instead of
> 	$(common-objpfx)elf/.
> 
> localedata/ChangeLog:
> 2014-05-19  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* Makefile (LOCALEDEF): Use $(elf-objpfx) instead of
> 	$(common-objpfx)elf/.
> 
> diff --git a/Makeconfig b/Makeconfig
> index 2df4c88..736190b 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -451,7 +451,7 @@ rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
>  endif
>  ifndef rtld-tests-LDFLAGS
>  ifeq (yes,$(build-hardcoded-path-in-tests))
> -rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(common-objpfx)elf/ld.so
> +rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
>  else
>  rtld-tests-LDFLAGS = $(rtld-LDFLAGS)
>  endif
> @@ -470,7 +470,7 @@ link-libc-tests-rpath-link = $(link-libc-rpath-link)
>  endif
>  link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
>  			  $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
> -			  $(as-needed) $(common-objpfx)elf/ld.so \
> +			  $(as-needed) $(elf-objpfx)ld.so \
>  			  $(no-as-needed)
>  link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
>  link-libc-tests = $(link-libc-tests-rpath-link) \
> @@ -485,8 +485,6 @@ link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-o
>  endif
>  endif
>  
> -elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
> -
>  # Differences in the linkers on the various platforms.
>  LDFLAGS-rpath-ORIGIN = -Wl,-rpath,'$$ORIGIN'
>  LDFLAGS-soname-fname = -Wl,-soname,$(@F)
> diff --git a/Makefile b/Makefile
> index e026fb1..2eab98c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -105,9 +105,9 @@ install-symbolic-link: subdir_install
>  	rm -f $(symbolic-link-list)
>  
>  install:
> -	-test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
> -	  $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
> -				       $(slibdir) $(libdir)
> +	-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C LANGUAGE=C \
> +	  $(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
> +				$(slibdir) $(libdir)
>  ifneq (no,$(PERL))
>  ifeq (/usr,$(prefix))
>  ifeq (,$(install_root))
> diff --git a/Makerules b/Makerules
> index 4427f4e..817d07e 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -417,7 +417,7 @@ endif
>  link-libc-args = -Wl,--start-group \
>  		 $(libc-for-link) \
>  		 $(common-objpfx)libc_nonshared.a \
> -		 $(as-needed) $(elfobjdir)/ld.so $(no-as-needed) \
> +		 $(as-needed) $(elf-objpfx)ld.so $(no-as-needed) \
>  		 -Wl,--end-group
>  
>  # The corresponding shared libc to use.  This may be modified for a
> @@ -428,7 +428,7 @@ libc-for-link = $(common-objpfx)libc.so
>  # not just commands, they cannot use target-specific variables so need
>  # to name both possible libc.so objects.
>  link-libc-deps = $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so \
> -		 $(common-objpfx)libc_nonshared.a $(elfobjdir)/ld.so
> +		 $(common-objpfx)libc_nonshared.a $(elf-objpfx)ld.so
>  
>  # Pattern rule to build a shared object from an archive of PIC objects.
>  # This must come after the installation rules so Make doesn't try to
> @@ -592,19 +592,19 @@ $(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
>  
>  # Use our own special initializer and finalizer files for the libc.so
>  # libraries.
> -$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
> +$(common-objpfx)libc.so: $(elf-objpfx)soinit.os \
>  			 $(common-objpfx)libc_pic.os$(libc_pic_clean) \
> -			 $(elfobjdir)/sofini.os \
> -			 $(elfobjdir)/interp.os \
> -			 $(elfobjdir)/ld.so \
> +			 $(elf-objpfx)sofini.os \
> +			 $(elf-objpfx)interp.os \
> +			 $(elf-objpfx)ld.so \
>  			 $(shlib-lds)
>  	$(build-shlib)
>  
> -$(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os \
> +$(common-objpfx)linkobj/libc.so: $(elf-objpfx)soinit.os \
>  			 $(common-objpfx)linkobj/libc_pic.a \
> -			 $(elfobjdir)/sofini.os \
> -			 $(elfobjdir)/interp.os \
> -			 $(elfobjdir)/ld.so \
> +			 $(elf-objpfx)sofini.os \
> +			 $(elf-objpfx)interp.os \
> +			 $(elf-objpfx)ld.so \
>  			 $(shlib-lds)
>  	$(build-shlib)
>  
> @@ -895,8 +895,8 @@ endif
>  
>  ifeq (yes,$(build-shared))
>  ifeq (no,$(cross-compiling))
> -symbolic-link-prog := $(common-objpfx)elf/sln
> -symbolic-link-list := $(common-objpfx)elf/symlink.list
> +symbolic-link-prog := $(elf-objpfx)sln
> +symbolic-link-list := $(elf-objpfx)symlink.list
>  define make-shlib-link
>  echo `$(..)scripts/rellns-sh -p $< $@` $@ >> $(symbolic-link-list)
>  endef
> diff --git a/iconvdata/Makefile b/iconvdata/Makefile
> index 60d8bd3..074d330 100644
> --- a/iconvdata/Makefile
> +++ b/iconvdata/Makefile
> @@ -255,7 +255,7 @@ ifeq (no,$(cross-compiling))
>  # if this libc has more gconv modules than the previously installed one.
>  	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
>  	   LC_ALL=C LANGUAGE=C \
> -	   $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
> +	   $(elf-objpfx)ld.so --library-path $(rpath-link) \
>  	   $(common-objpfx)iconv/iconvconfig \
>  	     $(addprefix --prefix=,$(install_root)); \
>  	fi
> diff --git a/localedata/Makefile b/localedata/Makefile
> index 94562be..f2dd24c 100644
> --- a/localedata/Makefile
> +++ b/localedata/Makefile
> @@ -209,7 +209,7 @@ INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
>  
>  # Sometimes the whole collection of locale files should be installed.
>  LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
> -$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
> +$(elf-objpfx)ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
>  install-locales: $(INSTALL-SUPPORTED-LOCALES)
>  
>  install-locales-dir:
> diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
> index b218e76..daaf4aa 100644
> --- a/sysdeps/arm/Makefile
> +++ b/sysdeps/arm/Makefile
> @@ -1,5 +1,5 @@
> -gnulib-arch = $(elfobjdir)/libgcc-stubs.a
> -static-gnulib-arch = $(elfobjdir)/libgcc-stubs.a
> +gnulib-arch = $(elf-objpfx)libgcc-stubs.a
> +static-gnulib-arch = $(elf-objpfx)libgcc-stubs.a
>  
>  ifeq ($(subdir),elf)
>  sysdep-dl-routines += tlsdesc dl-tlsdesc
> diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
> index 37f021c..9fee71b 100644
> --- a/sysdeps/s390/s390-64/Makefile
> +++ b/sysdeps/s390/s390-64/Makefile
> @@ -77,7 +77,7 @@ ifeq (no,$(cross-compiling))
>  # if this libc has more gconv modules than the previously installed one.
>  	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
>  	   LC_ALL=C LANGUAGE=C \
> -	   $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
> +	   $(elf-objpfx)ld.so --library-path $(rpath-link) \
>  	   $(common-objpfx)iconv/iconvconfig \
>  	     $(addprefix --prefix=,$(install_root)); \
>  	fi
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com
diff mbox

Patch

diff --git a/Makeconfig b/Makeconfig
index 2df4c88..736190b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -451,7 +451,7 @@  rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
 endif
 ifndef rtld-tests-LDFLAGS
 ifeq (yes,$(build-hardcoded-path-in-tests))
-rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(common-objpfx)elf/ld.so
+rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
 else
 rtld-tests-LDFLAGS = $(rtld-LDFLAGS)
 endif
@@ -470,7 +470,7 @@  link-libc-tests-rpath-link = $(link-libc-rpath-link)
 endif
 link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
 			  $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
-			  $(as-needed) $(common-objpfx)elf/ld.so \
+			  $(as-needed) $(elf-objpfx)ld.so \
 			  $(no-as-needed)
 link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
 link-libc-tests = $(link-libc-tests-rpath-link) \
@@ -485,8 +485,6 @@  link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-o
 endif
 endif
 
-elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
-
 # Differences in the linkers on the various platforms.
 LDFLAGS-rpath-ORIGIN = -Wl,-rpath,'$$ORIGIN'
 LDFLAGS-soname-fname = -Wl,-soname,$(@F)
diff --git a/Makefile b/Makefile
index e026fb1..2eab98c 100644
--- a/Makefile
+++ b/Makefile
@@ -105,9 +105,9 @@  install-symbolic-link: subdir_install
 	rm -f $(symbolic-link-list)
 
 install:
-	-test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
-	  $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
-				       $(slibdir) $(libdir)
+	-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C LANGUAGE=C \
+	  $(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
+				$(slibdir) $(libdir)
 ifneq (no,$(PERL))
 ifeq (/usr,$(prefix))
 ifeq (,$(install_root))
diff --git a/Makerules b/Makerules
index 4427f4e..817d07e 100644
--- a/Makerules
+++ b/Makerules
@@ -417,7 +417,7 @@  endif
 link-libc-args = -Wl,--start-group \
 		 $(libc-for-link) \
 		 $(common-objpfx)libc_nonshared.a \
-		 $(as-needed) $(elfobjdir)/ld.so $(no-as-needed) \
+		 $(as-needed) $(elf-objpfx)ld.so $(no-as-needed) \
 		 -Wl,--end-group
 
 # The corresponding shared libc to use.  This may be modified for a
@@ -428,7 +428,7 @@  libc-for-link = $(common-objpfx)libc.so
 # not just commands, they cannot use target-specific variables so need
 # to name both possible libc.so objects.
 link-libc-deps = $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so \
-		 $(common-objpfx)libc_nonshared.a $(elfobjdir)/ld.so
+		 $(common-objpfx)libc_nonshared.a $(elf-objpfx)ld.so
 
 # Pattern rule to build a shared object from an archive of PIC objects.
 # This must come after the installation rules so Make doesn't try to
@@ -592,19 +592,19 @@  $(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
 
 # Use our own special initializer and finalizer files for the libc.so
 # libraries.
-$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
+$(common-objpfx)libc.so: $(elf-objpfx)soinit.os \
 			 $(common-objpfx)libc_pic.os$(libc_pic_clean) \
-			 $(elfobjdir)/sofini.os \
-			 $(elfobjdir)/interp.os \
-			 $(elfobjdir)/ld.so \
+			 $(elf-objpfx)sofini.os \
+			 $(elf-objpfx)interp.os \
+			 $(elf-objpfx)ld.so \
 			 $(shlib-lds)
 	$(build-shlib)
 
-$(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os \
+$(common-objpfx)linkobj/libc.so: $(elf-objpfx)soinit.os \
 			 $(common-objpfx)linkobj/libc_pic.a \
-			 $(elfobjdir)/sofini.os \
-			 $(elfobjdir)/interp.os \
-			 $(elfobjdir)/ld.so \
+			 $(elf-objpfx)sofini.os \
+			 $(elf-objpfx)interp.os \
+			 $(elf-objpfx)ld.so \
 			 $(shlib-lds)
 	$(build-shlib)
 
@@ -895,8 +895,8 @@  endif
 
 ifeq (yes,$(build-shared))
 ifeq (no,$(cross-compiling))
-symbolic-link-prog := $(common-objpfx)elf/sln
-symbolic-link-list := $(common-objpfx)elf/symlink.list
+symbolic-link-prog := $(elf-objpfx)sln
+symbolic-link-list := $(elf-objpfx)symlink.list
 define make-shlib-link
 echo `$(..)scripts/rellns-sh -p $< $@` $@ >> $(symbolic-link-list)
 endef
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index 60d8bd3..074d330 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -255,7 +255,7 @@  ifeq (no,$(cross-compiling))
 # if this libc has more gconv modules than the previously installed one.
 	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
 	   LC_ALL=C LANGUAGE=C \
-	   $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
+	   $(elf-objpfx)ld.so --library-path $(rpath-link) \
 	   $(common-objpfx)iconv/iconvconfig \
 	     $(addprefix --prefix=,$(install_root)); \
 	fi
diff --git a/localedata/Makefile b/localedata/Makefile
index 94562be..f2dd24c 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -209,7 +209,7 @@  INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
-$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
+$(elf-objpfx)ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
 install-locales: $(INSTALL-SUPPORTED-LOCALES)
 
 install-locales-dir:
diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
index b218e76..daaf4aa 100644
--- a/sysdeps/arm/Makefile
+++ b/sysdeps/arm/Makefile
@@ -1,5 +1,5 @@ 
-gnulib-arch = $(elfobjdir)/libgcc-stubs.a
-static-gnulib-arch = $(elfobjdir)/libgcc-stubs.a
+gnulib-arch = $(elf-objpfx)libgcc-stubs.a
+static-gnulib-arch = $(elf-objpfx)libgcc-stubs.a
 
 ifeq ($(subdir),elf)
 sysdep-dl-routines += tlsdesc dl-tlsdesc
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index 37f021c..9fee71b 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -77,7 +77,7 @@  ifeq (no,$(cross-compiling))
 # if this libc has more gconv modules than the previously installed one.
 	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
 	   LC_ALL=C LANGUAGE=C \
-	   $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
+	   $(elf-objpfx)ld.so --library-path $(rpath-link) \
 	   $(common-objpfx)iconv/iconvconfig \
 	     $(addprefix --prefix=,$(install_root)); \
 	fi