Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

How to build perl-5.32.0 (or later) with ivsize of 4 on Ubuntu-20.04 ?

by syphilis (Bishop)
on Jan 07, 2021 at 05:52 UTC ( #11126502=perlquestion: print w/replies, xml ) Need Help??

syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Is it even possible to do such a thing by simply passing the "right" options to Configure ?
I thought about using the -m32 switch, but gcc doesn't like that on my Ubuntu-20.04 system.

Cheers,
Rob
  • Comment on How to build perl-5.32.0 (or later) with ivsize of 4 on Ubuntu-20.04 ?
  • Download Code

Replies are listed 'Best First'.
Re: How to build perl-5.32.0 (or later) with ivsize of 4 on Ubuntu-20.04 ?
by bliako (Prior) on Jan 07, 2021 at 06:18 UTC

    I can speculate about gcc not liking -m32: you are missing gcc's 32-bit dependencies. But I am not sure if this is the way to go for your main problem.

    bw, bliako

      you are missing gcc's 32-bit dependencies

      Yes - and I'm not really interested in building such a perl if I need additional downloads to do it.

      I've implemented USE_QUADMATH capability on Windows. There's nothing public yet, but I should be in a position to submit a PR in the next couple of days.
      I've been testing all of the various nvtype/ivtype permutations with 32-bit and 64-bit compilers, and they're all fine .... except for one.
      On Windows, with a 32-bit gcc, I can build blead with ivsize=4 and nvtype=__float128 - and it's failing a few Math::BigInt/BigFloat tests.
      There's no problem with any of the other available nvtype/ivtype permutations - it's just this one (very rare) configuration that's being a bit of a nuisance.

      I suspect it's a Math::BigInt/BigFloat bug, but it could also be a bug in my amendments to the perl source.
      For reference, it would be nice to see how a __float128 build with an ivsize of 4, fares on Ubuntu.
      The 2 systems I have that do permit the -m32 switch don't provide libquadmath.

      Cheers,
      Rob
        I suspect it's a Math::BigInt/BigFloat bug

        My suspicion was correct.
        I dug into it a bit, and came up with this Math::BigInt PR, though I don't know if that's the optimal fix.
        As mentioned in that PR, I subsequently noticed that there did already exist other builds of perl where ivsize=4 and nvtype was __float128, and that they were also striking the same Math::BigInt test failures as I was seeing.
        (For example, https://www.cpantesters.org/cpan/report/2737c762-6c8c-1014-a5db-5bbf06c191b3 )

        There has been no response to that PR yet. I'll file an Issue against perl5 itself if there has been no response to it by the end of next week.

        Cheers,
        Rob
Re: How to build perl-5.32.0 (or later) with ivsize of 4 on Ubuntu-20.04 ?
by salva (Canon) on Jan 16, 2021 at 16:03 UTC
    IIRC, IVs must be big enough to hold a pointer, so it is not possible to compile Perl with 32 bit IVs on a 64 bit platform.
      IIRC, IVs must be big enough to hold a pointer

      I've compiled perl with 32 bit IVs on 64-bit Windows 7, Debian Wheezy(ppc64), and freebsd-12.0.
      But yes, ptrsize then needs to be 4 bytes, and I assume there must also be some mechanism ensuring that addresses of all allocated memory fit into 4 bytes.

      I suspect that, with the right toolchain, I could also achieve such a build on Ubuntu, but I'm not going to chase that up right now.
      I was hoping that there might have been some simple trick I could use - hence my initial question.

      On the freebsd system, the 32-bit build was achieved by simply passing -Dcc="cc -m32" to Configure.
      When I build perl on the Debian system, I (strangely) get 32-bit builds by default, though the system perl is 64-bit. So I pass -Dcc="gcc -m64" to Configure in order to get the 64-bit builds there.
      On Windows, it's just a case of using a 32-bit toolchain and ensuring that the WIN64=undef arg is provided to make.

      Cheers,
      Rob

      Yes, Which is why they were using -m32 to build a 32-bit binary.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11126502]
Approved by GrandFather
Front-paged by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2021-01-22 01:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?