public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/65778] New: v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf
@ 2015-04-15 21:28 prathamesh3492 at gcc dot gnu.org
  2015-04-15 23:35 ` [Bug lto/65778] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: prathamesh3492 at gcc dot gnu.org @ 2015-04-15 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65778
           Summary: v8 build fails with assembly error with LTO enabled on
                    arm-linux-gnueabihf
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: prathamesh3492 at gcc dot gnu.org

Hi,
Compiling v8 with LTO enabled on arm-linux-gnueabihf results in following
assembly error messages: 
LINK(target) /home/prathamesh.kulkarni/v8/out/arm.release/d8
d8.ltrans1.s: Assembler messages:
d8.ltrans1.s:58822: Error: offset out of range
d8.ltrans1.s:60616: Error: offset out of range
d8.ltrans1.s:60762: Error: offset out of range
lto-wrapper: fatal error:
/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu/bin/arm-linux-gnueabihf-g++
returned 1 exit status
compilation terminated.
/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu/lib/gcc/arm-linux-gnueabihf/5.0.0/../../../../arm-linux-gnueabihf/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [/home/prathamesh.kulkarni/v8/out/arm.release/d8] Error 1
make[1]: Leaving directory `/home/prathamesh.kulkarni/v8/out'
make: *** [arm.release] Error 2

d8.ltrans1.s:
https://www.dropbox.com/s/3elyf1p2to01mxu/d8.ltrans1.s?dl=0
The offending offset is 983042 (at line 58822)
ldr r7, =983042

The assmebly corresponds to following inline assembly in
CpuFeatures::FlushICache(), which defined in src/arm/cpu-arm.cc 
  register uint32_t beg asm("r0") = reinterpret_cast<uint32_t>(start);
  register uint32_t end asm("r1") = beg + size;
  register uint32_t flg asm("r2") = 0;

  asm volatile(
    // This assembly works for both ARM and Thumb targets.

    // Preserve r7; it is callee-saved, and GCC uses it as a frame pointer for
    // Thumb targets.
    "  push {r7}\n"
                                  // r0 = beg
                                  // r1 = end
                                  // r2 = flags (0)
    "  ldr r7, =%c[scno]\n"       // r7 = syscall number
    "  svc 0\n"

    "  pop {r7}\n"
    :
    : "r" (beg), "r" (end), "r" (flg), [scno] "i" (__ARM_NR_cacheflush)
    : "memory");

gcc -v:
Using built-in specs.
COLLECT_GCC=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu/bin/arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu/libexec/gcc/arm-linux-gnueabihf/5.0.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /home/prathamesh.kulkarni/gnu-toolchain/src/gcc.git/configure
SHELL=/bin/bash --with-bugurl=https://bugs.linaro.org
--with-mpc=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu
--with-mpfr=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu
--with-gmp=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu
--with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap
--with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-multiarch
--disable-multilib --enable-c99 --with-tune=cortex-a9 --with-arch=armv7-a
--with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb
--with-build-sysroot=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/sysroots/arm-linux-gnueabihf
--enable-lto --enable-linker-build-id --enable-long-long --enable-shared
--with-sysroot=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/sysroot-arm-linux-gnueabihf
--enable-languages=c,c++,lto --enable-fix-cortex-a53-835769
--enable-checking=yes --disable-bootstrap --build=x86_64-unknown-linux-gnu
--host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf
--prefix=/home/prathamesh.kulkarni/gnu-toolchain/v8-arm/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 5.0.0 20150410 (experimental) (GCC) 


Thank you,
Prathamesh


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/65778] v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf
  2015-04-15 21:28 [Bug lto/65778] New: v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf prathamesh3492 at gcc dot gnu.org
@ 2015-04-15 23:35 ` pinskia at gcc dot gnu.org
  2015-04-16  7:40 ` rguenth at gcc dot gnu.org
  2015-04-22 18:49 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-04-15 23:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can't you not use just a move instead of a ldr here?  basically it is the
assembler which creates the constant pool here and that is too far from the
where the ldr is located because the function is "huge".


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/65778] v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf
  2015-04-15 21:28 [Bug lto/65778] New: v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf prathamesh3492 at gcc dot gnu.org
  2015-04-15 23:35 ` [Bug lto/65778] " pinskia at gcc dot gnu.org
@ 2015-04-16  7:40 ` rguenth at gcc dot gnu.org
  2015-04-22 18:49 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-16  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Thus technically INVALID?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/65778] v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf
  2015-04-15 21:28 [Bug lto/65778] New: v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf prathamesh3492 at gcc dot gnu.org
  2015-04-15 23:35 ` [Bug lto/65778] " pinskia at gcc dot gnu.org
  2015-04-16  7:40 ` rguenth at gcc dot gnu.org
@ 2015-04-22 18:49 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ramana at gcc dot gnu.org @ 2015-04-22 18:49 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ramana at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #3 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Can't you not use just a move instead of a ldr here?  basically it is the
> assembler which creates the constant pool here and that is too far from the
> where the ldr is located because the function is "huge".

Indeed the compiler has no role here. 

It's not like __ARM_NR_cacheflush is going to change is it ? You can write it
similar to the libgcc implementation for clear_cache.


regards
Ramana


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-22 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-15 21:28 [Bug lto/65778] New: v8 build fails with assembly error with LTO enabled on arm-linux-gnueabihf prathamesh3492 at gcc dot gnu.org
2015-04-15 23:35 ` [Bug lto/65778] " pinskia at gcc dot gnu.org
2015-04-16  7:40 ` rguenth at gcc dot gnu.org
2015-04-22 18:49 ` ramana at gcc dot gnu.org

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).