Project

General

Profile

Actions

Bug #9993

closed

x86_64 linux + i686 os = 32bit ruby, but `RUBY_PLATFORM=x86_64`

Added by DenKn (Denis Knauf) almost 10 years ago. Updated almost 7 years ago.

Status:
Third Party's Issue
Assignee:
Target version:
-
ruby -v:
2.1.2, 2.2.0dev
Backport:
[ruby-core:63398]

Description

Hi,

On x86_64 Linux Kernel, but i686 OS (there is no 64-binary file anywhere), this will produce a i686-binary ruby, but RUBY_PLATFORM=x86_64-linux:

# ./configure && make
Downloading config.guess...
Downloading config.sub...
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

System type is wrong.

[...]

# ./ruby --disable-all -e 'puts RUBY_PLATFORM'
x86_64-linux
# file ./ruby
ruby: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

This works fine:

# ./configure --with-arch=i686 && make
./configure --with-arch=i686 && make 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

System type is wrong, too, but:

[...]

# ./ruby --disable-all -e 'puts RUBY_PLATFORM'
i686-linux
# file ruby
ruby: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

In config.log i found in both situations this:

uname -m = x86_64

uname -m prints the kernel system type, not the os system type.

It isn't possible to compile a x86_64-binary on this machine, there is no compiler for that. Only for i386.

configure:3795: gcc -v >&5
Using built-in specs.
Target: i486-linux-gnu

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Open to Third Party's Issue

That name comes from autoconf tools.
And your environment can be considered a variant of cross compiling.
config.guess expects the default compiler to make binaries for the current system, so you need to use --host option with prefixed tools.

Updated by hugespider (Clauss Gigantisch) almost 7 years ago

I had similar issue


Environment info:
OS: FreeBSD 10.3 STABLE
rvm:
version: "rvm 1.29.1 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]"
updated: "2 months 9 days 18 hours 28 minutes 46 seconds ago"
path: "/home/spider/.rvm"
autolibs: "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."


ruby:

irb(main):001:0> RUBY_PLATFORM
=> "amd64-freebsd10"

RVM:

2.2.4 :001 > RUBY_PLATFORM
=> "x86_64-freebsd10.3"

First seems to be correct and former to be incorrect.

1st is ruby installed from FreeBSD ports and then I run irb.
2nd is ruby installed using rvm and then I run irb.

Originally submitted at:
https://github.com/rvm/rvm/issues/4037

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0