Skip to content

Set CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY for any target in mbedtls-sys build script #384

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

Conversation

Pagten
Copy link
Collaborator

@Pagten Pagten commented Mar 28, 2025

Before this PR, the CMAKE_TRY_COMPILE_TARGET_TYPE cmake define was only set to STATIC_LIBRARY for arm targets or when the RUST_MBED_C_COMPILER_BAREMETAL env var is set to 1, but this define should always be set like that because we're always building a static library.

The incentive for making this change is that it improves compatibility with non-standard build systems such as Bazel.

Copy link

Benchmark for 8333297

Click to view benchmark
Test Base PR %
Cipher/AES CBC decrypt 306.9±14.11ns 298.4±13.68ns -2.77%
Cipher/AES CBC encrypt 222.4±9.37ns 227.3±12.27ns +2.20%
Cipher/AES CCM decrypt 391.3±11.53ns 404.7±12.90ns +3.42%
Cipher/AES CCM encrypt 372.5±18.91ns 368.3±18.05ns -1.13%
Cipher/AES GCM decrypt 670.5±30.97ns 589.3±16.51ns -12.11%
Cipher/AES GCM encrypt 572.6±22.41ns 658.7±21.82ns +15.04%
Cipher/AES KW decrypt 691.2±17.70ns 713.1±16.36ns +3.17%
Cipher/AES KW encrypt 624.4±18.49ns 623.5±13.82ns -0.14%
Cipher/AES KWP decrypt 701.9±16.79ns 723.7±17.16ns +3.11%
Cipher/AES KWP encrypt 632.9±15.93ns 652.1±15.64ns +3.03%

Copy link
Collaborator

@Taowyoo Taowyoo left a comment

Choose a reason for hiding this comment

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

v0.1.0 version of traitobject is conflicting with latest nightly. Need to upgrade it to 0.1.1 to solve it.

Created PR to fix it: #386, please review , merge it and rebase your PR.

@Pagten Pagten force-pushed the pieagt/mbedtls-sys-always-set-cmake-try-compile-target-type branch from bcdeb93 to 7dc9b0b Compare April 1, 2025 13:18
Copy link

github-actions bot commented Apr 1, 2025

Benchmark for 21a2880

Click to view benchmark
Test Base PR %
Cipher/AES CBC decrypt 300.4±12.18ns 297.3±14.57ns -1.03%
Cipher/AES CBC encrypt 224.1±8.79ns 220.9±8.65ns -1.43%
Cipher/AES CCM decrypt 392.2±11.45ns 407.1±10.25ns +3.80%
Cipher/AES CCM encrypt 370.3±14.39ns 373.0±13.21ns +0.73%
Cipher/AES GCM decrypt 576.5±16.63ns 666.5±20.07ns +15.61%
Cipher/AES GCM encrypt 645.7±12.02ns 572.1±15.60ns -11.40%
Cipher/AES KW decrypt 669.3±17.33ns 682.4±29.23ns +1.96%
Cipher/AES KW encrypt 613.5±15.74ns 613.0±11.23ns -0.08%
Cipher/AES KWP decrypt 695.4±19.23ns 696.9±22.07ns +0.22%
Cipher/AES KWP encrypt 634.1±15.35ns 622.6±13.44ns -1.81%

@Pagten Pagten force-pushed the pieagt/mbedtls-sys-always-set-cmake-try-compile-target-type branch from 7dc9b0b to 166ad04 Compare April 1, 2025 20:44
@Taowyoo Taowyoo force-pushed the pieagt/mbedtls-sys-always-set-cmake-try-compile-target-type branch from 166ad04 to a1efcda Compare April 11, 2025 15:34
Copy link

Benchmark for 0bd5199

Click to view benchmark
Test Base PR %
Cipher/AES CBC decrypt 314.4±10.09ns 303.4±14.57ns -3.50%
Cipher/AES CBC encrypt 222.8±5.15ns 223.6±8.43ns +0.36%
Cipher/AES CCM decrypt 416.5±10.43ns 410.9±14.06ns -1.34%
Cipher/AES CCM encrypt 376.2±17.53ns 368.1±22.34ns -2.15%
Cipher/AES GCM decrypt 571.8±14.37ns 598.7±18.28ns +4.70%
Cipher/AES GCM encrypt 644.7±16.81ns 676.3±18.84ns +4.90%
Cipher/AES KW decrypt 656.7±12.69ns 657.6±13.13ns +0.14%
Cipher/AES KW encrypt 596.3±13.21ns 597.7±14.97ns +0.23%
Cipher/AES KWP decrypt 681.9±17.71ns 684.3±16.86ns +0.35%
Cipher/AES KWP encrypt 606.4±36.79ns 619.3±17.60ns +2.13%

@Pagten Pagten merged commit abe21cb into master Apr 22, 2025
11 checks passed
@Pagten Pagten deleted the pieagt/mbedtls-sys-always-set-cmake-try-compile-target-type branch April 22, 2025 13:21
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