Patchwork libgo patch committed: Don't put .gox files in version-specific dirs

login
register
mail settings
Submitter Ian Taylor
Date Feb. 14, 2012, 7:40 p.m.
Message ID <mcrzkcl9pb7.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/141178/
State New
Headers show

Comments

Ian Taylor - Feb. 14, 2012, 7:40 p.m.
The .gox files are always put in directories whose names include the gcc
version number and the target name.  This is because the .gox files are
version specific and not backward compatible.  PR 48410 points out that
when using the --enable-version-specific-runtime-libs configure option,
this caused the .gox files to be put in a directory which included the
verison number and target twice, which is useless.  This patch fixes the
problem by ignoring --enable-version-specific-runtime-libs for the .gox
files.  Bootstrapped on x86_64-unknown-linux-gnu.  Committed to
mainline.

Ian

Patch

diff -r 201e3b7018f9 libgo/Makefile.am
--- a/libgo/Makefile.am	Tue Feb 14 11:35:12 2012 -0800
+++ b/libgo/Makefile.am	Tue Feb 14 11:36:44 2012 -0800
@@ -25,6 +25,7 @@ 
 
 toolexecdir = $(glibgo_toolexecdir)
 toolexeclibdir = $(glibgo_toolexeclibdir)
+toolexeclibgodir = $(nover_glibgo_toolexeclibdir)/go/$(gcc_version)/$(target_alias)
 
 LIBFFI = @LIBFFI@
 LIBFFIINCS = @LIBFFIINCS@
@@ -97,8 +98,6 @@ 
 toolexeclib_LTLIBRARIES = libgo.la
 toolexeclib_LIBRARIES = libgobegin.a
 
-toolexeclibgodir = $(toolexeclibdir)/go/$(gcc_version)/$(target_alias)
-
 toolexeclibgo_DATA = \
 	bufio.gox \
 	bytes.gox \
diff -r 201e3b7018f9 libgo/configure.ac
--- a/libgo/configure.ac	Tue Feb 14 11:35:12 2012 -0800
+++ b/libgo/configure.ac	Tue Feb 14 11:36:44 2012 -0800
@@ -58,7 +58,6 @@ 
 
 glibgo_toolexecdir=no
 glibgo_toolexeclibdir=no
-glibgo_prefixdir=$prefix
 
 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
 AC_ARG_ENABLE([version-specific-runtime-libs],
@@ -80,25 +79,28 @@ 
 
 # Calculate glibgo_toolexecdir, glibgo_toolexeclibdir
 # Install a library built with a cross compiler in tooldir, not libdir.
+if test -n "$with_cross_host" &&
+   test x"$with_cross_host" != x"no"; then
+  nover_glibgo_toolexecdir='${exec_prefix}/${host_alias}'
+  nover_glibgo_toolexeclibdir='${toolexecdir}/lib'
+else
+  nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
+  nover_glibgo_toolexeclibdir='${libdir}'
+fi
+multi_os_directory=`$CC -print-multi-os-directory`
+case $multi_os_directory in
+  .) ;; # Avoid trailing /.
+  *) nover_glibgo_toolexeclibdir=${nover_glibgo_toolexeclibdir}/${multi_os_directory} ;;
+esac
+
 if test x"$glibgo_toolexecdir" = x"no"; then
-  if test -n "$with_cross_host" &&
-     test x"$with_cross_host" != x"no"; then
-    glibgo_toolexecdir='${exec_prefix}/${host_alias}'
-    glibgo_toolexeclibdir='${toolexecdir}/lib'
-  else
-    glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
-    glibgo_toolexeclibdir='${libdir}'
-  fi
-  multi_os_directory=`$CC -print-multi-os-directory`
-  case $multi_os_directory in
-    .) ;; # Avoid trailing /.
-    *) glibgo_toolexeclibdir=$glibgo_toolexeclibdir/$multi_os_directory ;;
-  esac
+  glibgo_toolexecdir="${nover_glibgo_toolexecdir}"
+  glibgo_toolexeclibdir="${nover_glibgo_toolexeclibdir}"
 fi
 
-AC_SUBST(glibgo_prefixdir)
 AC_SUBST(glibgo_toolexecdir)
 AC_SUBST(glibgo_toolexeclibdir)
+AC_SUBST(nover_glibgo_toolexeclibdir)
 
 # See if the user wants to configure without libffi.  Some
 # architectures don't support it.  FIXME: We should set a default