Forum: Ruby-core [ruby-trunk - Feature #7532][Open] Hardcoded compiler location

Posted by Michal Papis (mpapis)
on 2012-12-07 09:59
(Received via mailing list)
Issue #7532 has been reported by mpapis (Michal Papis).

----------------------------------------
Feature #7532: Hardcoded compiler location
https://bugs.ruby-lang.org/issues/7532

Author: mpapis (Michal Papis)
Status: Open
Priority: Low
Assignee:
Category:
Target version:


Currently RbConfig::CONFIG["CC"] is hardcoded during compilation, this 
is an issue when compiling ruby that can be run on other machines, ruby 
used for compilation might be not available on target system.

A good example is Apple OSX, there are multiple ways to get gcc-4.2 for 
it - considering https://bugs.ruby-lang.org/issues/5883 GNU GCC is 
preferred over LLVM clang.

So assuming ruby is compiled on machine A with /usr/bin/gcc4.2 - and 
moved to machine B with /opt/local/bin/gcc - which both are the same 
version "i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 
5666) (dot 3)" - just compiled in different paths. Compiling gems with 
native extensions would fail in that case because of the recorded 
compiler path.

Please consider changing the line in rbconfig.rb to: CONFIG["CC"] = 
ENV["CC"] || "..."

It will allow changing compiler after moving ruby. As 
'--enable-load-relative' is a prerequisite for moving rubies it could be 
also used as a switch for adding that change as I can understand there 
might be a need for preserving compiler used for building ruby so the 
same is used for building gems.

This trick is used by default in MagLev http://maglev.github.com/
Posted by Michal Papis (mpapis)
on 2012-12-08 10:00
(Received via mailing list)
Issue #7532 has been updated by mpapis (Michal Papis).


here is patch that archives this: 
https://github.com/tokaido/tokaido-build/blob/mast... 
- it does not include the check for   '--enable-load-relative', but in 
the project in question it should be added always.
----------------------------------------
Feature #7532: Hardcoded compiler location
https://bugs.ruby-lang.org/issues/7532#change-34538

Author: mpapis (Michal Papis)
Status: Open
Priority: Low
Assignee:
Category:
Target version:


Currently RbConfig::CONFIG["CC"] is hardcoded during compilation, this 
is an issue when compiling ruby that can be run on other machines, ruby 
used for compilation might be not available on target system.

A good example is Apple OSX, there are multiple ways to get gcc-4.2 for 
it - considering https://bugs.ruby-lang.org/issues/5883 GNU GCC is 
preferred over LLVM clang.

So assuming ruby is compiled on machine A with /usr/bin/gcc4.2 - and 
moved to machine B with /opt/local/bin/gcc - which both are the same 
version "i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 
5666) (dot 3)" - just compiled in different paths. Compiling gems with 
native extensions would fail in that case because of the recorded 
compiler path.

Please consider changing the line in rbconfig.rb to: CONFIG["CC"] = 
ENV["CC"] || "..."

It will allow changing compiler after moving ruby. As 
'--enable-load-relative' is a prerequisite for moving rubies it could be 
also used as a switch for adding that change as I can understand there 
might be a need for preserving compiler used for building ruby so the 
same is used for building gems.

This trick is used by default in MagLev http://maglev.github.com/
Posted by mame (Yusuke Endoh) (Guest)
on 2012-12-09 13:14
(Received via mailing list)
Issue #7532 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to nobu (Nobuyoshi Nakada)
Target version set to next minor


----------------------------------------
Feature #7532: Hardcoded compiler location
https://bugs.ruby-lang.org/issues/7532#change-34555

Author: mpapis (Michal Papis)
Status: Assigned
Priority: Low
Assignee: nobu (Nobuyoshi Nakada)
Category:
Target version: next minor


Currently RbConfig::CONFIG["CC"] is hardcoded during compilation, this 
is an issue when compiling ruby that can be run on other machines, ruby 
used for compilation might be not available on target system.

A good example is Apple OSX, there are multiple ways to get gcc-4.2 for 
it - considering https://bugs.ruby-lang.org/issues/5883 GNU GCC is 
preferred over LLVM clang.

So assuming ruby is compiled on machine A with /usr/bin/gcc4.2 - and 
moved to machine B with /opt/local/bin/gcc - which both are the same 
version "i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 
5666) (dot 3)" - just compiled in different paths. Compiling gems with 
native extensions would fail in that case because of the recorded 
compiler path.

Please consider changing the line in rbconfig.rb to: CONFIG["CC"] = 
ENV["CC"] || "..."

It will allow changing compiler after moving ruby. As 
'--enable-load-relative' is a prerequisite for moving rubies it could be 
also used as a switch for adding that change as I can understand there 
might be a need for preserving compiler used for building ruby so the 
same is used for building gems.

This trick is used by default in MagLev http://maglev.github.com/
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.