This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR bootstrap/17369: Bootstrap failure with binutils-2.15.90.0.1.1
On Wed, Sep 15, 2004 at 08:31:02PM -0400, DJ Delorie wrote:
>
> > --- gcc/libiberty/testsuite/Makefile.in.ld-path 2003-11-18 11:21:41.000000000 -0800
> > +++ gcc/libiberty/testsuite/Makefile.in 2004-09-15 15:04:28.000000000 -0700
> > @@ -40,6 +40,9 @@ MULTISRCTOP =
> >
> > INCDIR=$(srcdir)/../$(MULTISRCTOP)../include
> >
> > +gcc_ld_path:=$(MULTIBUILDTOP)../../../gcc
> > +include $(srcdir)/../../gcc/Make-ld-path.in
>
> Can't do this. Libiberty isn't always built with gcc. Also, Makefile
> includes aren't explicitly permitted outside gcc, so please don't use
> them in libiberty.
>
> The right way to do it is to add something to
> $top/config/<something>.m4 and include it in configure.ac, which adds
> something to the Makefile through substitution.
>
> The snippet you include also uses GNU makeisms. That isn't permitted
> in libiberty yet.
This is an updated patch. I tried to add "LD_LIBRARY_PATH=xxx" and
"LD_LIBRARY_PATH=xxx; export LD_LIBRARY_PATH" to XXX_FOR_TARGET. But
autoconf doesn't like it.
H.J.
-----
2004-09-22 H.J. Lu <hongjiu.lu@intel.com>
* configure.in (SET_GCC_LIB_PATH): Set and substitute.
* configure: Regenerated.
* Makefile.tpl (REALLY_SET_LIB_PATH): Add @SET_GCC_LIB_PATH@.
(configure-target-[+module+]): Likewise. Export SET_GCC_LIB_PATH
to target.
(configure-gcc): Likewise.
* Makefile.in: Regenerated.
config/
2004-09-22 H.J. Lu <hongjiu.lu@intel.com>
* gcc-lib-path.m4: New file.
gcc/
2004-09-22 H.J. Lu <hongjiu.lu@intel.com>
* configure.ac: Include ../config/gcc-lib-path.m4. Use
GNU_MAKE_GCC_LIB_PATH.
* configure: Regenerated.
* Makefile.in (@set_gcc_lib_path@): Added.
--- 1/Makefile.tpl.ld-path 2004-07-08 16:43:28.000000000 -0700
+++ 1/Makefile.tpl 2004-09-23 09:59:01.000000000 -0700
@@ -103,6 +103,7 @@ SET_LIB_PATH = @SET_LIB_PATH@
# Some platforms don't like blank entries, so we remove duplicate,
# leading and trailing colons.
REALLY_SET_LIB_PATH = \
+ @SET_GCC_LIB_PATH@ \
$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
# This is the list of directories to be built for the build system.
@@ -973,6 +974,11 @@ ENDIF raw_cxx +]
NM="$(NM_FOR_TARGET)"; export NM; \
RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ if [ x"@SET_GCC_LIB_PATH@" != x ]; then \
+ SET_GCC_LIB_PATH="@SET_GCC_LIB_PATH@"; \
+ export SET_GCC_LIB_PATH; \
+ else true; fi; \
+ @SET_GCC_LIB_PATH@ \
echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
case $(srcdir) in \
@@ -1095,6 +1101,11 @@ configure-gcc:
WINDRES="$(WINDRES)"; export WINDRES; \
OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+ if [ x"@SET_GCC_LIB_PATH@" != x ]; then \
+ SET_GCC_LIB_PATH="@SET_GCC_LIB_PATH@"; \
+ export SET_GCC_LIB_PATH; \
+ else true; fi; \
+ @SET_GCC_LIB_PATH@ \
echo Configuring in gcc; \
cd gcc || exit 1; \
case $(srcdir) in \
--- 1/config/gcc-lib-path.m4.ld-path 2004-09-23 09:59:01.000000000 -0700
+++ 1/config/gcc-lib-path.m4 2004-09-23 09:59:01.000000000 -0700
@@ -0,0 +1,10 @@
+AC_DEFUN([GNU_MAKE_GCC_LIB_PATH],
+[
+if test x"$SET_GCC_LIB_PATH" != x; then
+ eval "set_gcc_lib_path=$SET_GCC_LIB_PATH"
+ set_gcc_lib_path="export $set_gcc_lib_path"
+else
+ set_gcc_lib_path=
+fi
+AC_SUBST(set_gcc_lib_path)
+])dnl
--- 1/configure.in.ld-path 2004-06-26 21:31:19.000000000 -0700
+++ 1/configure.in 2004-09-23 10:42:54.000000000 -0700
@@ -2145,4 +2145,24 @@ fi
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
+# If gcc is built natively with shared library enabled, set
+# $RPATH_ENVVAR to make sure the newly built gcc shared librares are
+# used.
+SET_GCC_LIB_PATH=
+if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then
+ case "${enable_shared}" in
+ no | "") ;;
+ *)
+ eval "d=\$$RPATH_ENVVAR"
+ if test x"$d" != x; then
+ d="$pwd/gcc:$d"
+ else
+ d="$pwd/gcc"
+ fi
+ SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
+ ;;
+ esac
+fi
+AC_SUBST(SET_GCC_LIB_PATH)
+
AC_OUTPUT(Makefile)
--- 1/gcc/Makefile.in.ld-path 2004-09-23 09:59:01.000000000 -0700
+++ 1/gcc/Makefile.in 2004-09-23 09:59:01.000000000 -0700
@@ -951,6 +951,9 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi
# language hooks, generated by configure
@language_hooks@
+# Set up library path if needed.
+@set_gcc_lib_path@
+
# per-language makefile fragments
ifneq ($(LANG_MAKEFRAGS),)
include $(LANG_MAKEFRAGS)
--- 1/gcc/configure.ac.ld-path 2004-09-23 09:59:01.000000000 -0700
+++ 1/gcc/configure.ac 2004-09-23 09:59:01.000000000 -0700
@@ -3139,6 +3139,9 @@ AC_SUBST(target_cpu_default)
AC_SUBST_FILE(language_hooks)
+sinclude(../config/gcc-lib-path.m4)
+GNU_MAKE_GCC_LIB_PATH
+
# If it doesn't already exist, create document directory
echo "checking for the document directory." 1>&2
if test -d doc ; then