briansmith / ring

Safe, fast, small crypto using Rust
Other
3.74k stars 704 forks source link

CI: Add code coverage mesurement for powerpc-unknown-linux-gnu. #1877

Closed briansmith closed 6 months ago

briansmith commented 10 months ago

Profiler builtins were added in https://github.com/rust-lang/rust/pull/119404.

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.81%. Comparing base (f69e502) to head (69c22b1). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1877 +/- ## ========================================== + Coverage 96.27% 96.81% +0.53% ========================================== Files 143 143 Lines 20430 20436 +6 Branches 226 226 ========================================== + Hits 19669 19785 +116 + Misses 727 617 -110 Partials 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

briansmith commented 10 months ago

CI reports the following errors due to undefined symbol __atomic_fetch_add_8:

@ecnelises, do you have any ideas? It seems like we maybe need to change the Rust toolchain to add -latomic to the command line when building with profiler builtins, based on https://github.com/PurpleI2P/i2pd/issues/285#issuecomment-228343740 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81283? Or maybe otherwise implement the profiler builtins in a different way that doesn't require __atomic_fetch_add_8?

  = note: /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: bss-plt forced due to /home/runner/work/ring/ring/target/powerpc-unknown-linux-gnu/debug/deps/ring-b2bcec301c9e8d00.101za323lune3mo6.rcgu.o
          /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /home/runner/work/ring/ring/target/powerpc-unknown-linux-gnu/debug/deps/ring-b2bcec301c9e8d00.101za323lune3mo6.rcgu.o: in function `<ring::aead::chacha::Key>::new':
          /home/runner/work/ring/ring/src/aead/chacha.rs:40: undefined reference to `__atomic_fetch_add_8'
          /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /home/runner/work/ring/ring/target/powerpc-unknown-linux-gnu/debug/deps/ring-b2bcec301c9e8d00.101za323lune3mo6.rcgu.o: in function `<ring::aead::chacha::Key>::encrypt_in_place':
          /home/runner/work/ring/ring/src/aead/chacha.rs:48: undefined reference to `__atomic_fetch_add_8'
          /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /home/runner/work/ring/ring/target/powerpc-unknown-linux-gnu/debug/deps/ring-b2bcec301c9e8d00.101za323lune3mo6.rcgu.o: in function `<ring::aead::chacha::Key>::encrypt_iv_xor_in_place':
          /home/runner/work/ring/ring/src/aead/chacha.rs:55: undefined reference to `__atomic_fetch_add_8'
          /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /home/runner/work/ring/ring/src/aead/chacha.rs:55: undefined reference to `__atomic_fetch_add_8'
          /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /home/runner/work/ring/ring/src/aead/chacha.rs:55: undefined reference to `__atomic_fetch_add_8'
          /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /home/runner/work/ring/ring/target/powerpc-unknown-linux-gnu/debug/deps/ring-b2bcec301c9e8d00.101za323lune3mo6.rcgu.o:/home/runner/work/ring/ring/src/aead/chacha.rs:78: more undefined references to `__atomic_fetch_add_8' follow
briansmith commented 10 months ago

See also https://github.com/rust-lang/rust/issues/69689#issuecomment-594437916 for another potential avenue to explore.

briansmith commented 10 months ago

See https://github.com/rust-lang/rust/issues/112313#issuecomment-1874849765

briansmith commented 6 months ago

I have now implemented a workaround to get this to link, and Codecov.io reports that now the 32-bit specific AES and GCM code is now covered.