Skip to content

fix: correct LEAN_EXPORT attribute order in ffi.cpp - #14888

Open
joehendrix wants to merge 1 commit into
leanprover:masterfrom
joehendrix:ffi
Open

fix: correct LEAN_EXPORT attribute order in ffi.cpp#14888
joehendrix wants to merge 1 commit into
leanprover:masterfrom
joehendrix:ffi

Conversation

@joehendrix

@joehendrix joehendrix commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

This PR fixes attribute/extern "C" ordering affecting builds with some versions of gcc.

Specifically, gcc ignores LEAN_EXPORT visibility attribute placed before extern "C", so these getters were not exported from libleanshared.

This change was drafted with AI assistance. I confirmed that reordering to extern "C" LEAN_EXPORT fixes on GCC 11, 13 and 15.

GCC ignores a visibility attribute placed before `extern "C"`, so these FFI
getters were not exported from libleanshared under GCC.

We confirmed that reordering to `extern "C" LEAN_EXPORT` fixes on GCC 11,
13 and 15.
@joehendrix
joehendrix marked this pull request as draft August 21, 2026 17:41
@joehendrix
joehendrix marked this pull request as ready for review August 21, 2026 17:43
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Aug 21, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase f6c7d68c7fc27e3b60585f30740c7d141d3c5b36 --onto 16e77c407779fde9a649adf3478204d1915371a3. You can force Mathlib CI using the force-mathlib-ci label. (2026-08-21 18:04:53)

@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase f6c7d68c7fc27e3b60585f30740c7d141d3c5b36 --onto 16e77c407779fde9a649adf3478204d1915371a3. You can force reference manual CI using the force-manual-ci label. (2026-08-21 18:04:55)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants