Compiling sparc/leon3 with clang

Gedare Bloom gedare at rtems.org
Wed Jul 31 18:50:58 UTC 2019


On Wed, Jul 31, 2019 at 11:20 AM Gedare Bloom <gedare at rtems.org> wrote:
>
> On Wed, Jul 31, 2019 at 10:03 AM Joel Sherrill <joel at rtems.org> wrote:
> >
> >
> >
> > On Wed, Jul 31, 2019 at 10:52 AM Gedare Bloom <gedare at rtems.org> wrote:
> >>
> >> On Tue, Jul 30, 2019 at 11:09 PM Sebastian Huber
> >> <sebastian.huber at embedded-brains.de> wrote:
> >> >
> >> > On 31/07/2019 01:23, Gedare Bloom wrote:
> >> > > Hello folks,
> >> > >
> >> > > I'm trying to compile leon3 with clang, because I'm under the
> >> > > impression it should be possible. I got as far as
> >> > > mv -f base_sp/.deps/base_sp-apptask.Tpo base_sp/.deps/base_sp-apptask.Po
> >> > > clang -target sparc-rtems5 -ccc-gcc-name sparc-rtems5-gcc
> >> > > -mcpu=leon3 -O2 -g -ffunction-sections -fdata-sections -Wall
> >> > > -Wmissing-prototypes -Wimplicit-function-declaration
> >> > > -Wstrict-prototypes -Wnested-externs -B./../../lib/libbsp/sparc/leon3
> >> > > -B/mnt/devel/rtems/rtems/bsps/sparc/leon3/start -qrtems
> >> > > -L./../../cpukit -L/mnt/devel/rtems/rtems/bsps/sparc/shared/start
> >> > > -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar -Wl,--gc-sections
> >> > > -o base_sp.exe base_sp/base_sp-init.o base_sp/base_sp-apptask.o
> >> > > ./../../lib/libbsp/sparc/leon3/librtemsbsp.a
> >> > > ./../../cpukit/librtemscpu.a ./../../cpukit/librtemstest.a
> >> > > clang-10: error: unknown argument: '-qrtems'
> >> > > Makefile:665: recipe for target 'base_sp.exe' failed
> >> > > make[5]: *** [base_sp.exe] Error 1
> >> > > make[5]: Leaving directory
> >> > > '/mnt/devel/rtems/builds/b-erc32-clang/sparc-rtems5/c/leon3/testsuites/samples'
> >> > >
> >> > > Any advice how to get past this qrtems error?
> >> >
> >> > The -qrtems is an RTEMS-specific GCC option.  See also:
> >> >
> >> > https://lists.rtems.org/pipermail/devel/2018-September/023095.html
> >> > https://lists.rtems.org/pipermail/devel/2019-June/026396.html
> >> >
> >> I don't see any resolution from this matter. Is there a path forward,
> >> or what is the hard part?
> >
> >
> > The Gaisler folks did the work and had the sparc BSPs building. Not sure what
> > the missing bits are but they should know.
> >
> I suspect they have modified llvm/clang frontend slightly, to deal
> with this qrtems... I downloaded the RCC-1.3 and will try that
> out-of-box to see if it succeeds or not. I couldn't see any
> source/patches for llvm/clang so not really sure. Hopefully they can
> comment whether there are changes that have to be made.
>
They built a 32-bit toolchain (sparc-gaisler-rtems-clang), so I had to
install some 32-bit libraries (lib32tinfo-dev lib32ncurses5-dev) on my
Ubuntu machine to get newlib/rtems to compile.

After that I was able to build newlib and rtems, and I built/linked
the in-tree RTEMS samples and ran hello. (dl06 failed though with
error: getting standard libs: Library not found: libssp.a) So it
definitely seems like the RCC's version of clang understands to some
extent the -qrtems.

Gedare

> > --joel
> >>
> >>
> >> -Gedare
> >>
> >> > --
> >> > 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  : sebastian.huber at embedded-brains.de
> >> > PGP     : Public key available on request.
> >> >
> >> > Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> >> _______________________________________________
> >> devel mailing list
> >> devel at rtems.org
> >> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list