Unable to build BSP using waf

Hey, trying to build bsp as given here: 2.5. Build a Board Support Package (BSP) — RTEMS User Manual 7.491f6c8 (12th May 2025) documentation

running waf configure gives me this:

❯ ./waf configure --prefix=/home/prashant/Proj/rtems/out/7
Setting top to                           : /home/prashant/Proj/rtems/fork
Setting out to                           : /home/prashant/Proj/rtems/fork/build
Configure RTEMS version                  : 7.0.f30157f988df3c9f75c201124573520c03edf6a3
Environment variable set                 : AR
Environment variable set                 : AS
Environment variable set                 : CC
Environment variable set                 : CXX
Environment variable set                 : LD
Configure board support package (BSP)    : sparc/erc32
Checking for program 'sparc-rtems7-gcc'  : /home/prashant/Proj/rtems/out/7/bin/sparc-rtems7-gcc
Checking for program 'sparc-rtems7-g++'  : /home/prashant/Proj/rtems/out/7/bin/sparc-rtems7-g++
Checking for program 'sparc-rtems7-ar'   : /home/prashant/Proj/rtems/out/7/bin/sparc-rtems7-ar
Checking for program 'sparc-rtems7-ld'   : /home/prashant/Proj/rtems/out/7/bin/sparc-rtems7-ld
Checking for program 'ar'                : ar
Checking for program 'g++, c++'          : g++
Checking for program 'ar'                : ar
Checking for program 'gas, gcc'          : as
Checking for program 'ar'                : ar
Checking for program 'gcc, cc'           : gcc
Checking for program 'ar'                : ar
Checking for asm flags '-MMD'            : Could not find a .d dependency file, are cflags/cxxflags overwritten?
no
Checking for c flags '-MMD'              : yes
Checking for cxx flags '-MMD'            : yes
'configure' finished successfully (0.309s)

It seems that its picking up my host’s compiler (for gcc, g++, ar), is that normal?
so when I try to build it, i get the following

❯ ./waf -v
Waf: Entering directory `/home/prashant/Proj/rtems/fork/build'
Waf: Leaving directory `/home/prashant/Proj/rtems/fork/build'
'build' finished successfully (0.089s)
Waf: Entering directory `/home/prashant/Proj/rtems/fork/build/sparc/erc32'
18:59:43 runner 'git ls-files --modified'
18:59:43 runner 'git rev-parse HEAD'
[   1/1502] Compiling bsps/shared/dev/serial/mc68681_reg2.c
18:59:43 runner ['gcc', '-MMD', '-Wall', '-Wempty-body', '-Werror', '-Wmissing-prototypes', '-Wimplicit-function-declaration', '-Wstrict-prototypes', '-Wnested-externs', '-Wold-style-declaration', '-mcpu=cypress', '-O2', '-g', '-fdata-sections', '-ffunction-sections', '-Icpukit/include', '-I../../../cpukit/include', '-Icpukit/score/cpu/sparc/include', '-I../../../cpukit/score/cpu/sparc/include', '-Icontrib/cpukit/fastlz', '-I../../../contrib/cpukit/fastlz', '-Icontrib/cpukit/utf8proc', '-I../../../contrib/cpukit/utf8proc', '-Icontrib/cpukit/uuid', '-I../../../contrib/cpukit/uuid', '-Icontrib/cpukit/zlib', '-I../../../contrib/cpukit/zlib', '-Icontrib/cpukit/xz-embedded/userspace', '-I../../../contrib/cpukit/xz-embedded/userspace', '-Ibsps/include', '-I../../../bsps/include', '-Ibsps/sparc/include', '-I../../../bsps/sparc/include', '-Ibsps/sparc/erc32/include', '-I../../../bsps/sparc/erc32/include', '../../../bsps/shared/dev/serial/mc68681_reg2.c', '-c', '-o/home/prashant/Proj/rtems/fork/build/sparc/erc32/bsps/shared/dev/serial/mc68681_reg2.c.1.o', '-DHAVE_CONFIG_H=1']

<repeated for different files, removed for sanity>

gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
cc1: error: bad value ‘cypress’ for ‘-mtune=’ switch
cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids emeraldrapids alderlake raptorlake meteorlake graniterapids graniterapids-d bonnell atom silvermont slm goldmont goldmont-plus tremont gracemont sierraforest grandridge knl knm intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 lujiazui k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 btver1 btver2 generic native

<repeated for different files, removed for sanity>

Waf: Leaving directory `/home/prashant/Proj/rtems/fork/build/sparc/erc32'
Build failed
 -> task in '/bsps/objnosmp' failed with exit status 1:
        {task 140347832601072: c mc68681_reg4.c -> mc68681_reg4.c.1.o}
['gcc', '-MMD', '-Wall', '-Wempty-body', '-Werror', '-Wmissing-prototypes', '-Wimplicit-function-declaration', '-Wstrict-prototypes', '-Wnested-externs', '-Wold-style-declaration', '-mcpu=cypress', '-O2', '-g', '-fdata-sections', '-ffunction-sections', '-Icpukit/include', '-I../../../cpukit/include', '-Icpukit/score/cpu/sparc/include', '-I../../../cpukit/score/cpu/sparc/include', '-Icontrib/cpukit/fastlz', '-I../../../contrib/cpukit/fastlz', '-Icontrib/cpukit/utf8proc', '-I../../../contrib/cpukit/utf8proc', '-Icontrib/cpukit/uuid', '-I../../../contrib/cpukit/uuid', '-Icontrib/cpukit/zlib', '-I../../../contrib/cpukit/zlib', '-Icontrib/cpukit/xz-embedded/userspace', '-I../../../contrib/cpukit/xz-embedded/userspace', '-Ibsps/include', '-I../../../bsps/include', '-Ibsps/sparc/include', '-I../../../bsps/sparc/include', '-Ibsps/sparc/erc32/include', '-I../../../bsps/sparc/erc32/include', '../../../bsps/shared/dev/serial/mc68681_reg4.c', '-c', '-o/home/prashant/Proj/rtems/fork/build/sparc/erc32/bsps/shared/dev/serial/mc68681_reg4.c.1.o', '-DHAVE_CONFIG_H=1']

<repeated for different files, removed for sanity>

I am guessing this is because my host cmpiler is x86 and not arm?

There will be a config.log file generated when you run configure. Could you please attach that and the wscript file?

Thanks

I am unable to upload files here, so I uploaded them on pastebin.
config.log:

wscript:

Thanks. I am sorry I misunderstood and thought you were building an application.

In light of this I have reviewed your original post and the output says:

They will effect the configure process and force the compiler to be what ever you have set these variables too. Please remove them and see what happens?

I am working on nixos and was inside a buildFnsEnv environment because building the tools require a fhs environment since rsb has hardcoded paths to tools like tar (to /usr/bin/tar), which is only possible in a fhs environment. That also meant that it was setting up additional env vars like ar, as.

When I tried building bsp outside that fhs environment, I was able to successfully build it.

I think hardcoding paths to common unix tools is problematic, as it assumes the host system follows an fhs compliant environment across all linux based distributions.

Thanks for you help!

Yes and I think the need for these to be hard code can be relaxed. It came from the original spec file data set.

An MR to remove the hard coded paths would be welcome. It should be as simple as removing the path component in defaults.mc and testing the changes.