Hello all,
I am attempting to follow the instructions to build RTEMS using the source builder.
My build/development machine is an x86-64 machine running an up-to-date and upgraded version of Arch Linux.
Unfortunately, my build fails when invoking the following command:
../source-builder/sb-set-builder --log=build-log.txt --prefix=$HOME/rtems/compiler/7 --warn-all --targetcflags -std=c17 7/rtems-arm
with the following output and error message:
RTEMS Source Builder - Set Builder, 7 (599b400823d8)
warning: dir: not found: (_buildcxcdir) /home/nikola/rtems/rtems-source-builder/rtems/build/-cxc
warning: dir: not found: (_buildxcdir) /home/nikola/rtems/rtems-source-builder/rtems/build/-xc
warning: dir: not found: (_configdir) /home/nikola/rtems/rtems-source-builder/rtems/config:/home/nikola/rtems/rtems-source-builder/source-builder/config:/home/nikola/rtems/rtems-source-builder/bare/config:/home/nikola/rtems/rtems-source-builder/rtems/config
warning: dir: not found: (_patchdir) /home/nikola/rtems/rtems-source-builder/rtems/patches:/home/nikola/rtems/rtems-source-builder/source-builder/patches
warning: dir: not found: (_tardir) /home/nikola/rtems/rtems-source-builder/rtems/tar
Build Set: 7/rtems-arm
Build Set: tools/rtems-default-tools.bset
config: devel/dtc-1.7.2-1.cfg
package: dtc-1.7.2-x86_64-linux-gnu-1
building: dtc-1.7.2-x86_64-linux-gnu-1
sizes: dtc-1.7.2-x86_64-linux-gnu-1: 4.171MB (installed: 1.116MB)
cleaning: dtc-1.7.2-x86_64-linux-gnu-1
reporting: devel/dtc-1.7.2-1.cfg -> dtc-1.7.2-x86_64-linux-gnu-1.txt
reporting: devel/dtc-1.7.2-1.cfg -> dtc-1.7.2-x86_64-linux-gnu-1.xml
Build Set: devel/expat-internal.bset
config: devel/expat-2.5.0-1.cfg
package: expat-2.5.0-x86_64-linux-gnu-1
building: expat-2.5.0-x86_64-linux-gnu-1
sizes: expat-2.5.0-x86_64-linux-gnu-1: 8.191MB (installed: 0.000B)
cleaning: expat-2.5.0-x86_64-linux-gnu-1
cleaning: expat-2.5.0-x86_64-linux-gnu-1
Build Set: Time 0:00:06.339480
Build Set: devel/gmp-internal.bset
config: devel/gmp-6.3.0.cfg
package: gmp-6.3.0-x86_64-linux-gnu-1
building: gmp-6.3.0-x86_64-linux-gnu-1
error: building gmp-6.3.0-x86_64-linux-gnu-1
Build FAILED
See error report: rsb-report-gmp-6.3.0-x86_64-linux-gnu-1.txt
Note: In some cases the error appears only in
the complete build log (see --log option)
error: building gmp-6.3.0-x86_64-linux-gnu-1
Build Set: Time 0:00:01.537105
error: building gmp-6.3.0-x86_64-linux-gnu-1
Build Set: Time 0:00:16.636439
error: building gmp-6.3.0-x86_64-linux-gnu-1
Build Set: Time 0:00:16.637604
Build FAILED
I dug through the generated log file for failing gmp build and found the following cause reported:
checking compiler gcc -O2 -g -pipe -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000/devel/gmp-internal/home/nikola/rtems/compiler/7/include -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000-internal/include -O2 -pedantic -fomit-frame-pointer -m64 ... no, long long reliability test 1
checking ABI=x32
checking compiler gcc -O2 -g -pipe -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000/devel/gmp-internal/home/nikola/rtems/compiler/7/include -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000-internal/include -O2 -pedantic -fomit-frame-pointer -mx32 ... no
checking ABI=32
checking compiler gcc -O2 -g -pipe -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000/devel/gmp-internal/home/nikola/rtems/compiler/7/include -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000-internal/include -m32 -O2 -pedantic -fomit-frame-pointer ... no, long long reliability test 1
checking compiler gcc -O2 -g -pipe -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000/devel/gmp-internal/home/nikola/rtems/compiler/7/include -I/home/nikola/rtems/rtems-source-builder/rtems/build/tmp/sb-1000-internal/include -O2 -pedantic -fomit-frame-pointer ... no, long long reliability test 1
configure: error: could not find a working compiler, see config.log for details
A bit of digging on github and other corners of the internet has lead to a few other instances of the same problem being reported:
It appears that GCC15 defaults to using C23 which doesn’t like portions of the GMP source code. To test whether this is the case, I forced gcc to use the C17 standard via setting the CC environment variable in my bash profile. I can successfully run the configure script and makefile manually via terminal after doing so. Unfortunately the error seems to persist despite my attempts to inject a flag to force the use of the C17 standard when running the source builder. I have also tried to force gcc to use the C17 standard by using an alias for x86_64-linux-gnu-gcc (x86_64-linux-gnu-gcc=‘x86_64-linux-gnu-gcc -std=c17’), but with no success.
I’m still learning my way around Linux, so I’m a bit stuck for ideas on what to try next. If anyone has any advice on how to work around this, it would be much appreciated.
Regards,
elektronik

