Skip to content

Gate Linux specific code to fix compilation on AIX#3265

Merged
justsmth merged 3 commits into
aws:mainfrom
pgimalac:pgimalac/fix-linux-include-guards
May 26, 2026
Merged

Gate Linux specific code to fix compilation on AIX#3265
justsmth merged 3 commits into
aws:mainfrom
pgimalac:pgimalac/fix-linux-include-guards

Conversation

@pgimalac

@pgimalac pgimalac commented May 22, 2026

Copy link
Copy Markdown
Contributor

Issues:

None, but I can open one if needed.

I'm trying to build a Rust binary which depends on the aws-lc-sys crate on IBM AIX (a Unix OS), this PR gates linux-specific symbols to fix compiler errors.

Description of changes:

  • Guard getrandom logic with OPENSSL_LINUX (on top of OPENSSL_RAND_URANDOM), I believe this logic is only reachable on Linux
  • Guard RNDGETENTCNT with OPENSSL_LINUX as the symbol is defined in linux/random.h

Call-outs:

I'm aware AIX is not a supported platform, but the changes required to make it compile are minimal, and I think it makes the code technically more correct. Let me know what you think.

Testing:

Ran tests locally, built the library on an AIX host.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@pgimalac pgimalac marked this pull request as ready for review May 22, 2026 09:12
@pgimalac pgimalac requested a review from a team as a code owner May 22, 2026 09:12
@pgimalac pgimalac changed the title Gate Linux specific code with OPENSSL_LINUX Gate Linux specific code to fix compilation on AIX May 22, 2026
Comment thread crypto/rand_extra/urandom.c Outdated
justsmth
justsmth previously approved these changes May 22, 2026
@codecov-commenter

codecov-commenter commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.10%. Comparing base (cf95ba0) to head (8d8ecff).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3265      +/-   ##
==========================================
- Coverage   78.28%   78.10%   -0.19%     
==========================================
  Files         689      689              
  Lines      123463   123460       -3     
  Branches    17200    17196       -4     
==========================================
- Hits        96659    96429     -230     
- Misses      25881    26110     +229     
+ Partials      923      921       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread crypto/rand_extra/urandom.c Outdated
@torben-hansen

Copy link
Copy Markdown
Contributor

If IBM AIX could just get getentropy such as IBM z/OS does it, that would be great.

@pgimalac

Copy link
Copy Markdown
Contributor Author

@torben-hansen agreed 😄

Thanks for the reviews !

@justsmth justsmth merged commit de73c3a into aws:main May 26, 2026
471 of 489 checks passed
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.

4 participants