Discussion:
Error when building binutils
Benson Muite
2018-09-22 17:05:47 UTC
Permalink
Hi,

Am trying to build binutils on cent os 7. My configuration command is:

../binutils-gdb/configure
--with-isl=$HOME/ProfilingTests2/isl-0.20-install/
--target=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--build=x86_64-pc-linux-gnu
--with-gmp=$HOME/ProfilingTests2/gmp-6.1.2-install/
--with-mpc=$HOME/ProfilingTests2/mpc-1.1.0-install/
--with-mpfr=$HOME/ProfilingTests2/mpfr-4.0.1-install/
--prefix=$HOME/ProfilingTests2/binutils-2.31-install/
--build=x86_64-pc-linux-gnu
--with-zlib=$HOME/ProfilingTests2/zlib-1.2.11-install/ --disable-werror
--disable-nls --enable-gold --enable-ld

The build fails with the following output:

../../binutils-gdb/gas/as.c:99:31: error:
‘DEFAULT_GENERATE_ELF_STT_COMMON’ undeclared here (not in a function);
did you mean ‘BFD_USE_ELF_STT_COMMON’?
 int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON;
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                               BFD_USE_ELF_STT_COMMON
../../binutils-gdb/gas/as.c:100:41: error:
‘DEFAULT_GENERATE_BUILD_NOTES’ undeclared here (not in a function); did
you mean ‘SHF_GNU_BUILD_NOTE’?
 bfd_boolean flag_generate_build_notes = DEFAULT_GENERATE_BUILD_NOTES;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                         SHF_GNU_BUILD_NOTE
../../binutils-gdb/gas/as.c: In function ‘print_version_id’:
../../binutils-gdb/gas/as.c:226:14: error: ‘TARGET_ALIAS’ undeclared
(first use in this function); did you mean ‘TARGET_ARCH’?
     VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
              ^~~~~~~~~~~~
              TARGET_ARCH
../../binutils-gdb/gas/as.c:226:14: note: each undeclared identifier is
reported only once for each function it appears in
../../binutils-gdb/gas/as.c: In function ‘parse_args’:
../../binutils-gdb/gas/as.c:689:5: error: ‘TARGET_ALIAS’ undeclared
(first use in this function); did you mean ‘TARGET_ARCH’?
     TARGET_ALIAS);
     ^~~~~~~~~~~~
     TARGET_ARCH
../../binutils-gdb/gas/as.c:704:44: error: ‘TARGET_CANONICAL’ undeclared
(first use in this function); did you mean ‘TARGET_ARCH’?
    fprintf (stderr, _("canonical = %s\n"), TARGET_CANONICAL);
                                            ^~~~~~~~~~~~~~~~
                                            TARGET_ARCH
../../binutils-gdb/gas/as.c:705:43: error: ‘TARGET_CPU’ undeclared
(first use in this function); did you mean ‘TARGET_ARCH’?
    fprintf (stderr, _("cpu-type = %s\n"), TARGET_CPU);
                                           ^~~~~~~~~~
                                           TARGET_ARCH
make[4]: *** [as.o] Error 1


Are there any suggestions for how to get the build to work?

Thanks,
Benson
H.J. Lu
2018-09-22 17:46:36 UTC
Permalink
Hi,
Which version of binutils? I have no problems with master nor 2.31 branch
on CentOS 7.
--
H.J.
Benson Muite
2018-09-23 07:37:25 UTC
Permalink
Post by H.J. Lu
Hi,
Which version of binutils? I have no problems with master nor 2.31 branch
on CentOS 7.
Thanks for the confirmation. Both 2.31 and master fail when building own
gmp, mpc, mpfr, isl, zlib, flex,  bison and texinfo using gcc 5.2.0:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/storage/software/gcc-5.2.0/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/storage/software/gcc-5.2.0
Thread model: posix
gcc version 5.2.0 (GCC)

The default compiler on the computer is gcc 4.8-5:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
--enable-plugin --enable-initfini-array --disable-libgcj
--with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

With gcc 4.8.5, binutils-2.24, binutils-2.26, binutils-2.28,
binutils-2.30, binutils-2.31 and master build. binutils-2.30,
binutils-2.31 and master require texinfo. Probably some linking issue
when using gcc 5.2.0
H.J. Lu
2018-09-23 14:12:23 UTC
Permalink
Post by Benson Muite
Post by H.J. Lu
Hi,
Which version of binutils? I have no problems with master nor 2.31 branch
on CentOS 7.
Thanks for the confirmation. Both 2.31 and master fail when building own
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have no problem building binutils master branch with GCC 5.5.0 on CentOS 7.
Please check your config.h in the gas build directory. I have.

/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON
type by default. */
#define DEFAULT_GENERATE_ELF_STT_COMMON 0
--
H.J.
Continue reading on narkive:
Search results for 'Error when building binutils' (Questions and Answers)
3
replies
Can you help me with installation in linux ?
started 2010-03-06 13:13:16 UTC
software
Loading...