RFC: Building RTEMS/RISC-V with LLVM/Clang

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Nov 14 10:06:07 UTC 2019


On 14/11/2019 10:53, Hesham Almatary wrote:
>>>> To which directory NEWLIB_SYSROOT in the /opt/rtems/5 installation tree
>>>> must this point?
>>>>
>>> riscv-rtems5. Or the corresponding multilib directory for your RISC-V BSP.
>> So, if I use --sysroot=/opt/rtems/5/riscv-rtems5, then clang will pick
>> up /opt/rtems/5/riscv-rtems5/include for the headers and
>> /opt/rtems/5/riscv-rtems5/lib for the libraries. I guess this works only
>> for the default multilib. What do I have to do to use another multilib?
>> Add a -L/build/rtems/5/riscv-rtems5/lib/rv32im/ilp32 before the
>> --sysroot? Why don't you use -I and -L instead of the --sysroot? This
>> --sysroot seems to me quite unsafe in combination with multilibs.
>>
> You're right. --sysroot would only work for the default build.
> Normally I build newlib with Clang for each RTEMS BSP I build since
> Clang/newlib isn't yet able to build multilib.

Ok, I tried to use the Newlib built with GCC. I think this should be 
supported as well.

> That's definitely
> something that can be changed. We can remove this -sysroot requirement
> and ask the user to provide -I and -L in the CFLAGS while configuring.
> Does that make more sense  to you?

Yes, I think the --sysroot requirement should be removed. The user 
should have the option to use it or not. It should be optional. Once 
this works I think that the clang build should work in the new build system.

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


More information about the devel mailing list