[RFC] RTEMS Waf Clang support

Hesham Almatary heshamelmatary at gmail.com
Mon Mar 16 12:51:40 UTC 2020


Thanks Sebastian!

I tried to follow your instructions for adding this as a new option, but
unfortunately, XLEN didn't evaluate for RTEMS-BUILD-CPUKIT-OPTCLANG to use.
Here's the diff:

diff --git a/spec/build/cpukit/RTEMS-BUILD-CPUKIT-OPTXLEN.yml
> b/spec/build/cpukit/RTEMS-BUILD-CPUKIT-OPTXLEN.yml
> new file mode 100644
> index 0000000000..840a8ecc2c
> --- /dev/null
> +++ b/spec/build/cpukit/RTEMS-BUILD-CPUKIT-OPTXLEN.yml
> @@ -0,0 +1,19 @@
> +active: true
> +build-type: option
> +default: ''
> +default-by-variant:
> +- value: '64'
> +  variants:
> +  - riscv/rv64.*
> +derived: false
> +enabled-by: []
> +header: ''
> +level: '1.110'
> +links: []
> +name: XLEN
> +normative: true
> +order: -1000
> +ref: ''
> +reviewed: ChapNb5NSPl062d5CnU251RB5J6TljFz_mLkmFdgwVY=
> +text: ''
> +type: build


grepping for XLEN only gets me:

> c4che/spec_build.pickle:133389:ssS'RTEMS-BUILD-CPUKIT-OPTXLEN'
> c4che/spec_build.pickle:133433:S'XLEN'
>
> c4che/spec_build.pickle:154984:S'--target=${ARCH}${XLEN}-unknown-rtems${__RTEMS_MAJOR__}'
>

Am I missing something?


On Mon, 16 Mar 2020 at 12:15, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 16/03/2020 13:09, Hesham Almatary wrote:
>
> > On Mon, 16 Mar 2020 at 11:53, Sebastian Huber
> > <sebastian.huber at embedded-brains.de> wrote:
> >> On 16/03/2020 12:39, Hesham Almatary wrote:
> >>
> >>> Hi Sebastian,
> >>>
> >>> I have pushed a few commits to my repo to support building RTEMS with
> >>> Clang/LLVM for RISC-V. Here are the changes [1]. Since I'm still
> >>> learning about Waf and the build system, I'd appreciate your input.
> >>> Most importantly, I want to know what's the right way to set "target"
> >>> and "xlen" variables.
> >>>
> >>> [1]
> https://github.com/CTSRD-CHERI/rtems/compare/967b62464bf39602f8b0f2baf57617ad74c3643d...aa73f72b929856efdb41f9f8582263b5395a3276
> >> You need a new option, e.g.
> >>
> >> spec/build/cpukit/RTEMS-BUILD-CPUKIT-OPTXLEN.yml
> >>
> >> It should be enabled by clang and riscv:
> >>
> >> enabled-by:
> >>     and:
> >>     - clang
> >>     - riscv
> >>
> >> The option must be evaluated before the tool settings:
> >>
> >> order: -1000
> >>
> > Yes, I thought of that too. But I need to define XLEN to empty or
> > something for other architectures too since I use it in
> > RTEMS-BUILD-CPUKIT-OPTCLANG:
> Does it not default to the empty string if it is not defined?
> >
> >> - set-value: --target=${ARCH}${XLEN}-unknown-rtems${__RTEMS_MAJOR__}
> >> - substitute: null
> >> - env-append: ABI_FLAGS
> > How should each RISC-V BSP assign XLEN? I thought of a few ways:
> > 1) to make each BSP yml file do it, or
> > 2) to script it for RISC-V and extract it from the march value,
> > 3) to assign it in a single file and, similar to how
> > RISC-V-BUILD-BSP-RISC-V-ABI currently works, assign it per variant.
>
> I would do it similar to:
>
> spec/build/bsps/riscv/riscv/RTEMS-BUILD-BSP-RISCV-RISCV-ABI.yml
>
> You can use regular expressions for the matching variant, e.g.
>
> default: ''
> default-by-variant:
> - value: '32'
>    variants:
>    - riscv/rv32.*
> - value: '64'
>    variants:
>    - riscv/rv64.*
>
>

-- 
Hesham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200316/a2a5b79f/attachment.html>


More information about the devel mailing list