public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/101843] New: Build of binutils-2.37 with gcc-11.2.0 fails due to change to libiberty/hashtab.c
@ 2021-08-10 10:59 mailboxnotfound at yahoo dot com
  2021-08-10 12:06 ` [Bug bootstrap/101843] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mailboxnotfound at yahoo dot com @ 2021-08-10 10:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101843

            Bug ID: 101843
           Summary: Build of binutils-2.37 with gcc-11.2.0 fails due to
                    change to libiberty/hashtab.c
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mailboxnotfound at yahoo dot com
  Target Milestone: ---

SUMMARY

   Building binutils along with GCC is a documented method,
   but it fails for gcc-11.2.0 with binutils-2.37 because 
      libiberty/hashtab.c
   differs between gcc-11.2.0 and binutils-2.37

   I have heard that hashtab.c has been updated in GCC master,
   presumably fixing this problem (I have not verified this assertion).

   It would be useful to include a fix in at least GCC 11, 
   and perhaps for other still-supported GCC version.


DETAIL

According to 
   https://gcc.gnu.org/install/download.html 
it is acceptable to build binutils at the same time that one builds GCC.   

However, if one does so by this method:

    cd gcc-11.2.0
    for dir in ../binutils-2.37/*
         if dir does not exist in this gcc tree
               ln -s $dir

then the following directories that already exist in the GCC tree are NOT
replaced by directories from the binutils-2.37 tree

   config/   include/  intl/  libiberty/  zlib/

leading to this failure [white space adjusted] (*)

     libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes
         -Wshadow -I/data1/gcc/build/gcc-11.2.0/binutils/../zlib -g
         -o strip-new objcopy.o is-strip.o rename.o rddbg.o debug.o
         stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o  
         ../bfd/.libs/libbfd.a
-L/data1/gcc/build/Linux-x86_64-gcc-build-11.2.0/zlib
         -lz ../libiberty/libiberty.a -ldl

    objcopy.o: In function `create_symbol_htab':
    /data1/gcc/build/gcc-11.2.0/binutils/objcopy.c:1031: undefined reference to
'htab_eq_string'

The missing symbol, htab_eq_string, is defined in 
../binutils-2.37/libiberty/hashtab.c and ../binutils-2.37/include/hashtab.h

(*) There may be other failures; I did not attempt to do anything resembling 
    make --keep-going


WORKAROUND

    Building gcc-11.2.0 with binutils-2.36 works.


NOT A WORKAROUND 

   Note that this fails:

   $ cd gcc-11.2.0/libiberty/
   $ mv hashtab.c hashtab.c.orig; cp -p ../../binutils-2.37/libiberty/hashtab.c
.
   $ cd ../include
   $ mv hashtab.h hashtab.h.orig; cp -p ../../binutils-2.37/include/hashtab.h .

   The above fails for module gensupport:

   gcc-11.2.0/gcc/gensupport.c:2328:47: error: int htab_eq_string(const void*,
const void*) was declared 'extern' and later 'static'


RECOMMENDATION

   Given that the documentation says that building binutils in your GCC tree
should work, 
   and given the existence of user habits (various google tracks for this
method), 
   it would be useful if at least GCC 11 (and maybe the other still-supported
GCC versions) 
   were fixed such that in-tree builds of binutils-2.37 would work.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-11 21:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 10:59 [Bug other/101843] New: Build of binutils-2.37 with gcc-11.2.0 fails due to change to libiberty/hashtab.c mailboxnotfound at yahoo dot com
2021-08-10 12:06 ` [Bug bootstrap/101843] " rguenth at gcc dot gnu.org
2021-08-10 13:46 ` mailboxnotfound at yahoo dot com
2021-08-10 14:52 ` schwab@linux-m68k.org
2021-08-10 15:35 ` pinskia at gcc dot gnu.org
2021-08-10 16:05 ` mailboxnotfound at yahoo dot com
2021-08-11 21:57 ` mailboxnotfound at yahoo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).