Build failure with `-Dc_std=c11`
When configuring the project with -Dc_std=cXX
(89, 99, 11), the compilation fails due to an incorrectly detected PCREL check:
$ meson setup -Dc_std=c11 build
...
$ meson compile -C build
[1/10] Compiling C object src/libffi.so.7.1.0.p/x86_unix64.S.o
FAILED: src/libffi.so.7.1.0.p/x86_unix64.S.o
cc -Isrc/libffi.so.7.1.0.p -Isrc -I../src -I. -I.. -Iinclude -I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O2 -g -DFFI_BUILDING -fPIC -DTARGET=X86_64 -MD -MQ src/libffi.so.7.1.0.p/x86_unix64.S.o -MF src/libffi.so.7.1.0.p/x86_unix64.S.o.d -o src/libffi.so.7.1.0.p/x86_unix64.S.o -c ../src/x86/unix64.S
../src/x86/unix64.S: Assembler messages:
../src/x86/unix64.S:451: Error: junk at end of line, first unrecognized character is `@'
The problematic check:
Command line: cc /tmpg5c31nq9/testfile.c -o /tmpg5c31nq9/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -std=c11
Code:
asm (".text; foo: nop; .data; .long foo-.; .text");
Compiler stdout:
Compiler stderr:
/tmpg5c31nq9/testfile.c:1:6: error: expected declaration specifiers or '...' before string constant
1 | asm (".text; foo: nop; .data; .long foo-.; .text");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Checking if "ASM x86 PCREL" : compiles: NO
Workaround:
Using -Dc_std=gnuXX
.