Backport #7864

lib/mkmf.rb: $(topdir) included in VPATH cause build error

Added by Takahiro Kambe over 2 years ago. Updated over 2 years ago.

[ruby-dev:46998]
Status:Closed
Priority:Immediate
Assignee:Akinori MUSHA

Description

での問題は、Ruby 2.0.0-rc2やtrunkでも再現しました。

% sh configure --enable-shared
% make
...
compiling complex.c
linking shared-object mathn/complex.so
gcc: complex.o: No such file or directory
*** Error code 1

環境は以下のようになります。(GNU makeではありません。)

% uname -rsmp
NetBSD 6.0_STABLE amd64 x86_64

原因は、ext/mathn/complexに生成されたMakefileのVPATHに、

VPATH = $(srcdir):$(topdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby

と、$(topdir)が含まれている関係か、ここで実行したMakefileは、

  1. トップディレクトリにcomplex.oを作成(既にあるcomplex.oを上書き)
  2. complex.soのリンク時はext/mathn/complex/complex.oがなくて失敗

となっています。

VPATHに$(topdir)は、r37933による修正で含められるようになっています。

mkmf.rb: each_compile_rules

  • lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(VPATH) for each VPATH elements.

このログの説明で、何故$(topdir)を含めるようになったかは理解できません。
添付のパッチでr37933の一部を戻すとbuild可能となります。

この修正は Ruby 2.0.0 に反映していただきたいと思います。

mkmf.rb-diff (456 Bytes) Takahiro Kambe, 02/16/2013 08:49 PM

Associated revisions

Revision 39290
Added by Nobuyoshi Nakada over 2 years ago

mkmf.rb: remove extra topdir in VPATH

  • lib/mkmf.rb: remove extra topdir in VPATH, which was in win32/Makefile.sub for some reason and moved from there. [Bug #7864]

Revision 39420
Added by Akinori MUSHA over 2 years ago

merge revision(s) r39290:

* lib/mkmf.rb: remove extra topdir in VPATH, which was in
  win32/Makefile.sub for some reason and moved from there.
   [Bug #7864]

History

#1 Updated by Yusuke Endoh over 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

なかださん、どうでしょうか。

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Nobuyoshi Nakada over 2 years ago

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

This issue was solved with changeset r39290.
Takahiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


mkmf.rb: remove extra topdir in VPATH

  • lib/mkmf.rb: remove extra topdir in VPATH, which was in win32/Makefile.sub for some reason and moved from there. [Bug #7864]

#3 Updated by Akinori MUSHA over 2 years ago

  • Assignee changed from Nobuyoshi Nakada to Yusuke Endoh
  • Priority changed from High to Immediate
  • Target version deleted (2.0.0)
  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Category deleted (build)
  • Status changed from Closed to Assigned

#4 Updated by Yusuke Endoh over 2 years ago

  • Assignee changed from Yusuke Endoh to Akinori MUSHA

バックポート OK です。(多分)
これも作業をお願いできませんでしょうか > knu さん

Yusuke Endoh mame@tsg.ne.jp

#5 Updated by Akinori MUSHA over 2 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39420.
Takahiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) r39290:

* lib/mkmf.rb: remove extra topdir in VPATH, which was in
  win32/Makefile.sub for some reason and moved from there.
   [Bug #7864]

Also available in: Atom PDF