Beef icon indicating copy to clipboard operation
Beef copied to clipboard

Can't build on macOS Catalina

Open pikatos opened this issue 6 years ago • 13 comments

bin/build.sh give me:

beef/Beef/IDEHelper/../extern/llvm-project_8_0_0/llvm/include/llvm/IR/Attributes.h:74:14: fatal error:
      'llvm/IR/Attributes.inc' file not found
    #include "llvm/IR/Attributes.inc"
             ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.```

pikatos avatar Apr 24 '20 23:04 pikatos

Same issue here, but different error. 2019 MacBook Pro, Catalina (10.15.4). It initially failed at first but re-running it caused it to download LLVM and then started compiling. 2 hours later it failed, but with a different error from the other person. Ran it again just for kicks.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/username/beeflang/Beef/jbuild
[  5%] Built target hunspell
[ 75%] Built target BeefySysLib
[ 93%] Built target IDEHelper
[ 94%] Built target BeefBoot
[100%] Built target BeefRT
Building BeefBuild_bootd
[******************************]
TIMING: Beef compiling: 16.2s
Linking BeefBuild_bootd...Undefined symbols for architecture x86_64:
  "_ffi_call", referenced from:
      bf::System::FFI::FFILIB::Call(bf::System::FFI::FFILIB::FFICIF*, void*, void*, void**) in libBeefRT_d.a(Internal.cpp.o)
  "_ffi_closure_alloc", referenced from:
      bf::System::FFI::FFILIB::ClosureAlloc(long, void**) in libBeefRT_d.a(Internal.cpp.o)
  "_ffi_prep_cif", referenced from:
      bf::System::FFI::FFILIB::PrepCif(bf::System::FFI::FFILIB::FFICIF*, bf::System::FFI::FFIABI, int, bf::System::FFI::FFIType*, bf::System::FFI::FFIType**) in libBeefRT_d.a(Internal.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL: Exit code returned: 1

FAILED

CavemanIke avatar Apr 25 '20 17:04 CavemanIke

Beef/jbuild_d/Debug/bin/build/BeefBuild_bootd/vdata.o) was built for newer OSX version (10.14) than being linked (10.12)

nanjizal avatar Apr 26 '20 12:04 nanjizal

Ah yes, the default LLVM target triple is 'x86_64-apple-macosx10.14.0'. Not sure what the right default should be.

bfiete avatar Apr 26 '20 12:04 bfiete

I pulled it back to OS X 10.8 Mountain Lion (2012). Will make configurable later. https://github.com/beefytech/Beef/commit/3df7af3f44e9b4035f4fbbcefd700b7ed782552d, will be in 0.42.3.

bfiete avatar Apr 26 '20 13:04 bfiete

I've tried with 3df7af3. Now it fails with the same error mentioned above by @ByteSizeOtter.

pikatos avatar Apr 26 '20 21:04 pikatos

Same issue here, but different error. 2019 MacBook Pro, Catalina (10.15.4). It initially failed at first but re-running it caused it to download LLVM and then started compiling. 2 hours later it failed, but with a different error from the other person. Ran it again just for kicks.

Strangely, I'm getting almost the same behavior on Mojave.

tsal avatar Apr 29 '20 13:04 tsal

"_ffi_prep_cif", referenced from: bf::System::FFI::FFILIB::PrepCif(bf::System::FFI::FFILIB::FFICIF*, bf::System::FFI::FFIABI, int, bf::System::FFI::FFIType*, bf::System::FFI::FFIType**) in libBeefRT_d.a(Internal.cpp.o) ld: symbol(s) not found for architecture x86_64

This is the issue I'm seeing on a macPro with Catalina 10.15.3

dylanmc avatar May 01 '20 15:05 dylanmc

I'm seeing the same thing on Mac OS X Mojave 10.14.6. Including some more details to help with troubleshooting.

Building BeefBuild_bootd
[******************************]
TIMING: Beef compiling: 28.8s
Linking BeefBuild_bootd...Undefined symbols for architecture x86_64:
  "_ffi_call", referenced from:
      bf::System::FFI::FFILIB::Call(bf::System::FFI::FFILIB::FFICIF*, void*, void*, void**) in libBeefRT_d.a(Internal.cpp.o)
  "_ffi_closure_alloc", referenced from:
      bf::System::FFI::FFILIB::ClosureAlloc(long, void**) in libBeefRT_d.a(Internal.cpp.o)
  "_ffi_prep_cif", referenced from:
      bf::System::FFI::FFILIB::PrepCif(bf::System::FFI::FFILIB::FFICIF*, bf::System::FFI::FFIABI, int, bf::System::FFI::FFIType*, bf::System::FFI::FFIType**) in libBeefRT_d.a(Internal.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL: Exit code returned: 1

Output from clang --version: Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Full uname -a output: Darwin mymachine 18.7.0 Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64 x86_64

maleldil avatar May 02 '20 03:05 maleldil

I'm getting a different error when building BeefBuild_bootd on MacOS 10.15.4

Building BeefBuild_bootd
[******************************]
TIMING: Beef compiling: 41.8s
ERROR: Method 'ToAnsi' does not exist in type 'System.ConsoleColor' at line 207:38 in ~/Developer/Beef/BeefLibs/corlib/src/Console.bf
   Write("\x1B[{}m", ForegroundColor.ToAnsi());
                                     ^^^^^^
ERROR: Method 'ToAnsi' does not exist in type 'System.ConsoleColor' at line 208:38 in ~/Developer/Beef/BeefLibs/corlib/src/Console.bf
   Write("\x1B[{}m", BackgroundColor.ToAnsi() + 10);
                                     ^^^^^^
Errors: 2.
FAILED

peng90 avatar May 07 '20 22:05 peng90

That was a temporary issue, fixed at https://github.com/beefytech/Beef/commit/0b73451502e8c0d70d11874515d393be06d43ae7#diff-784620eb6e5a7c286d6397c5bf267943

bfiete avatar May 07 '20 23:05 bfiete

This is still an issue. Even with all the latest changes it still fails to build on macOS Catalina with this error: Linking BeefBuild_bootd...Undefined symbols for architecture x86_64: "_ffi_call", referenced from: bf::System::FFI::FFILIB::Call(bf::System::FFI::FFILIB::FFICIF*, void*, void*, void**) in libBeefRT_d.a(Internal.cpp.o) "_ffi_closure_alloc", referenced from: bf::System::FFI::FFILIB::ClosureAlloc(long, void**) in libBeefRT_d.a(Internal.cpp.o) "_ffi_prep_cif", referenced from: bf::System::FFI::FFILIB::PrepCif(bf::System::FFI::FFILIB::FFICIF*, bf::System::FFI::FFIABI, int, bf::System::FFI::FFIType*, bf::System::FFI::FFIType**) in libBeefRT_d.a(Internal.cpp.o) ld: symbol(s) not found for architecture x86_64

patgarner avatar May 12 '20 10:05 patgarner

I meant the '.ToAnsi()' issue was temporary. This FFI linking issue has not been addressed in general. Note that this does compile and link properly on my own macOS system. I may have done a 'make install' in the libffi directory. At any rate, this is still an open bug.

bfiete avatar May 12 '20 12:05 bfiete

Fair enough.

I still haven't gotten it completely building, but I have made progress. For me, running make install in the libffi directory didn't change the build output or fix the linking error. However, manually adding the libffi.a path to each build step did fix it for each build step that I could find the right place to add it.

At last attempt, I am stuck when it gets to the "Compiling for testing..." part of "Testing IDEHelper/Tests in BeefBuild_d". It is unclear to me what I should modify at that step in order to manually add the path to libffi.a. So at the moment attempting to build fails with the same linking error there.

patgarner avatar May 14 '20 16:05 patgarner