Building RTEMS 6 toolchain on a Mac
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Apr 22 06:55:59 UTC 2022
On 18/04/2022 21:01, Cedric Berger wrote:
> 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.
I sent a patch to update the GCC prerequisites to the versions in the
latest gcc/contrib/download_prerequisites script for GCC 10 and 12.
>
> 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?
RTEMS follows the release branch of GCC. Some patches cannot be back
ported to a GCC release branch in upstream GCC, so there may be some
RTEMS-specific patches. In general, all RTEMS-specific changes are
integrated in the GCC master.
>
> 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?
It is still undecided which GCC version will be used for RTEMS 6. GCC 10
will reach its end of life with the next release this year. GCC 12 would
be brand new. We didn't use GCC 11 so far. I tend to use GCC 12.
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
More information about the devel
mailing list