search

Home  >  Q&A  >  body text

编译 Ruby 时出现 recompile with -fPIC 的错误

今天在编译 Ruby 的时候,在 make 出现了一个错误:

linking shared-object fiddle.so
/usr/bin/ld: ./libffi-3.2.1/.libs/libffi.a(raw_api.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
./libffi-3.2.1/.libs/libffi.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-linux/fiddle.so] Error 1
make[2]: Leaving directory `/home/simowce/ruby-2.2.0/ext/fiddle'
make[1]: *** [ext/fiddle/all] Error 2
make[1]: Leaving directory `/home/simowce/ruby-2.2.0'
make: *** [build-ext] Error 2

我不知道究竟是什么意思。 Ruby 的源码是在 ruby-lang 上下载的,版本是 2.2.0 。请大家帮帮我,谢谢!

PHPzPHPz2774 days ago1069

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-22 09:01:33

    Please install the development package of libffi (such as libffi-dev).

    reply
    0
  • Cancelreply