0

I'm trying to build an OS Image for Raspberry pi on MacOS.

make failed because gcc is missing so I installed it with homebrew.

Still I cannot build the image due to the same error:

% make raspberrypi0w_defconfig
...
% make menuconfig
...
% brew install gcc
...

% brew list --versions gcc
gcc 11.3.0_2

% gcc -v
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 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

% make
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

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

Tried a make clean but I'm still getting the same error...

sagism
  • 881
  • 4
  • 11
  • 18

1 Answers1

2

I ended up switching to gcc (it was a path issue).

clang is apple's C compiler, and when you type gcc, this is the compiler that is used by default. When you install gnu c, (using homebrew in my case), you still need to put it ahead of clang in the path.

However, using BuildRoot on MacOS ended up being a rabbit hole.

There are instructions here: https://github.com/generia/buildroot-osx , but for me it was far simpler to setup an ubuntu VM and build on it. Which I did.

sagism
  • 881
  • 4
  • 11
  • 18