Message ID | 54C18B4F.4020308@ubuntu.com |
---|---|
State | New |
Headers | show |
On Thu, Jan 22, 2015 at 3:44 PM, Matthias Klose <doko@ubuntu.com> wrote: > > However for the libbacktrace and the libsanitizer builds, the AM_ENABLE_MULTILIB > macro is included way too late. Scan the generated configure file for > "cross_compiling" and see that the above snippet is added after the failing > checks. The fix seems to be simple, just move the AM_ENABLE_MULTILIB macro up so > that the "cross_compiling" value is corrected before it is tested. This is what > the patch is doing. > > However ... for every runtime library there is still something wrong, at least > one linker check in the generated configure is done before the expansion of the > AM_ENABLE_MULTILIB macro. I'm not trying to fix that with this patch ... > autoconf offers a AC_REQUIRE macro, so AM_ENABLE_MULTILIB should add one to > ensure that this macros is always expanded before the first check for > "cross_compiling", but I'm not sure which one. > > Small patch, but took me some time to find out :-/ > > This patch should go to trunk and all active branches. Ok to check in? The libbacktrace library is unusual because we build it for both the host and the target. When building for the host, we do not want to multilib it--that would make no sense. You've moved the AM_ENABLE_MULTILIB out of the test -n "${with_target_subdir}"; don't do that. It's fine with me if you move AM_ENABLE_MULTILIB earlier as long as you keep the test. Probably a build maintainer should take a look at this patch. Ian
--- a/src/libbacktrace/configure.ac +++ b/src/libbacktrace/configure.ac @@ -34,6 +34,8 @@ AC_CONFIG_SRCDIR(backtrace.h) AC_CONFIG_HEADER(config.h) +AM_ENABLE_MULTILIB(, ..) + AC_CANONICAL_SYSTEM target_alias=${target_alias-$host_alias} @@ -83,7 +85,6 @@ if test -n "${with_target_subdir}"; then # We are compiling a GCC library. We can assume that the unwind # library exists. - AM_ENABLE_MULTILIB(, ..) BACKTRACE_FILE="backtrace.lo simple.lo" else AC_CHECK_HEADER([unwind.h], --- a/src/libsanitizer/configure.ac +++ b/src/libsanitizer/configure.ac @@ -5,6 +5,8 @@ AC_INIT(package-unused, version-unused, libsanitizer) AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h]) +AM_ENABLE_MULTILIB(, ..) + AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) AC_ARG_ENABLE(version-specific-runtime-libs, [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], @@ -26,7 +28,6 @@ GCC_LIBSTDCXX_RAW_CXX_FLAGS AM_INIT_AUTOMAKE(foreign no-dist) -AM_ENABLE_MULTILIB(, ..) AM_MAINTAINER_MODE # Calculate toolexeclibdir