https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64810

--- Comment #6 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
I tried to configure the jit with just:
  --enable-host-shared --enable-languages=jit,c++ --disable-bootstrap
--enable-checking=release

but I ran into this error compiling libgcc:
  /usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or
directory

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62099#c5
said:
     "You need to use -with-float=hard when configuring GCC."
hence I added --with-float=hard to the above when configuring.

Was this correct?

Doing so enabled the build to complete, and I was able to run "make check-jit",
which showed the symptoms seen in comment #0.

Specifically, if I hack up gcc/testsuite/jit.dg/harness.h to add:
  gcc_jit_context_set_bool_option (
    ctxt,
    GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES,
    1);
and run e.g.
  make check-jit RUNTESTFLAGS="jit.exp=test-hello-world.c"
then gcc/testsuite/jit/test-hello-world.c.exe.log.txt shows that toplev is
invoked thusly:
JIT:    entering: toplev::main
JIT:     argv[0]: ./test-hello-world.c.exe
JIT:     argv[1]: /tmp/libgccjit-KmhzbL/fake.c
JIT:     argv[2]: -fPIC
JIT:     argv[3]: -O3
JIT:     argv[4]: -g
JIT:     argv[5]: -quiet
JIT:     argv[6]: --param
JIT:     argv[7]: ggc-min-expand=0
JIT:     argv[8]: --param
JIT:     argv[9]: ggc-min-heapsize=0

and then the driver is invoked thus on the resulting .s file:
JIT:      entering: void gcc::jit::playback::context::invoke_driver(const
char*, const char*, const char*, timevar_id_t, bool, bool)
JIT:       argv[0]: armv7l-unknown-linux-gnueabihf-gcc-5.0.0
JIT:       argv[1]: -shared
JIT:       argv[2]: /tmp/libgccjit-KmhzbL/fake.s
JIT:       argv[3]: -o
JIT:       argv[4]: /tmp/libgccjit-KmhzbL/fake.so
JIT:       argv[5]: -fno-use-linker-plugin
JIT:       argv[6]: (null)

(and the intermediates stay around due to the bool option above).

Invoking the driver by hand with those args replicates the issue:

$ LIBRARY_PATH=. ./armv7l-unknown-linux-gnueabihf-gcc-5.0.0 -shared
/tmp/libgccjit-KmhzbL/fake.s -o /tmp/libgccjit-KmhzbL/fake.so
-fno-use-linker-plugin
ld: error: /tmp/libgccjit-KmhzbL/fake.so uses VFP register arguments,
/tmp/ccCFmkbn.o does not
ld: failed to merge target specific data of file /tmp/ccCFmkbn.o

Invoking the driver with "-v" shows the commands it's running:
  as -v -mfloat-abi=hard -meabi=5 -o /tmp/ccBPOxW0.o
/tmp/libgccjit-KmhzbL/fake.s
GNU assembler version 2.24 (armv7hl-redhat-linux-gnueabi) using BFD version
version 2.24

  ld --eh-frame-hdr -shared -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m
armelf_linux_eabi -o /tmp/libgccjit-KmhzbL/fake.so /lib/crti.o ./crtbeginS.o
-L. /tmp/ccBPOxW0.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
--as-needed -lgcc_s --no-as-needed ./crtendS.o /lib/crtn.o

/usr/bin/ld: error: /tmp/libgccjit-KmhzbL/fake.so uses VFP register arguments,
/tmp/ccT3rLos.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/ccT3rLos.o

FWIW, eu-readelf on the .o file shows:

Object attributes section [16] '.ARM.attributes' of 47 bytes at offset 0x35b:
  Owner          Size
  aeabi            46
    File:          36
      CPU_name: ARM10TDMI
      CPU_arch: v5T
      ARM_ISA_use: Yes
      THUMB_ISA_use: Thumb-1
      ABI_FP_denormal: Needed
      ABI_FP_exceptions: Needed
      ABI_FP_number_model: IEEE 754
      ABI_align8_needed: Yes
      ABI_align8_preserved: Yes, except leaf SP
      ABI_enum_size: int
      ABI_optimization_goals: Aggressive Speed

Reply via email to