https://sourceware.org/bugzilla/show_bug.cgi?id=29961
Bug ID: 29961 Summary: /include/plugin-api.h:162:2: error: #error "Could not detect architecture endianess" Product: binutils Version: 2.39 Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: dclarke at blastwave dot org Target Milestone: --- Firstly this may not be a bug at all. the real issue may be that I have a very old machine which is an architecture that no one seems to support anymore. However I feel it can not hurt to at least file this and then receive "sorry, we don't work in the Smithsonian." :) So the machine is, yes, really : n$ n$ uname -a SunOS nix 5.8 Generic_117350-62 sun4m sparc SUNW,SPARCstation-20 n$ n$ psrinfo -v Status of virtual processor 0 as of: 01/04/23 09:39:23 on-line since 07/16/22 09:39:20. The sparc processor operates at 60 MHz, and has a sparc floating point processor. Status of virtual processor 2 as of: 01/04/23 09:39:23 on-line since 12/19/22 13:48:51. The sparc processor operates at 60 MHz, and has a sparc floating point processor. n$ n$ gcc --version gcc (Blastwave.org Inc. Mon Aug 9 07:10:45 GMT 2010) 4.5.1 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. n$ These units make lovely room heaters and you would be surprised that they still run just fine. In any case there is plenty of GNU type open software packages that build and test fine. I simply felt that a more recent GNU as would be of value. I know that the Sun linker ld is what I should stay with but the GNU as is far better at many things. Enough said there. I have tried both binutils-2.23.2 as well as binutils-2.39 where both of these report a similar condition, however the 2.39 merely marches onwards and then dies soon afterwards. This is the 2.23.2 fail : . . . libtool: compile: /opt/csw/gcc4/bin/gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.23.2/bfd -I. -I../../binutils-2.23.2/bfd -I../../binutils-2.23.2/bfd/../include -DHAVE_bfd_elf32_sparc_sol2_vec -DHAVE_bfd_elf64_sparc_sol2_vec -DHAVE_sunos_big_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -DBINDIR=\"/opt/bw/bin\" -I/opt/bw/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -m32 -g -O0 -fno-builtin -mno-app-regs -mhard-float -mno-faster-structs -mstd-struct-return -mcpu=v8 -mno-v8plus -mno-vis -MT bfd.lo -MD -MP -MF .deps/bfd.Tpo -c ../../binutils-2.23.2/bfd/bfd.c -o bfd.o cc1: warnings being treated as errors ../../binutils-2.23.2/bfd/bfd.c: In function ‘_bfd_abort’: ../../binutils-2.23.2/bfd/bfd.c:1047:1: error: ‘noreturn’ function does return gmake[4]: *** [Makefile:1575: bfd.lo] Error 1 gmake[4]: Leaving directory '/opt/bw/build/binutils-2.23.2_SunOS5.8_sun4m.003/bfd' gmake[3]: *** [Makefile:1617: all-recursive] Error 1 gmake[3]: Leaving directory '/opt/bw/build/binutils-2.23.2_SunOS5.8_sun4m.003/bfd' gmake[2]: *** [Makefile:1108: all] Error 2 gmake[2]: Leaving directory '/opt/bw/build/binutils-2.23.2_SunOS5.8_sun4m.003/bfd' gmake[1]: *** [Makefile:2505: all-bfd] Error 2 gmake[1]: Leaving directory '/opt/bw/build/binutils-2.23.2_SunOS5.8_sun4m.003' gmake: *** [Makefile:838: all] Error 2 So let's not bother with that old version. Moving onwards to the very recent 2.39 where I also see this as a warning : gmake[4]: Entering directory '/opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001/bfd' rm -f bfd-tmp.h cp bfd-in3.h bfd-tmp.h /export/home/dclarke/bin/bash ../../binutils-2.39/bfd/../move-if-change bfd-tmp.h bfd.h rm -f bfd-tmp.h touch stmp-bfd-h CC archive.lo CC archures.lo CC bfd.lo ../../binutils-2.39/bfd/bfd.c: In function ‘_bfd_abort’: ../../binutils-2.39/bfd/bfd.c:1671:1: warning: ‘noreturn’ function does return CC bfdio.lo CC bfdwin.lo CC cache.lo . . . . Then we get a kaboom fail at : CC elflink.lo In file included from ../../binutils-2.39/bfd/elflink.c:31:0: ../../binutils-2.39/bfd/../include/plugin-api.h:162:2: error: #error "Could not detect architecture endianess" gmake[4]: *** [Makefile:1752: elflink.lo] Error 1 gmake[4]: Leaving directory '/opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001/bfd' gmake[3]: *** [Makefile:1932: all-recursive] Error 1 gmake[3]: Leaving directory '/opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001/bfd' gmake[2]: *** [Makefile:1321: all] Error 2 gmake[2]: Leaving directory '/opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001/bfd' gmake[1]: *** [Makefile:3056: all-bfd] Error 2 gmake[1]: Leaving directory '/opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001' gmake: *** [Makefile:1003: all] Error 2 That is a surprise to me. Looking into include/plugin-api.h we see : struct ld_plugin_symbol { char *name; char *version; /* This is for compatibility with older ABIs. The older ABI defined only 'def' field. */ #if PLUGIN_BIG_ENDIAN == 1 char unused; char section_kind; char symbol_type; char def; #elif PLUGIN_LITTLE_ENDIAN == 1 char def; char symbol_type; char section_kind; char unused; #elif PLUGIN_PDP_ENDIAN == 1 char symbol_type; char def; char unused; char section_kind; #else #error "Could not detect architecture endianess" #endif int visibility; uint64_t size; char *comdat_key; int resolution; }; I am guessing that PLUGIN_BIG_ENDIAN simply did not get set somewhere? As I say, this may all be a waster of time but for the sake of my fun little Canadian "Sun" room heater here is the environment and the output from configure : n$ env | sort CC=/opt/csw/gcc4/bin/gcc CFLAGS=-m32 -g -O0 -fno-builtin -mno-app-regs -mhard-float -mno-faster-structs -mstd-struct-return -mcpu=v8 -mno-v8plus -mno-vis COLUMNS=92 CONFIG_SHELL=/export/home/dclarke/bin/bash CPPFLAGS=-I/opt/bw/include CXXFLAGS=-m32 -g -O0 -fno-builtin -mno-app-regs -mhard-float -mno-faster-structs -mstd-struct-return -mcpu=v8 -mno-v8plus -mno-vis CXX=/opt/csw/gcc4/bin/c++ DISPLAY=sedna.genunix.com:0 _DVFS_RECONFIG=YES EDITOR=/usr/xpg4/bin/vi GNAT=/opt/csw/gcc4/bin/gnat HISTFILE=/export/home/dclarke/.sh_history HISTSIZE=1024 HOME=/export/home/dclarke HZ=100 _INIT_NET_STRATEGY=none _INIT_PREV_LEVEL=S _INIT_RUN_LEVEL=3 _INIT_RUN_NPREV=0 _INIT_UTS_ISA=sparc _INIT_UTS_MACHINE=sun4m _INIT_UTS_NODENAME=nix _INIT_UTS_PLATFORM=SUNW,SPARCstation-20 _INIT_UTS_RELEASE=5.8 _INIT_UTS_SYSNAME=SunOS _INIT_UTS_VERSION=Generic_117350-62 LANG=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LD_OPTIONS=-R/opt/bw/lib -R/opt/imed/gcc4/lib -L/opt/bw/lib -L/opt/imed/gcc4/lib LD=/usr/ccs/bin/ld LINES=14 LOGNAME=dclarke M4=/opt/bw/bin/m4 MAIL=/var/mail/dclarke MAKE=/opt/bw/bin/gmake MANPATH=/opt/bw/share/man:/usr/share/man:/usr/X11/share/man NICE=/usr/xpg4/bin/nice NM=/usr/ccs/bin/nm -p OLDPWD=/opt/bw/build PAGER=/usr/xpg4/bin/more PATCH=/opt/bw/bin/gpatch PATH=/opt/bw/bin:/opt/bw/sbin:/usr/xpg4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/openwin/bin:/opt/csw/gcc4/bin:/opt/schily/bin PERL=/opt/bw/bin/perl PWD=/opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001 SHELL=/export/home/dclarke/bin/bash SHLVL=1 SRC=/opt/bw/src TERM=vt100 TIME=/usr/bin/time TMPDIR=/var/tmp/dclarke TZ=GMT0 _=/usr/xpg4/bin/env VISUAL=/usr/xpg4/bin/vi XTERM_LOCALE=en_US.UTF-8 n$ Note that there is nothing at /opt/imed because that is the destination for a GCC bootstrap that I want to try. After binutils builds me a new and shiney GNU as. Configure looks like : n$ date -u ; pwd Wed Jan 4 01:36:49 GMT 2023 /opt/bw/build/binutils-2.39_SunOS5.8_sun4m.001 n$ ../binutils-2.39/configure \ > --build=sparc-sun-solaris2.8 \ > --target=sparc-sun-solaris2.8 \ > --host=sparc-sun-solaris2.8 \ > --prefix=/opt/bw --program-prefix=g \ > --with-mpc=/opt/bw --with-mpfr=/opt/bw --with-gmp=/opt/bw \ > --with-build-time-tools=/opt/bw/bin checking build system type... sparc-sun-solaris2.8 checking host system type... sparc-sun-solaris2.8 checking target system type... sparc-sun-solaris2.8 checking for a BSD-compatible install... ../binutils-2.39/install-sh -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /usr/xpg4/bin/sed checking for gawk... no checking for mawk... no checking for nawk... nawk checking for sparc-sun-solaris2.8-gcc... /opt/csw/gcc4/bin/gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /opt/csw/gcc4/bin/gcc accepts -g... yes checking for /opt/csw/gcc4/bin/gcc option to accept ISO C89... none needed checking for /opt/csw/gcc4/bin/gcc option to accept ISO C99... -std=gnu99 checking whether we are using the GNU C++ compiler... yes checking whether /opt/csw/gcc4/bin/c++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for sparc-sun-solaris2.8-gnatbind... no checking for gnatbind... gnatbind checking for sparc-sun-solaris2.8-gnatmake... no checking for gnatmake... gnatmake checking whether compiler driver understands Ada... yes checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs checking for isl 0.15 or later... no required isl version is 0.15 or later checking for default BUILD_CONFIG... checking for --enable-vtable-verify... no checking for bison... no checking for byacc... no checking for yacc... no checking for bison... no checking for gm4... /opt/bw/bin/m4 checking for flex... no checking for lex... no checking for flex... no checking for makeinfo... makeinfo checking for expect... no checking for runtest... no checking for sparc-sun-solaris2.8-ar... no checking for ar... ar checking for sparc-sun-solaris2.8-as... no checking for as... no checking for sparc-sun-solaris2.8-dlltool... no checking for dlltool... no checking for ld... (cached) /usr/ccs/bin/ld checking for sparc-sun-solaris2.8-ld... (cached) /usr/ccs/bin/ld checking for sparc-sun-solaris2.8-lipo... no checking for lipo... no checking for nm... (cached) /usr/ccs/bin/nm -p checking for sparc-sun-solaris2.8-nm... (cached) /usr/ccs/bin/nm -p checking for sparc-sun-solaris2.8-ranlib... no checking for ranlib... no checking for sparc-sun-solaris2.8-strip... no checking for strip... no checking for sparc-sun-solaris2.8-windres... no checking for windres... no checking for sparc-sun-solaris2.8-windmc... no checking for windmc... no checking for sparc-sun-solaris2.8-objcopy... no checking for objcopy... no checking for sparc-sun-solaris2.8-objdump... no checking for objdump... no checking for sparc-sun-solaris2.8-readelf... no checking for readelf... no checking for -plugin option... checking for sparc-sun-solaris2.8-ar... (cached) ar no checking for cc in /opt/bw/bin... no checking for gcc in /opt/bw/bin... no checking for sparc-sun-solaris2.8-cc... no checking for cc... no checking for sparc-sun-solaris2.8-gcc... sparc-sun-solaris2.8-gcc checking for c++ in /opt/bw/bin... no checking for g++ in /opt/bw/bin... no checking for cxx in /opt/bw/bin... no checking for gxx in /opt/bw/bin... no checking for sparc-sun-solaris2.8-c++... sparc-sun-solaris2.8-c++ checking for gcc in /opt/bw/bin... no checking for sparc-sun-solaris2.8-gcc... sparc-sun-solaris2.8-gcc checking for gfortran in /opt/bw/bin... no checking for sparc-sun-solaris2.8-gfortran... sparc-sun-solaris2.8-gfortran checking for gccgo in /opt/bw/bin... no checking for sparc-sun-solaris2.8-gccgo... no checking for gccgo... no checking for ar in /opt/bw/bin... no checking for ar in /opt/bw/bin... no checking for sparc-sun-solaris2.8-ar... no checking for ar... ar checking for as in /opt/bw/bin... no checking for as in /opt/bw/bin... no checking for sparc-sun-solaris2.8-as... no checking for as... no checking for dlltool in /opt/bw/bin... no checking for dlltool in /opt/bw/bin... no checking for sparc-sun-solaris2.8-dlltool... no checking for dlltool... no checking for ld in /opt/bw/bin... no checking for ld in /opt/bw/bin... no checking for sparc-sun-solaris2.8-ld... no checking for ld... no checking for lipo in /opt/bw/bin... no checking for lipo in /opt/bw/bin... no checking for sparc-sun-solaris2.8-lipo... no checking for lipo... no checking for nm in /opt/bw/bin... no checking for nm in /opt/bw/bin... no checking for sparc-sun-solaris2.8-nm... no checking for nm... nm checking for objcopy in /opt/bw/bin... no checking for objcopy in /opt/bw/bin... no checking for sparc-sun-solaris2.8-objcopy... no checking for objcopy... no checking for objdump in /opt/bw/bin... no checking for objdump in /opt/bw/bin... no checking for sparc-sun-solaris2.8-objdump... no checking for objdump... no checking for ranlib in /opt/bw/bin... no checking for ranlib in /opt/bw/bin... no checking for sparc-sun-solaris2.8-ranlib... no checking for ranlib... no checking for readelf in /opt/bw/bin... no checking for readelf in /opt/bw/bin... no checking for sparc-sun-solaris2.8-readelf... no checking for readelf... no checking for strip in /opt/bw/bin... no checking for strip in /opt/bw/bin... no checking for sparc-sun-solaris2.8-strip... no checking for strip... no checking for windres in /opt/bw/bin... no checking for windres in /opt/bw/bin... no checking for sparc-sun-solaris2.8-windres... no checking for windres... no checking for windmc in /opt/bw/bin... no checking for windmc in /opt/bw/bin... no checking for sparc-sun-solaris2.8-windmc... no checking for windmc... no checking where to find the target ar... just compiled checking where to find the target as... just compiled checking where to find the target cc... host tool checking where to find the target c++... host tool checking where to find the target c++ for libstdc++... host tool checking where to find the target dlltool... just compiled checking where to find the target gcc... host tool checking where to find the target gfortran... host tool checking where to find the target gccgo... host tool checking where to find the target ld... just compiled checking where to find the target lipo... host tool checking where to find the target nm... just compiled checking where to find the target objcopy... just compiled checking where to find the target objdump... just compiled checking where to find the target ranlib... just compiled checking where to find the target readelf... just compiled checking where to find the target strip... just compiled checking where to find the target windres... just compiled checking where to find the target windmc... just compiled checking whether to enable maintainer-specific portions of Makefiles... no configure: creating ./config.status config.status: creating Makefile n$ So there we have it. Sort of curious if I should git clone out trunk and then give it a whirl on the old machine. That will take a day. I have yet to build up to date autotools. However a pile of other good stuff "just works" and therefore binutils was a little holiday surprise. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional -- You are receiving this mail because: You are on the CC list for the bug.