This is the mail archive of the mailing list for the GCC 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]

Re: GCC_NO_EXECUTABLES vs. libtool

Hello Ian,

* Ian Lance Taylor wrote on Tue, Mar 29, 2011 at 07:39:25AM CEST:
> We have several bug reports for 4.6.0 about failures of the form 
> checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

> Unfortunately, on a GNU/Linux host (recall that for a target library,
> the target is the host), libtool itself does a link test.

The general strategy I've been following with these is wrapping the link
test result with a cache variable, and trying to let the cache variable
be pre-set by in the no-executables case (and adjusting
libtool/tests/  Then, even if the cache variable is
not set, the user can work around it.

> From the top
> level libtool.m4 file, in _LT_SYS_DYNAMIC_LINKER, in the "linux* |
> k*bsd*-gnu | kopensolaris*-gnu" case:
>       [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
> 	 [lt_cv_shlibpath_overrides_runpath=yes])])
> That test fails when a link fails.  That test must not be run when
> linking fails.

There's a simple workaround for the time being: pass

(or =no, depending on which is correct) to toplevel configure.

> Shortly after that code in libtool.m4, I see this:
>   if test -f /etc/; then
>     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
>     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
>   fi
> Testing /etc/ is absolutely meaningless when building a target
> library for a non-native compilation.  That test must not be run when
> cross-compiling.

Right.  There are probably more such cases.  I'm not sure how to change
the code for best results here, apart from just using /lib /usr/lib.

> We should definitely fix this for gcc 4.6.1.  However, I don't know what
> the best way to fix this is.  Our gcc-specific target libraries check
> $with_cross_host to see if they are being built as a cross-compiled
> target library.  Presumably libtool doesn't want to check that.
> GCC_NO_EXECUTABLES sets a gcc-specific shell variable and overrides
> AC_LINK_IFELSE to test variable.  libtool doesn't know anything about
> that.  So what should we do here?

Well, we can introduce another variable that tells Libtool macros that
/ is not something to look at for system details.  I'm not sure if
$with_sysroot can be (ab)used for that.


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