-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perl misdetects architecture on FreeBSD #19791
Comments
|
basically it says |
On FreeBSD C<uname -m> produces "powerpc" for all of 32-bit power pc, 32-powerpc little endian, 64-bit powerpc and 64-bit powerpc little endian, which means we produce the same archname for all 4 of those incompatible architectures. To avoid that, if no -Darchname has been supplied, the FreeBSD hints now creates an archname.cbu to postprocess archname replacing a leading "`uname -m`-" with "`uname -p`-" which does distinguish between the different architectures. This change isn't suitable for all non-FreeBSD systems, on Linux at least, C<uname -p> is "unknown" on my x86_64 machine. Fixes Perl#19791
|
In order to evaluate Tony's p.r. on this, I'm trying to wrap my head around the original complaint here. Is the misdetection found solely on Here, for example, is output from the FreeBSD machine I use every day: Is there any thing wrong with that? |
|
On arm it seems like it is ok: |
|
It looks ok, because you check on arm64. On The situation is worse in POWER / RISC-V land. It's similar with RISC-V. It's not an issue on amd64 and i386, because |
If you can supply a better PR that provides better results I'm more than happy to drop this one. I don't have ready access to FreeBSD on anything but an amd64 VM, and the painfully slow powerpc emulation. |
On FreeBSD C<uname -m> produces "powerpc" for all of 32-bit power pc, 32-powerpc little endian, 64-bit powerpc and 64-bit powerpc little endian, which means we produce the same archname for all 4 of those incompatible architectures. To avoid that, if no -Darchname has been supplied, the FreeBSD hints now creates an archname.cbu to postprocess archname replacing a leading "`uname -m`-" with "`uname -p`-" which does distinguish between the different architectures. This change isn't suitable for all non-FreeBSD systems, on Linux at least, C<uname -p> is "unknown" on my x86_64 machine. Fixes #19791
|
Re-opening and self-assigning for the purpose of monitoring for a week or two. |
Re-closing as per schedule. |
On FreeBSD C<uname -m> produces "powerpc" for all of 32-bit power pc, 32-powerpc little endian, 64-bit powerpc and 64-bit powerpc little endian, which means we produce the same archname for all 4 of those incompatible architectures. To avoid that, if no -Darchname has been supplied, the FreeBSD hints now creates an archname.cbu to postprocess archname replacing a leading "`uname -m`-" with "`uname -p`-" which does distinguish between the different architectures. This change isn't suitable for all non-FreeBSD systems, on Linux at least, C<uname -p> is "unknown" on my x86_64 machine. Fixes Perl#19791
Module:
POSIX
Description
POSIX.xs at https://github.com/Perl/perl5/blob/blead/ext/POSIX/POSIX.xs#L3350= uses uname(3) for detecting architecture on FreeBSD. However,
uname -mwill print "powerpc" on all powerpc architectures (powerpc, powerpcspe, powerpc64 and powerpc64le), "riscv" on riscv architectures (riscv64, riscv64sf) and "arm" on 32-bit arm (armv6, armv7). Forunamebinary,-pswitch is available that will print a correct name, but it's name available inunameC function.This is in particular wrong on 64-bit architectures, since bitness is misdetected.
Steps to Reproduce
The above is on powerpc64 host.
Expected behavior
The correct way would be to use sysctl hw.machine_arch output, like this:
Perl configuration
The text was updated successfully, but these errors were encountered: