Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create build image on ARM (m1) Mac #194

Open
Emstr opened this issue Mar 10, 2022 · 1 comment
Open

Can't create build image on ARM (m1) Mac #194

Emstr opened this issue Mar 10, 2022 · 1 comment

Comments

@Emstr
Copy link

Emstr commented Mar 10, 2022

I'm struggling to create a build image on my M1 MacBook Pro.

After I run ./build-showmewebcam.sh raspberrypi0w I get the console output:

Using configs/config as base
Merging configs/raspberrypi0w
cp: illegal option -- T
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory

merged configuration written to configs/raspberrypi0w_defconfig (needs make)

sed: 1: "1i ### DO NOT EDIT, thi ...": command i expects \ followed by text
sed: 1: "1i ### DO NOT EDIT, thi ...": command i expects \ followed by text
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
GEN /Users/emoryfierlinger/showmewebcam/output/raspberrypi0w/Makefile

configuration written to /Users/emoryfierlinger/showmewebcam/output/raspberrypi0w/.config

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
/Applications/Xcode.app/Contents/Developer/usr/bin/make -j1 O=/Users/emoryfierlinger/showmewebcam/output/raspberrypi0w HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
GEN /Users/emoryfierlinger/showmewebcam/output/raspberrypi0w/Makefile

You must install 'gcc' on your build machine
make[1]: *** [dependencies] Error 1
make: *** [_all] Error 2

However, I do have gcc installed. gcc -v returns

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I think this appears to be an issue with the arm64 version of gcc? When I try to manually run the Makefile using gcc I get the error:

emoryfierlinger@emorys-mbp showmewebcam % gcc /Users/emoryfierlinger/showmewebcam/output/raspberrypi0w/Makefile
ld: warning: ignoring file /Users/emoryfierlinger/showmewebcam/output/raspberrypi0w/Makefile, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x23 0x20 0x41 0x75 0x74 0x6F 0x6D 0x61 0x74 0x69 0x63 0x61 0x6C 0x6C 0x79 0x20 )
Undefined symbols for architecture arm64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any help would be greatly appreciated

@rockavoldy
Copy link

I got this issue when i try to compile the project on my M1 Mac without any virtualization, after some searching, found this great document to cross-compile linux kernel on Mac from @geerlingguy

You can fire up that docker image, and try compile the project again with that docker image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants