Opened 13 months ago

Last modified 10 days ago

#62719 new defect

arm-none-eabi-gcc fails to build on M1

Reported by: hpux735 (William Dillon) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: arm64, bigsur Cc: NickFabry (Nick Fabry), irdc
Port: arm-none-eabi-gcc

Description


Attachments (2)

main.log (36.3 KB) - added by hpux735 (William Dillon) 13 months ago.
port logs
patch-build-m1-fix.diff (396 bytes) - added by irdc 5 weeks ago.
Fix for build on M1

Download all attachments as: .zip

Change History (13)

Changed 13 months ago by hpux735 (William Dillon)

Attachment: main.log added

port logs

comment:1 Changed 13 months ago by hpux735 (William Dillon)

It looks like this might be the upstream bug?

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97865

comment:2 Changed 13 months ago by ryandesign (Ryan Schmidt)

Yes, that looks like the bug. A common problem with many ports on Big Sur and later. (Any software using libtool and relying on undefined symbols.) Looks like gcc went a slightly different direction with the fix from the one that we usually apply, which is the one I described in the upstream libtool bug report which the developers of libtool have yet to acknowledge.

comment:3 Changed 13 months ago by hpux735 (William Dillon)

Ah, very interesting. Thanks. Is this something that'll be blocked indefinitely until it's done upstream, or is it something that can be patched in the port files?

comment:4 Changed 13 months ago by ryandesign (Ryan Schmidt)

We should update arm-none-eabi-gcc to the latest version, which is 10.3.0. Maybe that already incorporates the fix. If not, or if updating is too difficult, we can apply a patch.

Note that "we" means any interested volunteer. This port has no maintainer.

comment:5 Changed 13 months ago by hpux735 (William Dillon)

Ok, I can give it a shot. Just so long as you don't mind me asking questions on this bug if I get stuck

comment:6 Changed 13 months ago by hpux735 (William Dillon)

So I see your patch, and that makes sense. Where I'm a little stuck is that the portfiles for the cross tools are all made with that tcl script, and I'm not really familiar with how to "hook" into it. Do you have any advice?

comment:7 Changed 12 months ago by GarrettAlbright (Garrett Albright)

Bumping this because I'd like to use it, but I'm just not smart enough about how compilers work to know where to begin on patching it as was discussed above. I'll put a bounty of US$20 out there for anyone that can get this installable on the M1 before the end of May 2021.

comment:8 Changed 4 months ago by NickFabry (Nick Fabry)

Cc: NickFabry added

Changed 5 weeks ago by irdc

Attachment: patch-build-m1-fix.diff added

Fix for build on M1

comment:9 Changed 5 weeks ago by irdc

People doing RISC-V cross-compiles have already ran into this as well, and have found a fix: https://github.com/riscv-software-src/homebrew-riscv/issues/47#issuecomment-772306695. Note that this is said to disable pre-compiled headers and thus incurs a performance hit for those projects using these. I've attached a patch and can confirm I can build this port with the patch applied.

comment:10 Changed 4 weeks ago by irdc

Cc: irdc added

comment:11 Changed 10 days ago by johankytt

Tried applying the patch by irdc. Makes no difference, still exactly the same error as in the original post. I assume "/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/cross/arm-none-eabi-gcc/work/gcc-11.3.0/gcc/config.host" is the correct file to patch? grep found no other file containing the lines from the patch.

Note: See TracTickets for help on using tickets.