Project

General

Profile

Actions

Bug #18507

open

Incorrect target_os detection in configure script

Added by rcl (Andrew Kosteltsev) about 2 years ago. Updated about 2 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:107231]

Description

configure.ac incorrectly detect target_os by target triplet such as arm-unknown-linux-gnueabihf. In case arm-unknown-linux-gnueabihf suffix we have incorrect ruby arch = 'arm-linux-eabihf' instead of 'arm-linux'.

configure.ac: 246:
target_os=echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'

should be changed to:
target_os=echo $target_os | sed 's/linux-gnu[[^ ]]*$/linux/;s/linux-gnu/linux-/'

and correspondently configure: 7619:
target_os=echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'

should be changed to:
target_os=echo $target_os | sed 's/linux-gnu[^ ]*$/linux/;s/linux-gnu/linux-/'


Files

ruby-3.1.0-configure-target-os.patch (983 Bytes) ruby-3.1.0-configure-target-os.patch This patch fixes this issue rcl (Andrew Kosteltsev), 01/21/2022 03:18 PM

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

It seems like intentional, as there is the second substitution.
Is arm-linux-eabihf incorrect?

Updated by rcl (Andrew Kosteltsev) about 2 years ago

In case 'arm-unknown-linux-gnueabihf' GNU Autotools recognizes target_os as 'linux-gnueabihf' (and 'linux-gnu' if 'arm-unknown-linux-gnu'). But ruby has own function for getting target_os during configuration process. I think there are no resons to set up ruby for both architectures (arm with soft fp engine and arm with hard fp) on one machine. If it is true then we can define target_os as 'linux' without any suffix.

If you want to set up ruby for several arch at the same time then you can stay with 'linux-eabihf'. However, this will create problems for distributors due to the disagreement in determining the target_os by GNU Autotools and determining the target_os by configure script from RUBY.

Any case the 'linux-eabihf' is not correct name for target_os.

Actions

Also available in: Atom PDF

Like0
Like0Like0