This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug lto/49992] lto-bootstrap reveals duplicate symbols on x86_64-apple-darwin11


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49992

--- Comment #30 from Iain Sandoe <iains at gcc dot gnu.org> 2011-08-09 18:57:36 UTC ---
so, if we have no regressions from omitting the "-c" we might conclude that
things have changed since then ;-)

===

simple testcase:

$ cat /Volumes/ScratchCS/tests/statlib.c 

int common_symbol;

int libfunc (int a)
{
  return a + common_symbol;
}

$ cat /Volumes/ScratchCS/tests/main-using-common-sym.c 

int common_symbol ;

int main (int ac, char *av[])
{
  int a;
  a = ac + 5;
  common_symbol = a - 6;
  return common_symbol;

}

===
$ uname -v
Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011;
root:xnu-1504.15.3~1/RELEASE_I386
$ ./gcc/xgcc --version
xgcc (GCC) 4.7.0 20110806 (experimental) [trunk revision 177536]

$ ./gcc/xgcc -Bgcc /Volumes/ScratchCS/tests/statlib.c -c 
$ ar -cru libstat.a statlib.o 
$ ranlib libstat.a 
$ ./gcc/xgcc -Bgcc /Volumes/ScratchCS/tests/main-using-common-sym.c -c
$ ./gcc/xgcc -Bgcc main-using-common-sym.o -o tt -Wl,-why_load
<no output>
$ ./gcc/xgcc -Bgcc main-using-common-sym.o libstat.a -o tt -Wl,-why_load
<no output>

$ ranlib -c libstat.a 
$ ./gcc/xgcc -Bgcc main-using-common-sym.o libstat.a -o tt -Wl,-why_load
_common_symbol forced load of libstat.a(statlib.o)

OK.. so there's your reduced testcase.

(on Darwin 9 there's no output in either case).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]