Discussion:
[PATCH v3 1/3] or1k: libgcc: initial support for openrisc
Sebastian Huber
2018-11-12 07:26:30 UTC
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
2018-11-12 22:01:48 UTC
Permalink
Post by Sebastian Huber
Hello Stafford,
I tried to build the or1k-rtems5 target with GCC
4c0c3d1029e79b6709b43fed8c5a5944f245516d and Binutils
/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:60: Error: junk at end of line `l.movhi r17,ha(__clz_tab)'
l.movhi r17, ha(__clz_tab)
l.addi r17, r17, lo(__clz_tab)
l.add r3, r17, r3
l.lbz r11, 0(r3)
This reminded me of what happened when I had the old or1k-rtems binutils in my PATH when I built.
I did a build with the binutils-gdb master and no RTEMS tools directory in my PATH and the build completed successfully.
Can you confirm that you are not using an old or1k binutils?
--joel
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
2018-11-14 06:06:27 UTC
Permalink
Sebastian confirmed he couldn't get a complete RTEMS build either.
I looked into this enough to spot that old or1k port's libgcc/config.host
The gcc master repo is missing the "extra_parts" line that was in the other
repository.
or1k-*-*)
tmake_file="$tmake_file or1k/t-or1k"
tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl t-softfp"
extra_parts="$extra_parts crti.o crtn.o"
;;
OK for Sebastian or I to add that line?
Hi Joel,
Did adding that fix the issue? We removed crti.o and crtn.o because we switched
to exclusive libc_init/fini_array. It should not help to add those back, see
https://github.com/stffrdhrn/gcc/commit/46131027c9775ebcddc48bd0ae64ceec5b1f801f
What is the error you are seeing?
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...