FS#48407 - [crystal] Cannot build or run crystal code
Attached to Project:
Community Packages
Opened by Stephanie Wilde-Hobbs (RX14) - Wednesday, 02 March 2016, 20:56 GMT
Last edited by Anatol Pomozov (anatolik) - Friday, 04 March 2016, 20:39 GMT
Opened by Stephanie Wilde-Hobbs (RX14) - Wednesday, 02 March 2016, 20:56 GMT
Last edited by Anatol Pomozov (anatolik) - Friday, 04 March 2016, 20:39 GMT
|
Details
Description:
When using any of crystal's compile or run functions, I get the following error: /usr/bin/ld: /usr/lib/crystal/ext/libcrystal.a(sigfault.o): relocation R_X86_64_32S against `sigfault_handler' can not be used when making a shared object; recompile with -fPIC /usr/lib/crystal/ext/libcrystal.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status Error: execution of command failed with code: 1: `cc -o "fast_irc" "${@}" -rdynamic /usr/lib/crystal/ext/libcrystal.a -levent -lrt -lpcre -lgc -lpthread -ldl` Additional info: Crystal package 0.12.0-1 Steps to reproduce: $ touch empty.cr $ crystal empty.cr |
This task depends upon
Closed by Anatol Pomozov (anatolik)
Friday, 04 March 2016, 20:39 GMT
Reason for closing: Fixed
Additional comments about closing: 0.12.0-2
Friday, 04 March 2016, 20:39 GMT
Reason for closing: Fixed
Additional comments about closing: 0.12.0-2
$ sudo pacman -S crystal
$ touch empty.cr
$ crystal empty.cr
empty.cr
$ crystal build empty.cr
$ ls
empty empty.cr
$ ./empty
$ sudo pacman -S crystal hardening-wrapper
[Get a new login shell]
$ touch empty.cr
$ crystal empty.cr
/usr/bin/ld: /usr/lib/crystal/ext/libcrystal.a(sigfault.o): relocation R_X86_64_32S against `sigfault_handler' can not be used when making a shared object; recompile with -fPIC
[...]
$ export PATH="$(echo "$PATH" | tr -s ':' '\n' | grep -v "hardening-wrapper" | tr -s '\n' ':')"
$ crystal empty.cr
$
I fixed this upstream by compiling libcrystal.a with -fPIC: https://github.com/crystal-lang/crystal/commit/c73d9322a6dca580bacfaf58070391317294af43