[Bug jit/64810] jit not working on armv7hl ("ld: error: /tmp/libgccjit-ZGemdr/fake.so uses VFP register arguments, /tmp/ccJFCBsE.o does not")
ramana.radhakrishnan at arm dot com
gcc-bugzilla@gcc.gnu.org
Thu Jan 29 09:20:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64810
--- Comment #18 from ramana.radhakrishnan at arm dot com <ramana.radhakrishnan at arm dot com> ---
On 28/01/15 17:58, dmalcolm at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64810
>
> --- Comment #9 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
> Thanks Ramana.
>
> I attempted a build of the jit with the configuration you suggested,
> specifically:
>
> $ ../src/configure \
> --enable-host-shared \
> --enable-languages=jit,c++ \
> --disable-bootstrap \
> --enable-checking=release \
> --prefix=/home/dmalcolm/gcc-git-jit/install-jit \
> --with-arch=armv7-a \
> --with-float=hard \
> --with-fpu=vfpv3-d16
>
> Unfortunately, I see the same failures.
>
> Hacking in a "-v" into the driver invocation in jit-playback.c...
>
> diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
> index d2549a0..5f570a7 100644
> --- a/gcc/jit/jit-playback.c
> +++ b/gcc/jit/jit-playback.c
> @@ -2271,6 +2271,8 @@ invoke_driver (const char *ctxt_progname,
> time. */
> ADD_ARG ("-fno-use-linker-plugin");
>
> + ADD_ARG ("-v");
> +
> /* pex argv arrays are NULL-terminated. */
> ADD_ARG (NULL);
>
> ...I see that libgccjit attempts to invoke the driver to convert the .s
> to a .so, but it fails like so:
>
> Target: armv7l-unknown-linux-gnueabihf
> Configured with: ../src/configure --enable-host-shared
> --enable-languages=jit,c++ --disable-bootstrap --enable-checking=release
> --prefix=/home/dmalcolm/gcc-git-jit/install-jit --with-arch=armv7-a
> --with-float=hard --with-fpu=vfpv3-d16
> Thread model: posix
> gcc version 5.0.0 20150126 (experimental) (GCC)
> COLLECT_GCC_OPTIONS='-shared' '-o' '/tmp/libgccjit-VxeXM1/fake.so'
> '-fno-use-linker-plugin' '-v' '-march=armv7-a' '-mfloat-abi=hard'
> '-mfpu=vfpv3-d16' '-mtls-dialect=gnu'
> as -v -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -meabi=5 -o
> /tmp/ccCY7c5L.o /tmp/libgccjit-VxeXM1/fake.s
> GNU assembler version 2.24 (armv7hl-redhat-linux-gnueabi) using BFD version
> version 2.24
> COMPILER_PATH=
> LIBRARY_PATH=/home/dmalcolm/gcc-git-jit/build-jit-comment8/gcc/:/lib/:/usr/lib/
> COLLECT_GCC_OPTIONS='-shared' '-o' '/tmp/libgccjit-VxeXM1/fake.so'
> '-fno-use-linker-plugin' '-v' '-march=armv7-a' '-mfloat-abi=hard'
> '-mfpu=vfpv3-d16' '-mtls-dialect=gnu'
> ld --eh-frame-hdr -shared -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m
> armelf_linux_eabi -o /tmp/libgccjit-VxeXM1/fake.so /lib/crti.o
> /home/dmalcolm/gcc-git-jit/build-jit-comment8/gcc/crtbeginS.o
> -L/home/dmalcolm/gcc-git-jit/build-jit-comment8/gcc /tmp/ccCY7c5L.o -lgcc
> --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
> /home/dmalcolm/gcc-git-jit/build-jit-comment8/gcc/crtendS.o /lib/crtn.o
> ld: error: /tmp/libgccjit-VxeXM1/fake.so uses VFP register arguments,
> /tmp/ccCY7c5L.o does not
> ld: failed to merge target specific data of file /tmp/ccCY7c5L.o
>
> That said, with the "test-empty.c" testcase, the generated
> "fake.s" looks like this:
>
> .cpu arm10tdmi
> .fpu softvfp
> .eabi_attribute 20, 1
> .eabi_attribute 21, 1
> .eabi_attribute 23, 3
> .eabi_attribute 24, 1
> .eabi_attribute 25, 1
> .eabi_attribute 26, 2
> .eabi_attribute 30, 2
> .eabi_attribute 34, 0
> .arm
> .syntax divided
> .file "fake.c"
> .text
> .Ltext0:
> .cfi_sections .debug_frame
> .Letext0:
> .section .debug_line,"",%progbits
> .Ldebug_line0:
> .section .debug_str,"MS",%progbits,1
> .LASF0:
> .ascii "/tmp/libgccjit-La3Yzk/fake.c\000"
> .LASF1:
> .ascii "libgccjit 5.0.0 20150126 (experimental) -fPIC -O3 -"
> .ascii "g --param ggc-min-expand=0 --param ggc-min-heapsize"
> .ascii "=0\000"
> .ident "GCC: (GNU) 5.0.0 20150126 (experimental)"
> .section .note.GNU-stack,"",%progbits
>
> In particular, I'm guessing that the line:
> .fpu softvfp
> is at fault here.
>
> This appears to come from arm.c:arm_file_start:
> 25689 if (TARGET_SOFT_FLOAT)
> 25690 {
> 25691 fpu_name = "softvfp";
> 25692 }
> 25693 else
> and on debugging:
> (gdb) p global_options.x_arm_float_abi
> $1 = ARM_FLOAT_ABI_SOFT
>
> Is this value bogus, given the configure-time options?
Sorry about the slow response, I was unable to check email last evening.
Yes this value is bogus as are the other .cpu values - the assembler
output suggests to me that the configure time options aren't being
passed at all from the driver down when used as a jit. Given the
configure options I would expect
.arch armv7-a
.fpu vfpv3-d16
and an EABI attribute tag to indicate the PCS.
I think you've worked this out reading down-thread.
Ramana
>
> (if so, I'm guessing this is a jit-specific state-management issue)
>
More information about the Gcc-bugs
mailing list