Message ID | 568E6F8C.10006@redhat.com |
---|---|
State | New |
Headers | show |
> Le 7 janv. 2016 à 15:00, Nick Clifton <nickc@redhat.com> a écrit : > > Hi Dominique, > > On 07/01/16 13:42, Dominique d'Humières wrote: >>> +/* { dg-lto-options { { -flto -O2 -Werror -Wl,--defsym,__fread_chk=0x1234 } } } */ >> >> This won’t work on darwin: >> >> ld: unknown option: --defsym >> collect2: error: ld returned 1 exit status > > Oh bananas. > > Does the pr61886 test work on Darwin without any changes ? If it fails then is there a Darwin linker command line option to define a symbol ? No: Executing on host: /opt/gcc/build_w/gcc/xgcc -B/opt/gcc/build_w/gcc/ c_lto_pr61886_0.o -m64 -fno-diagnostics-show-caret -fdiagnostics-color=never -flto -O2 -Werror -o gcc-dg-lto-pr61886-01.exe (timeout = 300) spawn -ignore SIGHUP /opt/gcc/build_w/gcc/xgcc -B/opt/gcc/build_w/gcc/ c_lto_pr61886_0.o -m64 -fno-diagnostics-show-caret -fdiagnostics-color=never -flto -O2 -Werror -o gcc-dg-lto-pr61886-01.exe Undefined symbols for architecture x86_64: "__fread_chk", referenced from: _main in c_lto_pr61886_0.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status compiler exited with status 1 Dominique > This revised version of the patch works for me, but I do not have a Darwin native system on which I can test it. Would you be able to try it out for me ? > > Cheers > Nick > > > Index: gcc/testsuite/gcc.dg/lto/pr61886_0.c > =================================================================== > --- gcc/testsuite/gcc.dg/lto/pr61886_0.c (revision 232123) > +++ gcc/testsuite/gcc.dg/lto/pr61886_0.c (working copy) > @@ -1,5 +1,6 @@ > /* { dg-lto-do link } */ > /* { dg-lto-options { { -flto -O2 -Werror } } } */ > +/* { dg-extra-ld-options "-Wl,--defsym,__fread_chk=0x1234" { target { ! { *-*-darwin* } } } } */ > > typedef __SIZE_TYPE__ size_t; > typedef struct _IO_FILE FILE;
Index: gcc/testsuite/gcc.dg/lto/pr61886_0.c =================================================================== --- gcc/testsuite/gcc.dg/lto/pr61886_0.c (revision 232123) +++ gcc/testsuite/gcc.dg/lto/pr61886_0.c (working copy) @@ -1,5 +1,6 @@ /* { dg-lto-do link } */ /* { dg-lto-options { { -flto -O2 -Werror } } } */ +/* { dg-extra-ld-options "-Wl,--defsym,__fread_chk=0x1234" { target { ! { *-*-darwin* } } } } */ typedef __SIZE_TYPE__ size_t;