Microblaze Tools Fails to Build
Summary
Tools for microblaze-rtems6 fail to build with the issue being an XXX version conflict that results in a compile error for gcc. This is the error message from the RSB log:
libtool: compile: gcc -O2 -g -pipe -I/home/joel/rtems-work/rtems-source-builder/rtems/build/tmp/sb-1000/6/rtems-microblaze/home/joel/rtems-work/tools/6/include -I/home/joel/rtems-work/rtems-source-builder/rtems/build/tmp/sb-1000-internal/include -DHAVE_CONFIG_H -I. -I../../../gnu-mirror-gcc-d04fe55/mpc/src -I.. -g -O2 -MT mul.lo -MD -MP -MF .deps/mul.Tpo -c ../../../gnu-mirror-gcc-d04fe55/mpc/src/mul.c -o mul.o
../../../gnu-mirror-gcc-d04fe55/mpc/src/mul.c:175:1: error: conflicting types for ‘mpfr_fmma’; have ‘int(__mpfr_struct *, const __mpfr_struct *, const __mpfr_struct *, const __mpfr_struct *, const __mpfr_struct *, int, mpfr_rnd_t)’
175 | mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
| ^~~~~~~~~
In file included from ../../../gnu-mirror-gcc-d04fe55/mpc/src/mpc.h:25,
from ../../../gnu-mirror-gcc-d04fe55/mpc/src/mpc-impl.h:30,
from ../../../gnu-mirror-gcc-d04fe55/mpc/src/mul.c:22:
/usr/include/mpfr.h:765:21: note: previous declaration of ‘mpfr_fmma’ with type ‘int(__mpfr_struct *, const __mpfr_struct *, const __mpfr_struct *, const __mpfr_struct *, const __mpfr_struct *, mpfr_rnd_t)’
765 | __MPFR_DECLSPEC int mpfr_fmma (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr,
| ^~~~~~~~~
I ran git bisect and it identified this as the breaking commit:
423d98d2058a7dac0921f9a13113b024696236b9 is the first bad commit
commit 423d98d2058a7dac0921f9a13113b024696236b9
Author: Chris Johns <chrisj@rtems.org>
Date: Sat Jun 8 09:04:11 2024 +1000
gdb: Build MPFR before GDB as it now depeneds on it
Closes #7
bare/config/devel/expat-internal.bset | 14 +++++++++
bare/config/devel/gmp-internal.bset | 14 +++++++++
bare/config/devel/mpfr-4.2.1.cfg | 18 +++++++++++
bare/config/devel/mpfr-internal.bset | 14 +++++++++
rtems/config/6/rtems-default.bset | 1 +
rtems/config/tools/rtems-default-tools.bset | 16 ++++++++--
source-builder/config/expat-2-1.cfg | 47 ++++++++++++++++++++++++---
source-builder/config/gcc-13.cfg | 8 ++---
source-builder/config/gcc-common-1.cfg | 16 ++--------
source-builder/config/gdb-common-1.cfg | 2 +-
source-builder/config/gmp.cfg | 48 +++++++++++++++++++++++++---
source-builder/config/mpfr.cfg | 49 ++++++++++++++++++++++++++---
source-builder/defaults.mc | 19 +++++++----
13 files changed, 223 insertions(+), 43 deletions(-)
create mode 100644 bare/config/devel/expat-internal.bset
create mode 100644 bare/config/devel/gmp-internal.bset
create mode 100644 bare/config/devel/mpfr-4.2.1.cfg
create mode 100644 bare/config/devel/mpfr-internal.bset
This is the git bisect log:
$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [c085b3bafb66e7cf2f9afd8b2622b5c1799e1616] rtems-tools: Fetch rtems-syms improvements
git bisect bad c085b3bafb66e7cf2f9afd8b2622b5c1799e1616
# status: waiting for good commit(s), bad commit known
# good: [93321bacf219039a02b3150c83ed1114d5bd1657] Change README to markdown
git bisect good 93321bacf219039a02b3150c83ed1114d5bd1657
# good: [b7be268a79710ad267e967a112644b105b2c4133] config/rtems-kernel: Update for gitlab
git bisect good b7be268a79710ad267e967a112644b105b2c4133
# bad: [80f8bdb11dd373dfa26376c1beb378f0c16d7943] bare/expat-internal: Fix the default version
git bisect bad 80f8bdb11dd373dfa26376c1beb378f0c16d7943
# bad: [423d98d2058a7dac0921f9a13113b024696236b9] gdb: Build MPFR before GDB as it now depeneds on it
git bisect bad 423d98d2058a7dac0921f9a13113b024696236b9
# good: [d68c65b2e03ac7512922dc167f3573badc7d1cfe] config/rtems-net-services: Update for gitlab
git bisect good d68c65b2e03ac7512922dc167f3573badc7d1cfe
# good: [f39e9584775a0bccdbd6959a9c55d473330d08e2] Migrate devel links to gitlab
git bisect good f39e9584775a0bccdbd6959a9c55d473330d08e2
# first bad commit: [423d98d2058a7dac0921f9a13113b024696236b9] gdb: Build MPFR before GDB as it now depeneds on it
The microblaze target is using a specific version of binutils and gcc with patches extracted from the Xilinx repo. Updating to FSF versions is not possible. There is an effort underway to submit work but the person who reached out to the binutils and gcc communities says it may take a year. So we are stuck needing to get the Microblaze target back to its state before this patch.
The contrib/download_prerequisites script with the Xilinx gcc version cites these:
gmp-6.1.0.tar.bz2
mpfr-3.1.6.tar.bz2
mpc-1.0.3.tar.gz
isl-0.18.tar.bz2
Steps to reproduce
cd ``` rtems ../source-builder/sb-set-builder --prefix=${HOME}/rtems-work/tools/6 --log=l-microblaze.txt 6/rtems-microblaze
/milestone %6.1