aardappel / lobster

The Lobster Programming Language
http://strlen.com/lobster
2.27k stars 120 forks source link

Issue compiling Arm64 on M2 #305

Closed DeanHnter closed 6 months ago

DeanHnter commented 7 months ago

Hi,

Following the guide on https://aardappel.github.io/lobster/implementation.html i find if i try to compile using the command-line I receive the following error when on macos, M2 Sonoma Arm64

The command:

xcodebuild -toolchain clang -configuration Release -target lobster

Output:

ld: warning: ignoring file '/opt/homebrew/Cellar/llvm/17.0.5/lib/libunwind.1.0.dylib': found architecture 'arm64', required architecture 'x86_64'
ld: Undefined symbols:
  __Unwind_Resume, referenced from:
      flatbuffers::GenTextFile(flatbuffers::Parser const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in idl_gen_text.o
      flatbuffers::GenTextFile(flatbuffers::Parser const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in idl_gen_text.o
      flatbuffers::TextFileName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in idl_gen_text.o
      void flatbuffers::JsonPrinter::PrintScalar<unsigned char>(unsigned char, flatbuffers::Type const&, int) in idl_gen_text.o
      std::__1::__throw_length_error[abi:v160006](char const*) in idl_gen_text.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> flatbuffers::NumToString<int>(int) in idl_gen_text.o
      std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_stringstream[abi:v160006]() in idl_gen_text.o
      ...
clang: error: linker command failed with exit code 1 (use -v to see invocation)
aardappel commented 7 months ago

It seems to try to link the x86 version of libunwind even though you are on arm.. We don't refer to libunwind directly, so I am not sure where this is coming from..

DeanHnter commented 6 months ago

This seems to have been an issue on my local machine only for some reason, on the CI it works fine so I will close this issue.