Skip to content

Configure: make sure pointers fit in IVs #23275

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

khwilliamson
Copy link
Contributor

See #18995

  • This set of changes does not require a perldelta entry.

See Perl#18995

This commit just adds a simple test that IV is large enough to hold a
pointer; something we claim is true, but didn't actually guarantee.
@khwilliamson khwilliamson requested a review from Tux May 12, 2025 21:17
@tonycoz
Copy link
Contributor

tonycoz commented May 13, 2025

Looks reasonable to me.

(watching ./Configure ... -Divsize='_BitInt(128)' fail)

@jkeenan
Copy link
Contributor

jkeenan commented May 13, 2025

See #18995

* This set of changes does not require a perldelta entry.

I don't think that references to a GH ticket are appropriate for the first line of a commit message. The first line should say what the commit does. The purpose or benefit of the commit should be explained in the body of the message. References to GH issues or other resources should go toward the end of the commit message.

@jkeenan
Copy link
Contributor

jkeenan commented May 13, 2025 via email

@bulk88
Copy link
Contributor

bulk88 commented May 13, 2025

This change maybe is incompatible with Linux Intel X32 perl builds, if Linux's Intel x32 arch was ever tested or supported by p5p. someone needs to confirm.

@khwilliamson
Copy link
Contributor Author

I believe Perl expects to be able to store a pointer in an IV, so that things wouldn't work anyway. I just Configured using the 32 bit emulation ability of gcc, and it worked fine. config.h shows 4 bytes for each value.

Copy link
Contributor

@Leont Leont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK the existing logic always gets this right, but it can never harm to double check.

@khwilliamson khwilliamson merged commit 9e9b2f9 into Perl:blead May 13, 2025
34 checks passed
@khwilliamson khwilliamson deleted the Configure_IV_big_as_ptr branch May 13, 2025 21:14
@tonycoz
Copy link
Contributor

tonycoz commented May 13, 2025

This change maybe is incompatible with Linux Intel X32 perl builds, if Linux's Intel x32 arch was ever tested or supported by p5p. someone needs to confirm.

x32 has 32-bit pointers and 32-bit ints, so there's no compatibility problem vs x32

I just Configured using the 32 bit emulation ability of gcc, and it worked fine. config.h shows 4 bytes for each value.

x32 is different to what you get from i386/-m32, it takes advantage of the x86_64 architectural improvements (more registers, IP relative addressing, etc) while keeping pointers at 32-bits to save memory (consider how much of the data perl keeps is pointers)

@Tux
Copy link
Contributor

Tux commented May 14, 2025

Backported as Perl/metaconfig@9769383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants