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

[BUG] Regression: undefined reference to `dladdr' #7289

Open
straight-shoota opened this Issue Jan 9, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@straight-shoota
Copy link
Member

straight-shoota commented Jan 9, 2019

Builds for several shards are failing with current nightly build (Crystal 0.27.1-dev [530b91345] (2019-01-09)). Looks like a codegen bug.

The error message with shards and crinja goes like this:

/usr/bin/crystal spec
_main.o: In function `*Exception+@Exception#inspect_with_backtrace<IO::FileDescriptor>:IO::FileDescriptor':
main_module:(.text+0x7a8e): undefined reference to `dladdr'
_main.o: In function `*CallStack::decode_frame<Pointer(Void), Pointer(Void)>:(Tuple(Int64, Pointer(UInt8)) | Nil)':
main_module:(.text+0x16c53): undefined reference to `dladdr'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/root/.cache/crystal/usr-share-crystal-src-ecr-process.cr/macro_run'  -rdynamic  -lpcre -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -L/usr/lib -L/usr/local/lib`

sass.cr has a different error, but it's most likely related, given that it pops up in the same nightly release:

crystal spec
/usr/bin/ld: C-allS-tack.o: undefined reference to symbol 'dladdr@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/root/.cache/crystal/crystal-run-spec.tmp'  -rdynamic  -lsass -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -L/usr/lib -L/usr/local/lib`
Exited with code 1

The only PR merged since yesterday's nightly build is #7282

/cc @RX14

@RX14

This comment has been minimized.

Copy link
Member

RX14 commented Jan 9, 2019

Nah, it doesn't seem to be picking up the @[Link("dl")]. dladdr exists, just there's no -ldl on the linker commandline. I'm not sure why... Since the travis builds for crystal itself passed, and it built on my laptop.

@ysbaddaden

This comment has been minimized.

Copy link
Member

ysbaddaden commented Jan 10, 2019

I built crystal from master and could build and test shards locally (ubuntu 14.04). Sounds like the nightly built compiler is faulty —compiled on arch-linux-musl but running on arch-linux-gnu is maybe a hint?

@danielwestendorf

This comment has been minimized.

Copy link
Contributor

danielwestendorf commented Jan 10, 2019

I'm seeing this too with my nightly cron builds on travis https://travis-ci.org/danielwestendorf/message_verifier.cr/builds

@bcardiff bcardiff added this to the 0.27.1 milestone Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment