I have a simple make file that compiles a bunch of c files using /opt/homebrew/opt/llvm/bin/clang. I have two machines (an Intel Mac and and Apple M1 Max) both running macOS 12.7.3.
On the Intel Mac: Both make and "make -j8" compile all the files without issue and as expected.
On the Apple M1 Max: When I run make without any flags, it compiles all the files without problem. However, if run "make -j8", I get: make: /opt/homebrew/opt/llvm/bin/clang: Permission denied. If I run "sudo make -j8", then I do not get permission denied.
Why does running make with multiple threads give permission denied on Apple M1 Max but not Intel Macs even though both are running macOS 12.7.3 and both are using the same version of clang (17.0.6)?
I tried changing the owner and permissions on /opt/homebrew/opt/llvm/bin/clang. I tried many different make files (all have the same issue). I tried changing the number of threads. "-j1" works, but "-j2" and higher fail. I was expecting that the using the -j8 on the Apple M1 Max would simply use multiple threads to compile all the files more quickly. Could there be some security feature in the Apple M1 Max chips that prevents users from running multi-threaded jobs in the terminal? My account has admin privileges.
Editor's note: I have moved this from the question into an answer, and marked the answer as Community-owned. OP, if you would rather post this as an answer of your own, leave a comment and ask me to delete this so it won't complete with your own answer.
Using
gmakeprobably entails first installing it from Homebrew or etc.On both systems:
When I switch to
gmake, everything works properly on both machines. So the culprit is Apple's ancientmake. Thanks to John Bolinger and MadScientist for pointing me in the right direction!