executorch
executorch copied to clipboard
Llama example build failure on MacOS
When building the llama_main target on MacOS, build fails with the following error:
[100%] Linking CXX executable llama_main
ld: warning: -s is obsolete
ld: unknown options: --gc-sections
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [llama_main] Error 1
make[1]: *** [CMakeFiles/llama_main.dir/all] Error 2
In the top-level CMakeLists.txt, the --gc-sections flag is conditionally excluded when building for apple (https://github.com/GregoryComer/executorch/blob/c69861ddcee5705d37e7d47e2cccdeac741c71e8/CMakeLists.txt#L510). We may just need to do the same thing in the Llama example?
cc @cccclai - i also encountered this problem on my macbook pro laptop
are there any solutions or workarounds for this? I am also getting this error when building for Mac
Fixed in https://github.com/pytorch/executorch/pull/4473