gfapi: drop the phantom symbols from gfapi.map and the public header, fix the glfs_mknodat label - #4813
Draft
ThalesBarretto wants to merge 3 commits into
Draft
gfapi: drop the phantom symbols from gfapi.map and the public header, fix the glfs_mknodat label#4813ThalesBarretto wants to merge 3 commits into
ThalesBarretto wants to merge 3 commits into
Conversation
glfs_caller_specific_init() has been declared in the public header glfs-handles.h since 4a28b4c ("gfapi: object handle based API extensions", 2013), listed in gfapi.map under GFAPI_3.5.0 since f709dad and in gfapi.aliases since d4359ea, but it has never had a definition anywhere in the tree. No libgfapi.so has ever exported it. The effect is a compile-time trap for consumers (the header offers a function that cannot be linked) and a version-script entry naming a symbol the linker never sees. GNU ld and gold drop such an entry silently; lld, where --no-undefined-version has been the default since LLD 16, rejects the libgfapi link with "version script assignment of 'GFAPI_3.5.0' to symbol 'glfs_caller_specific_init' failed: symbol not defined". Remove the declaration, the map entry and the Darwin alias. Nothing can depend on a symbol that never existed in any build. Updates: gluster#4811 Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com>
…pi.aliases 06fada2 ("gfapi/handleops: Introducing glfs_xreaddirplus_r() fop for handleops") implemented the two accessors as glfs_xreaddirplus_get_stat() and glfs_xreaddirplus_get_object(), but recorded them in gfapi.map and gfapi.aliases under the earlier design names glfs_xreaddirplus_r_get_stat and glfs_xreaddirplus_r_get_object. The implemented pair is exported through its .symver directive regardless (a .symver takes precedence over the version script), so the mismatch never affected consumers; nfs-ganesha uses both. The map and the aliases simply name two symbols that do not exist while omitting the two that do. GNU ld and gold ignore the dangling entries; lld (>= 16) fails the link on them. Rename the entries to the shipped names so that the GFAPI_3.11.0 node lists exactly what libgfapi exports. The exported symbol set does not change. Updates: gluster#4811 Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com>
glfs_mknodat() is declared with GFAPI_PUBLIC(glfs_mknod, 11.0), a copy-paste of the preceding glfs_mknod() declaration. On Linux the macro expands to nothing, so the export (glfs_mknodat@@GFAPI_11.0, from the .symver in glfs-fops.c) has always been correct. On Darwin the macro is live and emits an __asm alias, so the typo produces a second, wrong alias for glfs_mknod. Label the declaration with its own name. Fixes: gluster#4811 Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com>
ThalesBarretto
marked this pull request as draft
September 22, 2026 10:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gfapi: drop the phantom symbols from gfapi.map and the public header, fix the glfs_mknodat label
gfapi.mapandgfapi.aliasesname three symbols that libgfapi has never defined:glfs_caller_specific_init(declared in the public header since 2013, never implemented) and
glfs_xreaddirplus_r_get_stat/glfs_xreaddirplus_r_get_object(the design names of two accessors that were implemented and exported asglfs_xreaddirplus_get_stat/glfs_xreaddirplus_get_object). GNU ld and gold drop such entries silently; lld, where--no-undefined-versionis the default since LLD 16, refuses the libgfapi link on all three. Details in #4811.The change (three commits)
gfapi: drop the never-implemented glfs_caller_specific_init(): remove the declaration fromglfs-handles.h, thegfapi.mapentry and the Darwin alias.gfapi: name the xreaddirplus accessors correctly in gfapi.map and gfapi.aliases: rename the two entries to the shippednames, so the
GFAPI_3.11.0node lists exactly what libgfapi exports.gfapi: fix the GFAPI_PUBLIC label of glfs_mknodat():GFAPI_PUBLIC(glfs_mknod, 11.0)->GFAPI_PUBLIC(glfs_mknodat, 11.0). A no-op on Linux (the macro is empty there); on Darwin the old label produced a second, wrong alias forglfs_mknod.Test
api/srcwithLDFLAGS=-fuse-ld=lld(LLD 22): fails at devel with the threeversion script assignment ... symbol not definederrors, succeeds with this series.readelf --dyn-syms, definedFUNC GLOBALentries): identical before and after, with both bfd andlld; the
GFAPI_3.5.0,GFAPI_3.11.0andGFAPI_11.0version nodes are still present.glfs_caller_specific_init()used to compile and fail at link time; it now fails at compile time.tests/basic/gfapi/unaffected: no code path changes.Fixes: #4811