Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Neovim build fails when building LuaJIT #127

Closed
marrs opened this issue Jan 19, 2016 · 5 comments
Closed

Neovim build fails when building LuaJIT #127

marrs opened this issue Jan 19, 2016 · 5 comments

Comments

@marrs
Copy link

marrs commented Jan 19, 2016

This appears to be related to #94 but the author of that issue closed it without providing a solution. I'm trying to run brew install neovim or brew install neovim/neovim/neovim and get the following error

Last 15 lines from /Users/dmarrs/Library/Logs/Homebrew/neovim/02.make:
  "__Unwind_GetCFA", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_RaiseException", referenced from:
      _lj_err_throw in libluajit.a(lj_err.o)
  "__Unwind_SetGR", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_SetIP", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [luajit] Error 1
make[3]: *** [src/luajit] Error 2
make[2]: *** [build/src/luajit-stamp/luajit-install] Error 2
make[1]: *** [CMakeFiles/luajit.dir/all] Error 2
make: *** [all] Error 2
@marrs
Copy link
Author

marrs commented Jan 19, 2016

As advised in a comment in #94 I've checked the troubleshooting guide but I don't see any checks in there that help me resolve the situation.

  • Running brew info neovim, I see a From line that matches the one expeceted.
  • I don't encounter any errors relating to brew, such as failed to update tap
  • I definitely have XCode installed
  • My installed versions of XCode and XCode CLT are both at 7.2.

I reran the command using the --verbose switch and I got the following output:

CC        luajit.o
/usr/local/Library/ENV/4.3/clang -g -O2 -fomit-frame-pointer -Wall  -fPIC -DLUAJIT_DISABLE_JIT -DLUA_USE_APICHECK -DLUA_USE_ASSERT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U_FORTIFY_SOURCE  -DLUA_ROOT=\"/tmp/neovim20160119-36927-16pdb8r/neovim-0.1.1/deps-build/usr\" -DLUA_MULTILIB=\"lib\" -fno-stack-protector   -c -o luajit.o luajit.c
BUILDVM   jit/vmdef.lua
host/buildvm -m vmdef -o jit/vmdef.lua lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
LINK      luajit
/usr/local/Library/ENV/4.3/clang -g   -pagezero_size 10000 -image_base 100000000   -o luajit luajit.o libluajit.a -lm  
Undefined symbols for architecture x86_64:
  "__Unwind_DeleteException", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_GetCFA", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_RaiseException", referenced from:
      _lj_err_throw in libluajit.a(lj_err.o)
  "__Unwind_SetGR", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_SetIP", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [luajit] Error 1
make[3]: *** [src/luajit] Error 2
make[2]: *** [build/src/luajit-stamp/luajit-install] Error 2
make[1]: *** [CMakeFiles/luajit.dir/all] Error 2
make: *** [all] Error 2

So it looks like the issue is at the linking stage. A missing dependency, I guess.

The command that appears to fail is /usr/local/Library/ENV/4.3/clang -g -pagezero_size 10000 -image_base 100000000 -o luajit luajit.o libluajit.a -lm

I don't know what the -lm switch at the end of the command means. I can't find any documentation for -l or -lm (I searched the output of clang -cc1 --help).

On the next line it fails. I can only guess that luajit.o or libluajit.a have not been built against an x86_64 CPU for some reason.

@justinmk
Copy link
Member

AFAIR -lm is an old thing, not related to your issue: http://stackoverflow.com/a/10372309/152142

A reinstall of CL tools, and/or an upgrade of Xcode, fixed similar issues #95 and #51 for many people. Basically this issue has come up dozens of times and it always ends up being solved by beating OSX over the head.

Identical issue, recent, unresolved: #114

Building from source (git instead of homebrew) should work, at least.

It may be time for us to revisit neovim/bot-ci#52 . I never had the time to really investigate it. If @xu-cheng has the energy to update that PR I will find the time to see it through.

@marrs
Copy link
Author

marrs commented Jan 20, 2016

Tried reinstalling the cl tools but it didn't fix anything. I also tried running sudo xcode-select --reset in case the dev directory had been changed, but still no luck.

The only thing left to try is to reinstall Xcode, which I can't really do at the moment as I don't have the time to install the gargantuan app and resolve any issues that might be incurred afterwards.

So sadly I'm going to leave it there. Thanks for helping me trouble shoot. I might have a go at building from source when I get a free afternoon.

In any case, I should take the opportunity to congratulate the Neovim team on some fantastic work so far. I did spend some time with it before I tried to reinstall and I was very impressed with it. The performance improvement alone will be worth the switch when a stable GUI version is released.

@marrs marrs closed this as completed Jan 20, 2016
@justinmk
Copy link
Member

I might have a go at building from source when I get a free afternoon.

git clone followed by make should enough. If it takes an afternoon then we really failed :/

@schultz9999
Copy link

See this problem today. Will try to install thru git clone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants