Skip to content
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

AT_HWCAP2 not always defined #1682

Merged
merged 2 commits into from
Jul 1, 2024
Merged

AT_HWCAP2 not always defined #1682

merged 2 commits into from
Jul 1, 2024

Conversation

justsmth
Copy link
Contributor

@justsmth justsmth commented Jul 1, 2024

Issues:

Addresses: aws/aws-lc-rs#427

Description of changes:

  • Allow fallback when AT_HWCAP2 is not defined (for older glibc).
  AT_HWCAP2 (since glibc 2.18)
         Further machine-dependent hints about processor
         capabilities.

Testing:

  In file included from /cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.18.0/aws-lc/crypto/fipsmodule/bcm.c:81:
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.18.0/aws-lc/crypto/fipsmodule/cpucap/cpu_arm_linux.c: In function 'aws_lc_0_18_0_OPENSSL_cpuid_setup':
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.18.0/aws-lc/crypto/fipsmodule/cpucap/cpu_arm_linux.c:121:38: error: 'AT_HWCAP2' undeclared (first use in this function); did you mean 'AT_HWCAP'?
       unsigned long hwcap2 = getauxval(AT_HWCAP2);
                                        ^~~~~~~~~
                                        AT_HWCAP
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.18.0/aws-lc/crypto/fipsmodule/cpucap/cpu_arm_linux.c:121:38: note: each undeclared identifier is reported only once for each function it appears in
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.18.0/aws-lc/crypto/fipsmodule/bcm.c: At top level:
  cc1: error: unrecognized command line option '-Wno-c11-extensions' [-Werror]
  cc1: all warnings being treated as errors
  ninja: build stopped: subcommand failed.

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.

@justsmth justsmth requested a review from a team as a code owner July 1, 2024 17:44
@justsmth justsmth requested a review from skmcgrail July 1, 2024 17:44
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.25%. Comparing base (ba94617) to head (abe2889).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1682      +/-   ##
==========================================
- Coverage   78.28%   78.25%   -0.04%     
==========================================
  Files         567      567              
  Lines       95237    95237              
  Branches    13671    13671              
==========================================
- Hits        74561    74525      -36     
- Misses      20082    20115      +33     
- Partials      594      597       +3     

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

skmcgrail
skmcgrail previously approved these changes Jul 1, 2024
Copy link
Member

@skmcgrail skmcgrail left a comment

Choose a reason for hiding this comment

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

Just to double check, should we handle this case for other platforms as well if applicable?

@justsmth
Copy link
Contributor Author

justsmth commented Jul 1, 2024

Just to double check, should we handle this case for other platforms as well if applicable?

Good point. I updated the PR to also handle this case for FreeBSD and ppc64le.

@justsmth justsmth merged commit 972832d into aws:main Jul 1, 2024
96 of 99 checks passed
@justsmth justsmth deleted the missing-AT_HWCAP2 branch July 1, 2024 19:50
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.

5 participants