Project

General

Profile

Bug #10960

libffiのビルドの不具合?

Added by ciel (T Yamada) about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
-
[ruby-dev:<unknown>]

Description

本当に不具合なのか判断できないため、Miscに投げます。
ruby-2.2.1/ext/fiddle/libffi-3.2.1/Makefileの、
CCASFLAGS,CFLAGS,CXXFLAGSに-fPICを(無理やり)追加することでビルドが通ります。
https://bugs.ruby-lang.org/issues/10954 で「パッケージシステムにlibffiがあるならそちらでインストールしてください」との返答を頂きましたが、レンタルサーバーが制限ユーザーのため、パッケージシステムは使用することができません。
細かい仕様が変わって2.2.2では何の問題もなしにビルドできたりするんだろうかとも思っております。。

以下、エラーメッセージです。

make 'AR_FLAGS='  'CC_FOR_BUILD='  'CFLAGS=-O3 -fno-fast-math -ggdb3  -Wall -fexceptions'  'CXXFLAGS=-O3 -fno-fast-math -ggdb3'  'CFLAGS_FOR_BUILD='  'CFLAGS_FOR_TARGET='  'INSTALL=/usr/bin/install -c'  'INSTALL_DATA=/usr/bin/install -c -m 644'  'INSTALL_PROGRAM=/usr/bin/install -c'  'INSTALL_SCRIPT=/usr/bin/install -c'  'JC1FLAGS='  'LDFLAGS=-L. -fstack-protector -rdynamic  -L../../..'  'LIBCFLAGS='  'LIBCFLAGS_FOR_TARGET='  'MAKE=make'  'MAKEINFO=/bin/sh /home/park50/ruby22-work/ruby-2.2.1/ext/fiddle/libffi-3.2.1/missing makeinfo '  'PICFLAG='  'PICFLAG_FOR_TARGET='  'RUNTESTFLAGS='  'SHELL=/bin/sh'  'exec_prefix=/usr/local'  'infodir=/usr/local/share/info'  'libdir=/usr/local/lib'  'mandir=/usr/local/share/man'  'prefix=/usr/local'  'AR=ar'  'AS=as'  'CC=gcc'  'CXX=g++'  'LD=ld'  'NM=/usr/bin/nm -B'  'RANLIB=ranlib'  'DESTDIR=' all-recursive
Making all in include
Making all in testsuite
Making all in man
  CC       src/prep_cif.lo
  CC       src/types.lo
  CC       src/raw_api.lo
  CC       src/java_raw_api.lo
  CC       src/closures.lo
  CC       src/x86/ffi64.lo
  CPPAS    src/x86/unix64.lo
  CC       src/x86/ffi.lo
  CPPAS    src/x86/sysv.lo
  CCLD     libffi_convenience.la
  CCLD     libffi.la
linking shared-object fiddle.so
/usr/bin/ld: ./libffi-3.2.1/.libs/libffi.a(prep_cif.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
./libffi-3.2.1/.libs/libffi.a: could not read symbols: Bad value
*** [../../.ext/x86_64-freebsd9.1/fiddle.so] Error code 1

Stop in /home/xxx/ruby22-work/ruby-2.2.1/ext/fiddle.
*** [ext/fiddle/all] Error code 1

Stop in /home/xxx/ruby22-work/ruby-2.2.1.
*** [build-ext] Error code 1

Stop in /home/xxx/ruby22-work/ruby-2.2.1.

mkmf.log View (21.9 KB) ciel (T Yamada), 03/11/2015 06:42 AM

Associated revisions

Revision 49957
Added by nobu (Nobuyoshi Nakada) about 2 years ago

libff: fix enable-shared condition

  • ext/fiddle/extconf.rb: needs --enable-shared when linked to libruby or fiddle.so. since --with-static-linked-ext does no longer link extensions to ruby program with --enable-shared, the only combination needs --enable-static is --disable-shared and --with-static-linked-ext. [Bug #10960]

Revision 49957
Added by nobu (Nobuyoshi Nakada) about 2 years ago

libff: fix enable-shared condition

  • ext/fiddle/extconf.rb: needs --enable-shared when linked to libruby or fiddle.so. since --with-static-linked-ext does no longer link extensions to ruby program with --enable-shared, the only combination needs --enable-static is --disable-shared and --with-static-linked-ext. [Bug #10960]

Revision 49957
Added by nobu (Nobuyoshi Nakada) about 2 years ago

libff: fix enable-shared condition

  • ext/fiddle/extconf.rb: needs --enable-shared when linked to libruby or fiddle.so. since --with-static-linked-ext does no longer link extensions to ruby program with --enable-shared, the only combination needs --enable-static is --disable-shared and --with-static-linked-ext. [Bug #10960]

Revision 50272
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) 49007,49009,49957: [Backport #10960]

* ext/fiddle/extconf.rb: make PIC objects if it will be linked as
  a shared object eventually.  

* ext/fiddle/extconf.rb: needs --enable-shared when linked to
  libruby or fiddle.so.  since --with-static-linked-ext does no
  longer link extensions to ruby program with --enable-shared, the
  only combination needs --enable-static is --disable-shared and
  --with-static-linked-ext.   [Bug #10960]

History

#1 Updated by ciel (T Yamada) about 2 years ago

環境を書き忘れていました。FreeBSD 9.1です。(10954と同環境)

#2 Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

ext/fiddle/mkmf.log を見せてください。

#3 Updated by ciel (T Yamada) about 2 years ago

添付します。宜しくお願い申し上げます。

#4 Updated by usa (Usaku NAKAMURA) about 2 years ago

  • ruby -v set to -
  • Tracker changed from Misc to Bug
  • Status changed from Feedback to Open
  • Backport set to 2.1: DONTNEED, 2.2: REQUIRED

トラッカー移動します。
いろいろご配慮してくださったのだとは思いますが、不具合かどうかの最終判断はどうせ我々がするので、不具合の可能性があったら気にせずBugに突っ込んでください。
Bug以外のトラッカーには後の処理に必要な情報が欠けているので困ったりするのです。

てゆか、Miscって何に使うためにあるんだろう?

#5 Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r49957.


libff: fix enable-shared condition

  • ext/fiddle/extconf.rb: needs --enable-shared when linked to libruby or fiddle.so. since --with-static-linked-ext does no longer link extensions to ruby program with --enable-shared, the only combination needs --enable-static is --disable-shared and --with-static-linked-ext. [Bug #10960]

#6 Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Backport changed from 2.1: DONTNEED, 2.2: REQUIRED to 2.1: DONTNEED, 2.2: DONE

r49007, r49009 and r49957 were backported into ruby_2_2 branch at r50272.

#7 Updated by ciel (T Yamada) almost 2 years ago

こちらの不具合については2.2.2で修正されていることを確認しました。ありがとうございました。

Also available in: Atom PDF