This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils 2.19.92 linker broke with --as-needed flag
- From: Alan Modra <amodra at gmail dot com>
- To: Vincent Wen <wenvincent90 at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 3 Apr 2013 12:50:10 +1030
- Subject: Re: binutils 2.19.92 linker broke with --as-needed flag
- References: <CALehDX4fduBUun9a3bc99exx3B+wB1KiwkY_HpfN9ps2bUbkZg at mail dot gmail dot com> <CAF_=-cA7WYSfO0jjGCPpKcPwOEjD+7v0G6pTbtDm13Zkv8rkgA at mail dot gmail dot com> <5154E517 dot 4000409 at gmail dot com> <CALehDX77XzF6hGxT82y+Ofe+ypwG64uZmrfj+e4ZZm-nSEhgOA at mail dot gmail dot com> <CAF_=-cAo_+bni4N++ynNcYQ5RKkMBg1i7aNcXZ-aCJPVb3ub8Q at mail dot gmail dot com> <CALehDX5F_WXmKS9K+EipTw5uGkM37cOc2K+Zqxpe8XwBtzaTxg at mail dot gmail dot com> <CAF_=-cDsPpAs8=D3dH1ho1NRDJ+W5VVhug8HU1fJmusDq_aNAQ at mail dot gmail dot com> <CAF_=-cDJDPPzhh7TF2-rcro=PnL1iBkMv8jvV1BU7EO7En5zbg at mail dot gmail dot com> <20130402232743 dot GA23282 at bubble dot grove dot modra dot org> <CAF_=-cC7M0jhvSnsHA7xrPPedbWefQC0B9STpvQATP7nqZJg1g at mail dot gmail dot com>
On Tue, Apr 02, 2013 at 06:51:06PM -0700, Vincent Wen wrote:
> Relocatable linking with relocations from format elf32-i386 (ldgram.o)
> to format elf64-x86-64 (tmpdir/ld-partial.o) is not supported
Your compiler is defaulting to i386 code (-m32) rather than x86_64
code (-m64). It might be because you built your own gcc wrongly (or
your distro did), or you have CFLAGS/CXXFLAGS or CC/CXX set in your
environment, or "gcc" is a script that provides -m32 before calling
the real gcc, or perhaps some other reason. Whatever it is, that
needs fixing, or perhaps may be worked around by configuring binutils
with something like
CC="gcc -m64" CXX="g++ -m64" configure
--
Alan Modra
Australia Development Lab, IBM