This is the mail archive of the
mailing list for the binutils project.
Re: Problem with cross compiling Gold linker
- From: Lei Wang <lei dot wang dot left at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sun, 23 Nov 2014 14:07:10 +0800
- Subject: Re: Problem with cross compiling Gold linker
- Authentication-results: sourceware.org; auth=none
- References: <87C3B42C-B8CC-414E-931C-EF3573BAABDC at gmail dot com> <CAHACq4pjk-jWQVyWc3knTNVDWri7MKss_V-UkntLMGgDz4j=zQ at mail dot gmail dot com>
Thank you for your help. I followed your instruction of checking the HAVE_READV. And I found it was failed during linking time while configuration was checking whether there is usable readv() func. I add the path of cross library path of libc into CXXFLAGS "-L/arm-linux-guneabi/arm-linux-gnueabi/libâ. It makes HAVE_READV defined and all the rest are successfully compiled.
Thanks for your help again.
> On 2014å11æ22æ, at äå5:16, Cary Coutant <firstname.lastname@example.org> wrote:
> First of all, I'd suggest working from more recent sources.
> Binutils-2.23 is fairly old now.
> Gold's configure script looks for available implementations of
> std::unordered_map or std::tr1::unordered_map before it settles on
> using __gnu_cxx::hash_map (from ext/hash_map). If you're getting
> deprecation warnings from ext/hash_map, then it should have found one
> of the others to use instead. Check your config.log to see why those
> configure checks failed.
> The struct iovec problem shouldn't be happening if your runtime
> defines readv(). Check your config.log to see why HAVE_READV didn't
> get defined. (I don't remember the timing of binutils-2.23, but there
> was a bug related to HAVE_READV that was fixed in 2010.)
> On Fri, Nov 21, 2014 at 1:18 AM, Lei Wang <email@example.com> wrote:
>> Hi. Iâm tring to run Gold on ARM-based board. So I have to cross compile gold linker on x86 platform first. The toolchain I used is arm-linux-gnueabi-gcc/g++ 4.8.3 and the version of gold I was compiling is 2.23 (the version of gold is 0.1).
>> The first configuration I tried is:
>> ./gold/configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++
>> and the result of make shows a lot of warnings on using deprecated header files, such as:
>> In file included from gcc-4.8.3/arm-linux-gnueabi/arm-linux-gnueabi/include/c++/4.8.3/ext/hash_map
>> from gold/gold.h:85
>> from gold/archive.cc:23
>> /gcc-4.8.3/arm-linux-gnueabi/arm-linux-gnueabi/include/c++/4.8.3/backward/backward_warning.h:32.:2 error: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. â
>> so I tried the second configuration:
>> ./gold/configure --disable-werror --host=arm-linux-gnueabihf CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++
>> And the warning wonât terminate the compilation, but I got:
>> gold/fileread.cc:87:8: eror: redefinition of âstruct iovecâ
>> In file included from gcc-4.8.3/arm-linux-gnueabi/arm-linux-gnueabi/include/bits/fcntl.h:26:0
>> from gcc-4.8.3/arm-linux-gnueabi/arm-linux-gnueabi/include/fcntl.h:32
>> from gold/fileread.cc:28:
>> gcc-4.8.3/arm-linux-gnueabi/arm-linux-gnueabi/include/bits/uio.h:43:8: error: previous definition of âstruct iovecâ
>> And I searched this problem online and tried the solution to add -DHAVE_SYS_UIO_H into CXXFLAGS:
>> ./gold/configure --disable-werror --host=arm-linux-gnueabihf CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ CXXFLAGS=â-DHAVE_SYS_UIO_Hâ
>> But it doesnât work. I canât find any guides on building gold linker online, so would anyone kindly help me with this? thanks.
>> IA, CAS