This is the mail archive of the gcc-patches@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]

Re: RFA: PR 68913: Provide weak version of __fread_chk for PR61886 test


> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]