Skip to content

Export real_kind_bytes as public to fix dlsym visibility on GCC 16.2 - #29

Merged
nichollsh merged 2 commits into
mainfrom
hn/fix-real-kind-bytes-visibility
Sep 6, 2026
Merged

nichollsh merged 2 commits into
mainfrom
hn/fix-real-kind-bytes-visibility

Conversation

@nichollsh

Copy link
Copy Markdown
Member

real_kind_bytes (bind(C) as PS_real_kind_bytes) sat in UTILITIES_CF, a module that is private by default, and was never added to the module's public :: list like its sibling C-interop functions. GCC 16.2.0 has a regression (PR126872) where a PRIVATE module procedure bound to C is given hidden ELF visibility even though a binding label gives it external linkage, so dlsym() can no longer find it. This broke the Julia wrapper's precision probe on macOS CI.

Making the export explicitly public sidesteps the compiler bug regardless of GCC version, matching the existing public C-interop functions in this module.

Bump version to 2603.9.

nichollsh and others added 2 commits September 6, 2026 11:21
real_kind_bytes (bind(C) as PS_real_kind_bytes) sat in UTILITIES_CF,
a module that is private by default, and was never added to the
module's public :: list like its sibling C-interop functions. GCC
16.2.0 has a regression (PR126872) where a PRIVATE module procedure
bound to C is given hidden ELF visibility even though a binding
label gives it external linkage, so dlsym() can no longer find it.
This broke the Julia wrapper's precision probe on macOS CI.

Making the export explicitly public sidesteps the compiler bug
regardless of GCC version, matching the existing public C-interop
functions in this module.

Bump version to 2603.9.
@nichollsh
nichollsh merged commit 43b86d4 into main Sep 6, 2026
1 check passed
egpbos added a commit that referenced this pull request Sep 8, 2026
GCC 16.2.0 (PR126872) gives a PRIVATE module procedure bound to C hidden
ELF visibility even though its binding label gives it external linkage,
so dlsym() can no longer find it. #29 fixed real_kind_bytes in
UTILITIES_CF, the first symbol the Julia wrapper resolves, but the same
bare PRIVATE remains in two other places and hides the other 125 entry
points, so the failure moves one step later instead of going away.

GenFortranWrappers.jl writes PRIVATE into every module it generates,
hiding 108 symbols across the 24 generated wrappers, PS_create_StrDim
among them. SOCRATES_C.f90 carries its own bare PRIVATE, hiding the 20
radiative transfer entry points including PS_radiance_calc and
PS_read_spectrum. Both kinds of module exist only to expose their
bind(C) procedures, so PUBLIC is the appropriate default.

Built with GCC 16.2.0 on macOS arm64: libSOCRATES_C.so exports all 128
PS_ symbols with none left local, where main exports 3 of 128.
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.

1 participant