Building RTEMS 6 toolchain on a Mac

Cedric Berger cedric at precidata.com
Mon Apr 18 19:01:46 UTC 2022


Hello,

On 11.04.22 00:37, Chris Johns wrote:
> I suspect we will need a later version of expat that has the aarch64 support. I
> do not have access access to an M1 Mac so I cannot test this.
>
> Chris

So I tried to compile RTEMS 6 for arm on MacOS for both the M1 and Intel 
architecture. It was not very sucessful.

Command: rtems# ../source-builder/sb-set-builder 
--prefix=/opt/data/workspace/rtems-tools 6/rtems-arm

First on a M1 (fully patched and updated Mac Book Pro):

I got the same failure as Jay Zhu with expat, but that was easy to fix: 
I can confirm that moving from expat 2.1.0 to expat 2.4.8 solve the problem.

Next is the same issue with GMP. Again easy to fix by moving from gmp 
6.1.0 to 6.2.1, which solves the problem.

At this point everthing compiles fine up to and including binutils 2.38

The next problem however is with gcc, which fails the same way (machine 
`arm64-apple' not recognized)

Fixing this however is above my pay grade: It seems RTEMS uses a 
patched, unreleased version of GCC. what to do?

Next I tried on an Intel Mac (an older fully patched and updated Mac 
Book Pro):

The build also failed compiling gcc, but with another error:

clang: warning: argument unused during compilation: '-no-pie' 
[-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
   "_arm_arch6", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
   "_arm_arch6m", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
   "_arm_arch7", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
   "_arm_arch8", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
   "_arm_arch_notm", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
   "_arm_arch_thumb2", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
   "_target_flags", referenced from:
       __GLOBAL__sub_I_gencondmd.c in gencondmd.o
ld: symbol(s) not found for architecture x86_64

is this something like this? 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061#c5

If this is the same bug, then it is fixed on gcc 11.2 according to the 
last comment above.

So what to do next? GCC fails on both Intel and M1 Mac, for different 
reasons.

Could GCC be upgraded to 11.2 or 12.0 which should be available very 
soon? are the patches still needed?

Thanks,

Cedric




More information about the devel mailing list