Can gold be compiled with gcc 3.4?

View: New views
2 Messages — Rating Filter:   Alert me  

Can gold be compiled with gcc 3.4?

by H.J. Lu-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can gold be compiled with gcc 3.4?  I got

/net/gnu-6/export/gnu/import/git/binutils/gold/dwarf_reader.cc: In
function `int64_t gold::read_signed_LEB_128(const unsigned char*,
size_t*)':
/net/gnu-6/export/gnu/import/git/binutils/gold/dwarf_reader.cc:78:
warning: 'byte' might be used uninitialized in this function

with gcc 3.4.  After applying this patch, one gold test doesn't finish
after several minutes:

17950 pts/0    S      0:00 g++ -W -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFS
17951 pts/0    S      0:00 /usr/libexec/gcc/x86_64-redhat-linux/3.4.6/collect2 -
17953 pts/0    R      7:19 gcctestdir1/ld --eh-frame-hdr -m elf_x86_64 -dynamic-


Thanks.


H.J.
---
2009-11-03  H.J. Lu  <hongjiu.lu@...>

        * dwarf_reader.cc (read_signed_LEB_128): Silence gcc 3.4.

diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc
index d142586..9594cc7 100644
--- a/gold/dwarf_reader.cc
+++ b/gold/dwarf_reader.cc
@@ -75,7 +75,7 @@ read_signed_LEB_128(const unsigned char* buffer, size_t* len)
   int64_t result = 0;
   int shift = 0;
   size_t num_read = 0;
-  unsigned char byte;
+  unsigned char byte = 0;
 
   do
     {

Re: Can gold be compiled with gcc 3.4?

by Ian Lance Taylor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"H.J. Lu" <hongjiu.lu@...> writes:

> Can gold be compiled with gcc 3.4?

No.  From the README:

    The gold source code uses templates heavily.  Building it requires a
    recent version of g++.  g++ 4.0.3 is known to work.  g++ 3.2 and g++
    3.4.3 are known to fail.

Ian