Bug 15361

Summary: Buildroot linking error on Apple Silicon
Product: buildroot Reporter: Jakub <jakub.swistak.stud>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: normal CC: buildroot, james.hilliard1
Priority: P5    
Version: 2022.11.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS   
Host: Target:
Build:
Attachments: Logs

Description Jakub 2023-03-01 13:26:51 UTC
HI, 
I'm trying to run Buildroot on Apple Silicon, I'm unable to do that since I'm getting an error with linking the libraries.
After running 'make menuconfig' I'm getting an error 'Undefined symbols for architecture arm64' (top of Attachment 2 for full log), I was able to solve it by running 
'❯ cd output/build/buildroot-config'
'❯ /usr/local/bin/gcc -DCURSES_LOC="<curses.h>" -DLOCALE -DKBUILD_NO_NLS -I/Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config -DCONFIG_=\"\"   /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/mconf.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/zconf.tab.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/lxdialog/checklist.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/lxdialog/util.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/lxdialog/inputbox.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/lxdialog/textbox.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/lxdialog/yesno.o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/lxdialog/menubox.o  -o /Users/jakubswistak/Desktop/lines2/buildroot-2022.11.1/output/build/buildroot-config/mconf -lncurses' - added '-lncurses' 
But later during the compilation 'make'
I'm getting another error with linking library (bottom of Attachment 2 for full log) 

I'm using Apple M2 chip with gcc/g++ 12.2.0 installed via homebrew.
Comment 1 James Hilliard 2023-03-01 14:32:02 UTC
Buildroot should mostly work on apple silicon, I have an autobuilder running on a M1 mac mini myself:
http://autobuild.buildroot.net/?submitter=James+Hilliard+%28asahi-mini%29

Are you using the arch based Asahi Linux(https://asahilinux.org/)?
Comment 2 Jakub 2023-03-01 16:21:32 UTC
Created attachment 9516 [details]
Logs

Logs of an errors from terminal
Comment 3 Peter Korsgaard 2023-03-01 16:27:00 UTC
(In reply to Jakub from comment #0)

Building on MacOS is unlikely to work, you really need to build on a Linux machine. x86-64 naturally gets most testing, but conceptually it should work to build on an arm64 Linux machine as well (except for the prebuilt external toolchains and similar).
Comment 4 Jakub 2023-03-01 16:39:05 UTC
(In reply to James Hilliard from comment #1)
I'm using macOS Ventura 13.2.1 and building an image for raspberry pi
Comment 5 James Hilliard 2023-03-01 21:02:50 UTC
(In reply to Jakub from comment #4)

Yeah, buildroot needs a Linux based host OS, macOS isn't going to work. You need to install something like Asahi Linux, a aarch64 virtual machine may also work via qemu or something.