[PATCH] Run gdb.compile/*.exp on {x86,x86_64,s390}-linux only

Pedro Alves palves@redhat.com
Tue Jan 16 17:20:00 GMT 2018


On 01/16/2018 04:59 PM, Pedro Alves wrote:
>> searching for compiler matching regex ^aarch64(-[^-]*)?-linux(-gnu)?-gcc$^M
>> found compiler /home/yaoqi01/fsf-trunk-build/build-native-aarch64-none-linux-gnu/install/sysroot/usr/bin/aarch64-none-linux-gnu-gcc^M
>> Passing 11 compiler options:^M
>> Compiler option 0: <>^M
>> Compiler option 1: <-std=gnu11>^M
>> Compiler option 2: <-fno-exceptions>^M
>> Compiler option 3: <-O0>^M
>> Compiler option 4: <-gdwarf-4>^M
>> Compiler option 5: <-fPIE>^M
>> Compiler option 6: <-Wall>^M
>> Compiler option 7: <-Wno-implicit-function-declaration>^M
>> Compiler option 8: <-Wno-unused-but-set-variable>^M
>> Compiler option 9: <-Wno-unused-variable>^M
>> Compiler option 10: <-fno-stack-protector>^M
>> source file produced: /tmp/gdbobj-6vzbkt/out3.c^M
>> ^M
>> aarch64-none-linux-gnu-gcc: error: : No such file or directory
> 
> It sounds like the empty argument passed as "Compiler option 0" is
> being interpreted by the compiler as a source file name?  And then
> the error message is including the file name that is not found, 
> but since the file name is the empty string, it reads a bit
> cryptic.
> 
> The fix is probably to not pass that option at all if empty.
> 

Yes, I could reproduce this by hacking default_gcc_target_options
to return "" like you were doing:

 Passing 15 compiler options:
 Compiler option 0: <>                 <<<<<< BAD
 Compiler option 1: <-mtune=generic>
 Compiler option 2: <-march=x86-64>
 ...

Making default_gcc_target_options return NULL instead works:

 Passing 14 compiler options:
 Compiler option 0: <-mtune=generic>
 Compiler option 1: <-march=x86-64>
 ...

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list