Skip to content

Build fails with aws-lc-sys 0.38.0 due to jitterentropy CFLAGS conflict #90

@rpodgorny

Description

@rpodgorny

Summary

Building vykar 0.12.12 fails when the environment injects CFLAGS with -O2 (e.g. Arch Linux makepkg). The jitterentropy-base.c file in aws-lc-sys requires -O0, but the system -O2 flag appears last on the compiler command line and overrides it, triggering:

#error "The CPU Jitter random number generator must not be compiled with optimizations."

Root Cause

This is a known upstream bug in aws-lc-sys v0.38.0, fixed in aws/aws-lc-rs#1064. The cc crate changed its env-var caching behavior, causing the build script's temporary CFLAGS override to no longer work.

Fix

The fix shipped in aws-lc-rs v1.16.2 / aws-lc-sys v0.39.0. Vykar 0.12.12 currently pins aws-lc-rs v1.16.1 / aws-lc-sys v0.38.0 — just one patch version behind.

Updating Cargo.lock to pull in aws-lc-sys >= 0.39.0 should resolve the issue.

Workaround

Setting AWS_LC_SYS_NO_JITTER_ENTROPY=1 before building skips jitterentropy compilation entirely and avoids the conflict.

Reproduction

Build on Arch Linux (or any distro whose build system injects -O2 into CFLAGS):

makepkg -s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions