This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[zlib] [PATH] Use AM_ENABLE_MULTILIB only if with_target_subdir isn't empty
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>, Binutils <binutils at sourceware dot org>, GDB <gdb-patches at sourceware dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 31 Mar 2015 13:12:38 -0700
- Subject: [zlib] [PATH] Use AM_ENABLE_MULTILIB only if with_target_subdir isn't empty
- Authentication-results: sourceware.org; auth=none
On Tue, Mar 31, 2015 at 11:55 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Mar 31, 2015 at 10:18 AM, Antoine Tremblay
> <antoine.tremblay@ericsson.com> wrote:
>>
>>
>> On 03/31/2015 01:16 PM, H.J. Lu wrote:
>>>
>>> On Tue, Mar 31, 2015 at 10:12 AM, Antoine Tremblay
>>> <antoine.tremblay@ericsson.com> wrote:
>>>>>
>>>>> Also doing ./configure in binutils/zlib I get :
>>>>>
>>>>> config.status: creating Makefile
>>>>> config.status: executing default-1 commands
>>>>> ./config.status: line 1190: ./../../config-ml.in: No such file or
>>>>> directory
>>>>>
>>>>> So configure does not exit cleanly...ideas?
>>>>>
>>>>>
>>>>
>>>> I did a bit more research on this issue and I get this if I build gdb
>>>> from
>>>> it's source directory
>>>>
>>>> in binutils-gdb
>>>> ./configure
>>>> make
>>>>
>>>> make fails with : while in zlib directory
>>>>
>>>> configure: creating ./config.status
>>>> config.status: creating Makefile
>>>> config.status: executing default-1 commands
>>>> ./config.status: line 1190: ./../../config-ml.in: No such file or
>>>> directory
>>>>
>>>> However if I build out of tree in like binutils-gdb/build for example I
>>>> do
>>>> not get this issue.
>>>>
>>>> Could this be related to 92c695a14f6a5a24b177e89624c13d7dbcbf9e1f ?
>>>>
>>>> Subject: [PATCH 09/76] A zlib to tarball
>>>>
>>>> I see this snippet there
>>>>
>>>> - ./configure --target=i386-pc-linux-gnu
>>>> + ./configure --target=i386-pc-linux-gnu \
>>>> + --with-target-subdir=. \
>>>> + --disable-multilib
>>>>
>>>> With these options I get around the configure problem only to fail in gas
>>>> with :
>>>> make[4]: Entering directory `/home/x/src/binutils-gdb/gas'
>>>> /bin/bash ./libtool --tag=CC --mode=link gcc -W -Wall
>>>> -Wstrict-prototypes
>>>> -Wmissing-prototypes -Wshadow -Werror -I./../zlib -g -O2
>>>> -static-libstdc++
>>>> -static-libgcc -o as-new app.o as.o atof-generic.o compress-debug.o
>>>> cond.o
>>>> depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o
>>>> flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o
>>>> listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o
>>>> stabs.o subsegs.o symbols.o write.o tc-i386.o obj-elf.o atof-ieee.o
>>>> ../opcodes/libopcodes.la ../bfd/libbfd.la ../libiberty/libiberty.a -ldl
>>>> libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes
>>>> -Wshadow -Werror -I./../zlib -g -O2 -static-libstdc++ -static-libgcc -o
>>>> as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o
>>>> dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o
>>>> flonum-konst.o
>>>> flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o
>>>> literal.o
>>>> macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o
>>>> symbols.o write.o tc-i386.o obj-elf.o atof-ieee.o
>>>> ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a
>>>> -L/home/x/src/binutils-gdb/zlib -lz ../libiberty/libiberty.a -ldl
>>>> /usr/bin/ld: cannot find -lz
>>>>
>>>>
>>>> This is with head as : 711a72d3d6f8cd3c3f408e718ff19aa4bfd2144e
>>>>
>>>> Did you try to compile directly in the src tree ?
>>>>
>>>
>>> Yes, I did. You need to add --disable-multilib, and maybe
>>> --with-target-subdir=.
>>>
>>
>> As I said if I add --disable-multilib, -with-target-subdir=.
>>
>> I get into the gas missing zlib error above ?
>>
>> Also I don't think it's a good idea that gdb would require options to
>> compile in it's source tree ?
>>
>> Is there a good reason for this ?
>>
>
zlib can be built as a host and a target library. We should
use AM_ENABLE_MULTILIB only when building for target.
This patch for zlib is borrowed from libbacktrace which is also
built as a host and a target library. I will check it into binutils
tree.
--
H.J.
From 0753a9ac8a73328180cb06fb5357ee8c2c68641f Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 31 Mar 2015 11:35:30 -0700
Subject: [PATCH 1/2] Use AM_ENABLE_MULTILIB only if with_target_subdir isn't
empty
* configure.ac (AM_ENABLE_MULTILIB): Use only if
${with_target_subdir} isn't empty.
* configure: Regenerated.
---
zlib/configure | 8 +++++---
zlib/configure.ac | 4 +++-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/zlib/configure b/zlib/configure
index 1a9d854..8378857 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -2181,7 +2181,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-# Default to --enable-multilib
+if test -n "${with_target_subdir}"; then
+ # Default to --enable-multilib
# Check whether --enable-multilib was given.
if test "${enable_multilib+set}" = set; then :
enableval=$enable_multilib; case "$enableval" in
@@ -2218,6 +2219,7 @@ fi
ac_config_commands="$ac_config_commands default-1"
+fi
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -10403,7 +10405,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10406 "configure"
+#line 10408 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10509,7 +10511,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10512 "configure"
+#line 10514 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/zlib/configure.ac b/zlib/configure.ac
index fb8d943..57d6fa5 100644
--- a/zlib/configure.ac
+++ b/zlib/configure.ac
@@ -4,7 +4,9 @@ AC_PREREQ(2.64)
AC_INIT
AC_CONFIG_SRCDIR([zlib.h])
-AM_ENABLE_MULTILIB(, ..)
+if test -n "${with_target_subdir}"; then
+ AM_ENABLE_MULTILIB(, ..)
+fi
AC_CANONICAL_SYSTEM
--
1.9.3
From 4efdb2dba47fdf7eaa18db306686fef12986ecc3 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 31 Mar 2015 11:36:17 -0700
Subject: [PATCH 2/2] Remove --with-target-subdir=. --disable-multilib
zlib/configure is updated to properly handle in-tree build for host.
* src-release.sh: Don't configure with --with-target-subdir=.
--disable-multilib.
---
src-release.sh | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src-release.sh b/src-release.sh
index 8229e15..9b985f0 100755
--- a/src-release.sh
+++ b/src-release.sh
@@ -83,9 +83,7 @@ do_proto_toplev()
<Makefile.in >tmp
mv -f tmp Makefile.in
#
- ./configure --target=i386-pc-linux-gnu \
- --with-target-subdir=. \
- --disable-multilib
+ ./configure --target=i386-pc-linux-gnu
$MAKE configure-host configure-target \
ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
CC_FOR_TARGET="$CC" CXX_FOR_TARGET="$CXX"
--
1.9.3