Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running make bin/ivars-count, I get ... Error: execution of command failed with code: 1 ... #1

Open
drhuffman12 opened this issue Jun 17, 2021 · 3 comments

Comments

@drhuffman12
Copy link

I tried running $ make bin/ivars-count and got the below error. What am I missing?

...
llvm_ext.cc:(.text._ZN4llvm9IRBuilderINS_14ConstantFolderENS_24IRBuilderDefaultInserterEE19CreateAtomicCmpXchgEPNS_5ValueES5_S5_NS_14AtomicOrderingES6_h[_ZN4llvm9IRBuilderINS_14ConstantFolderENS_24IRBuilderDefaultInserterEE19CreateAtomicCmpXchgEPNS_5ValueES5_S5_NS_14AtomicOrderingES6_h]+0x7d): undefined reference to `llvm::AtomicCmpXchgInst::AtomicCmpXchgInst(llvm::Value*, llvm::Value*, llvm::Value*, llvm::AtomicOrdering, llvm::AtomicOrdering, unsigned char, llvm::Instruction*)'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o /home/.../crystal-tool-demo/bin/ivars-count  -rdynamic -L/home/.../.asdf/installs/crystal/1.0.0/bin/../lib/crystal/lib -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` /home/.../.asdf/installs/crystal/1.0.0/share/crystal/src/llvm/ext/llvm_ext.o `"/usr/bin/llvm-config-11" --libs --system-libs --ldflags 2> /dev/null` -lstdc++ -lpcre -lm -lgc -lpthread /home/.../.asdf/installs/crystal/1.0.0/share/crystal/src/ext/libcrystal.a -L/home/linuxbrew/.linuxbrew/Cellar/libevent/2.1.12/lib -levent -lrt -ldl`
make: *** [Makefile:28: bin/ivars-count] Error 1

I have:

  • Crystal 1.0.0 via asdf:
$ crystal -v
Crystal 1.0.0 [dd40a2442] (2021-03-22)

LLVM: 10.0.0
Default target: x86_64-unknown-linux-gnu
$ asdf info
OS:
Linux drh-desktop 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ASDF VERSION:
v0.8.0-c6145d0

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/.../.asdf

ASDF INSTALLED PLUGINS:
crystal                      https://github.com/asdf-community/asdf-crystal.git
ruby                         https://github.com/asdf-vm/asdf-ruby.git
  • llvm 10:
$ /usr/bin/llvm-config --version
10.0.0
  • /usr/bin in my path
$ echo $PATH
...:/usr/bin:...
  • Linux Mint 20.1
$ cat /etc/issue
Linux Mint 20.1 Ulyssa \n \l
@bcardiff
Copy link
Owner

@drhuffman12 have you ever been able to build the compiler from source in that environment?

From the error seems more related to building the compiler directly rather than an issue in the repo.

@drhuffman12
Copy link
Author

@bcardiff , I don't think I've tried building Crystal from source on this system. I'll try the link you sent. Thanks. 😄

@drhuffman12
Copy link
Author

drhuffman12 commented Jun 18, 2021

@bcardiff , I am using LLVM 10. I tried the steps in https://crystal-lang.org/install/from_sources/. Maybe I missed a step along the way? Do I need to revert to LLVM 8 noted in the doc's?

(a) Does the CRYSTAL_PATH env variable need to be set? I wasn't sure if CRYSTAL_PATH env variable does not contains ... was supposed to be warning or an error.

(b) So, I continued w/out setting it; and got the errors noted below. I then tried setting it to the path that it said it didn't contain (but should contain?); and I got the same error. (It kinda sounds like It passed std_spec but not compiler_spec as #9957. as noted in crystal-lang/crystal#6957 (comment), but I'm not sure the error is the same or not. Also, I think that issue is about Windows but I'm running on Linux Mint.)

(c) Also, I think there is a typo in CRYSTAL_PATH env variable does not contains .... I think the singular/plural forms of variable and contains should be in sync; or, change variable to variable(s) and contains to contain(s) and call it done. Is there an issue for this; I'm not finding one?

See below...


Working my way thru the steps noted in https://crystal-lang.org/install/from_sources/, when I got to the step make std_spec compiler_spec, it looks like std_spec finished successfully (trimmed for shortness):

$ make std_spec compiler_spec
Using /usr/bin/llvm-config-11 [version=11.0.0]
CC="cc -fuse-ld=lld" ./bin/crystal build  --exclude-warnings spec/std --exclude-warnings spec/compiler -o .build/std_spec spec/std_spec.cr
Using compiled compiler at .build/crystal
.build/std_spec 
0.2.2
...
Pending:
  Math Functions for computing quotient and remainder
  Number #round edge cases
  Path #expand converts a pathname to an absolute pathname, using a complete path assert
  Spec matchers pending block is not compiled pending has block with valid syntax, but invalid semantics
  URI .parse unescaped @ in user/password should not confuse host
  JSON::PullParser read? returns nil in place of Float32 when an overflow occurs
  OpenSSL::SSL::Context ciphers uses intermediate default ciphers
  TCPServer settings
  UDPSocket #connect with a IPv6 address

Finished in 1:18 minutes
10727 examples, 0 failures, 0 errors, 9 pending

... but the compiler_spec part seemed to crash (trimmed for shortness):

...
CC="cc -fuse-ld=lld" CRYSTAL_CONFIG_LIBRARY_PATH="/home/.../.asdf/installs/crystal/1.0.0/bin/../lib/crystal/lib" CRYSTAL_CONFIG_BUILD_COMMIT="c490f1843" SOURCE_DATE_EPOCH="1623971195" ./bin/crystal build  --exclude-warnings spec/std --exclude-warnings spec/compiler -o .build/compiler_spec spec/compiler_spec.cr
Using compiled compiler at .build/crystal
Using compiled compiler at .build/crystal
.build/compiler_spec 
...CRYSTAL_PATH env variable does not contains /home/.../crystal/src
Using compiled compiler at .build/crystal
...
Invalid memory access (signal 11) at address 0x7f3938bc6a96
[0x55a16aeb13c6] *Exception::CallStack::print_backtrace:(Int32 | Nil) +118
[0x55a16ac6d2ea] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +330
Segmentation fault (core dumped)
make: *** [Makefile:89: compiler_spec] Error 139

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

No branches or pull requests

2 participants