Problem with cross compiling Gold linker

Lei Wang lei.wang.left@gmail.com
Fri Nov 21 09:18:00 GMT 2014


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.

Lei
IA, CAS


More information about the Binutils mailing list