public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug jit/64810] jit not working on armv7hl ("ld: error: /tmp/libgccjit-ZGemdr/fake.so uses VFP register arguments, /tmp/ccJFCBsE.o does not")
Date: Tue, 27 Jan 2015 19:40:00 -0000	[thread overview]
Message-ID: <bug-64810-4-wCjHJM6k2H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64810-4@http.gcc.gnu.org/bugzilla/>

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


  parent reply	other threads:[~2015-01-27 19:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-64810-4@http.gcc.gnu.org/bugzilla/>
2015-01-27 12:13 ` ramana at gcc dot gnu.org
2015-01-27 12:27 ` jakub at gcc dot gnu.org
2015-01-27 14:28 ` dmalcolm at gcc dot gnu.org
2015-01-27 15:47 ` ramana.radhakrishnan at arm dot com
2015-01-27 18:48 ` dmalcolm at gcc dot gnu.org
2015-01-27 19:40 ` dmalcolm at gcc dot gnu.org [this message]
2015-01-27 20:00 ` dmalcolm at gcc dot gnu.org
2015-01-28  9:36 ` ramana.radhakrishnan at arm dot com
2015-01-28 17:59 ` dmalcolm at gcc dot gnu.org
2015-01-28 18:21 ` dmalcolm at gcc dot gnu.org
2015-01-28 20:59 ` dmalcolm at gcc dot gnu.org
2015-01-28 21:30 ` dmalcolm at gcc dot gnu.org
2015-01-28 21:36 ` dmalcolm at gcc dot gnu.org
2015-01-28 21:41 ` jakub at gcc dot gnu.org
2015-01-28 22:07 ` dmalcolm at gcc dot gnu.org
2015-01-28 22:10 ` dmalcolm at gcc dot gnu.org
2015-01-29  2:56 ` dmalcolm at gcc dot gnu.org
2015-01-29  9:20 ` ramana.radhakrishnan at arm dot com
2015-01-29 15:56 ` dmalcolm at gcc dot gnu.org
2015-01-30 11:03 ` dmalcolm at gcc dot gnu.org
2015-01-30 18:23 ` dmalcolm at gcc dot gnu.org
2015-02-02 15:21 ` dmalcolm at gcc dot gnu.org
2015-02-02 16:11 ` dmalcolm at gcc dot gnu.org
2015-02-03 17:20 ` dmalcolm at gcc dot gnu.org
2015-03-13  9:09 ` ramana at gcc dot gnu.org
2015-03-13 14:17 ` dmalcolm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64810-4-wCjHJM6k2H@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).