Discussion:
[PATCH v3 1/3] or1k: libgcc: initial support for openrisc
Sebastian Huber
6 years ago
Permalink
Hello Stafford,

I tried to build the or1k-rtems5 target with GCC
4c0c3d1029e79b6709b43fed8c5a5944f245516d and Binutils
417e50dbcfd4b8dd699f48df5ac9b9a733fd80e2. It failed in the libgcc build:

/scratch/git-rtems-source-builder/rtems/build/or1k-rtems5-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d-newlib-2ab57ad59bc35dafffa69cd4da5e228971de069f-x86_64-linux-gnu-1/build/./gcc/xgcc
-B/scratch/git-rtems-source-builder/rtems/build/or1k-rtems5-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d-newlib-2ab57ad59bc35dafffa69cd4da5e228971de069f-x86_64-linux-gnu-1/build/./gcc/
-nostdinc
-B/scratch/git-rtems-source-builder/rtems/build/or1k-rtems5-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d-newlib-2ab57ad59bc35dafffa69cd4da5e228971de069f-x86_64-linux-gnu-1/build/or1k-rtems5/mcmov/newlib/
-isystem
/scratch/git-rtems-source-builder/rtems/build/or1k-rtems5-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d-newlib-2ab57ad59bc35dafffa69cd4da5e228971de069f-x86_64-linux-gnu-1/build/or1k-rtems5/mcmov/newlib/targ-include
-isystem
/scratch/git-rtems-source-builder/rtems/build/or1k-rtems5-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d-newlib-2ab57ad59bc35dafffa69cd4da5e228971de069f-x86_64-linux-gnu-1/gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/newlib/libc/include
-B/build/rtems/5/or1k-rtems5/bin/ -B/build/rtems/5/or1k-rtems5/lib/
-isystem /build/rtems/5/or1k-rtems5/include -isystem
/build/rtems/5/or1k-rtems5/sys-include  -mcmov -g -O2 -O2
-I../../../../gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/libgcc/../newlib/libc/sys/rtems/include
-g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I.
-I../../.././gcc
-I../../../../gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/libgcc
-I../../../../gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/libgcc/.
-I../../../../gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/libgcc/../gcc
-I../../../../gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/libgcc/../include
-o _ffssi2.o -MT _ffssi2.o -MD -MP -MF _ffssi2.dep -DL_ffssi2 -c
../../../../gnu-mirror-gcc-4c0c3d1029e79b6709b43fed8c5a5944f245516d/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS -save-temps
libgcc2.s: Assembler messages:
libgcc2.s:60: Error: junk at end of line `l.movhi r17,ha(__clz_tab)'

The file content in this area is:

.L4:
.LVL4:
.LM17:
.LBE3:
.LM18:
.LBE2:
.LM19:
.LBB6:
.LBB4:
.LM20:
    l.movhi    r17, ha(__clz_tab)
    l.addi    r17, r17, lo(__clz_tab)
    l.add    r3, r17, r3
.LVL5:
    l.lbz    r11, 0(r3)
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : ***@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Stafford Horne
6 years ago
Permalink
...
Thanks Joel,

I havent had time to try reproduce this yet, but I was expecting an
old version of gas too. The error " junk at end of line `l.movhi
r17,ha(__clz_tab)'" is saying that gas doesn't understand ha().
Which is something we added fairly recently [0].

If that still doesn't work let us know.

[0] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=cpu/or1k.opc;hb=HEAD#l290

-Stafford
Sebastian Huber
6 years ago
Permalink
...
It was an error in our GCC specs file. I fixed it like this:

https://git.rtems.org/rtems/commit/?id=28bf4cae7878f4e47cc24c114fc9c5567247ecc1

I was able to build the RTEMS BSP and link the tests with the upstream
GCC 9.
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : ***@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Loading...