Skip to content

fix: bump pqclean submodule to fix aarch64-musl build (#98)#100

Merged
thomwiggers merged 1 commit into
rustpq:mainfrom
pabl0ramirez:fix/bump-pqclean-compat-musl
Jun 4, 2026
Merged

fix: bump pqclean submodule to fix aarch64-musl build (#98)#100
thomwiggers merged 1 commit into
rustpq:mainfrom
pabl0ramirez:fix/bump-pqclean-compat-musl

Conversation

@pabl0ramirez

Copy link
Copy Markdown
Contributor

Problem

Building for aarch64-unknown-linux-musl fails in pqclean/common/compat.h:

pqclean/common/compat.h:20:21: error: missing binary operator before token "("
 #  if !__GNUC_PREREQ(7, 1)

__GNUC_PREREQ is a glibc macro (from <features.h>); musl libc does not define it, so under musl the #if !__GNUC_PREREQ(7, 1) is a preprocessor syntax error. (Reported in #98.)

Root cause

This is already fixed upstream in PQClean: commit 36708db"Embed __GNUC_PREREQ macro as some toolchains lack features.h" — replaces the __GNUC_PREREQ use with an explicit, musl-safe __GNUC_MINOR__ comparison.

The pqclean submodule here is pinned at d746637, which is exactly one commit before that fix.

Change

Bump the pqclean submodule d74663736708db. The delta between those two commits touches only common/compat.h — no implementation, API, header-API, or crypto changes — so this pulls in PQClean's own portability fix and nothing else.

Verification

  • Confirmed the new submodule compat.h uses the musl-safe form: #if defined __GNUC_MINOR__ && ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((7) << 16) + (1)).
  • Reproduced the exact #98 preprocessor error with the old macro form and confirmed the new form compiles cleanly, and is a no-op under glibc (where the macro is already defined).
  • git diff is a single Subproject commit line change.

Fixes #98.

aarch64-unknown-linux-musl fails in pqclean/common/compat.h:20 on
`#if !__GNUC_PREREQ(7, 1)` because musl's <features.h> does not define
glibc's __GNUC_PREREQ macro.

This is already fixed upstream: PQClean 36708db ("Embed __GNUC_PREREQ
macro as some toolchains lack features.h") replaces it with an explicit,
musl-safe __GNUC_MINOR__ comparison. The submodule was pinned at d746637,
exactly one commit before that fix. The d746637..36708db delta is
compat.h-only (no implementation/API/crypto changes).

Fixes rustpq#98.
@thomwiggers thomwiggers enabled auto-merge (rebase) June 4, 2026 08:06
@thomwiggers thomwiggers merged commit a63b4bc into rustpq:main Jun 4, 2026
10 checks passed
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.

Compile error with aarch64-unknown-linux-musl

2 participants