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

Run assembler in CI to catch issues #96

Open
torben-hansen opened this issue Nov 21, 2023 · 4 comments
Open

Run assembler in CI to catch issues #96

torben-hansen opened this issue Nov 21, 2023 · 4 comments

Comments

@torben-hansen
Copy link
Contributor

torben-hansen commented Nov 21, 2023

This typo #95 should be caught by some CI test. Run an assembler, or similar(?). Or just verify that all files ensure that it's not used in an executable stack.

@aqjune-aws
Copy link
Collaborator

aqjune-aws commented Nov 21, 2023

Hi, which assembler are you using? It is because as in DevDesktop doesn't seem to raise any warning or error about the typo.

aarch64 (23-11-21 21:12:21) <0> [~/s2n-bignum-ci/arm]
dev-dsk-lebjuney-1d-d3fc5ff7 % cat curve25519/bignum_madd_n25519.S | cc -E -I../include  -xassembler-with-cpp - | tr ';' '\n' >a.S

aarch64 (23-11-21 21:12:36) <0> [~/s2n-bignum-ci/arm]
dev-dsk-lebjuney-1d-d3fc5ff7 % tail -5 a.S
        ldp x19, x20, [sp], 16
        ret


.section .note.GNU-stacz,"",%progbits

aarch64 (23-11-21 21:12:40) <0> [~/s2n-bignum-ci/arm]
dev-dsk-lebjuney-1d-d3fc5ff7 % as -o a.o a.S

aarch64 (23-11-21 21:12:48) <0> [~/s2n-bignum-ci/arm]
dev-dsk-lebjuney-1d-d3fc5ff7 % as --version
GNU assembler version 2.29.1-31.amzn2
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `aarch64-redhat-linux'.

@aqjune-aws
Copy link
Collaborator

The first command strips away C-style comments and processes include directives. The second command shows that stacz is still there, and then the third command (as) is compiling the assembly without warnings.

@aqjune-aws
Copy link
Collaborator

To record, the error message appeared when building the FIPS version of AWS-LC.

[393/584] Building ASM object crypto/fipsmodule/CMakeFiles/bcm_hashunset.dir/bcm-delocated.S.o                                                  
/home/ec2-user/humble/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519_alt.S: Assembler messages:                                
/home/ec2-user/humble/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519_alt.S:318: Warning: ignoring incorrect section type for .n
ote.GNU-stacz                                                                                                                                   
/home/ec2-user/humble/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519_alt.S:318: Warning: ignoring changed section type for .not
e.GNU-stacz  
$ as --version
GNU assembler version 2.39-6.amzn2023.0.10

The error message could not be reproduced on my side, but this check seems helpful indeed.

@aqjune-aws
Copy link
Collaborator

We should add Windows CI too.

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

No branches or pull requests

2 participants