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

Unable to load lib_c on hosts with triple without libc #12593

Closed
GeopJr opened this issue Oct 11, 2022 · 0 comments · Fixed by #12594
Closed

Unable to load lib_c on hosts with triple without libc #12593

GeopJr opened this issue Oct 11, 2022 · 0 comments · Fixed by #12594

Comments

@GeopJr
Copy link
Contributor

GeopJr commented Oct 11, 2022

Bug Report

Some triples miss the libc part of the environment.
Examples:

  • x86_64-suse-linux
  • x86_64-redhat-linux
  • more

This creates two issues:

  1. CrystalPath#add_target_path can't load lib_c as x86_64-linux doesn't match any.
  2. Codegen::Target#gnu? & Codegen::Target#musl? are both false.

Reproduction

  1. Host is one of the above mentioned examples.
  2. $ make all
  3. $ make compiler_spec
In src/exception/call_stack/libunwind.cr:1:1

 1 | require "c/dlfcn"
     ^
Error: can't find file 'c/dlfcn'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?
make: *** [Makefile:180: .build/compiler_spec] Error 1

Crystal

Using compiled compiler at .build/crystal
Crystal 1.6.1-dev [809c49e] (2022-10-11)

LLVM: 14.0.6
Default target: x86_64-suse-linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants