From 30b95ff9cdec72d9089f4882dafca447ae3174f1 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Thu, 2 Jul 2020 15:52:15 -0400 Subject: api: libgfapi symbol versions break LTO in Fedora rawhide/f33 The way symbol versions are implemented is incompatible with gcc-10 and LTO. Fedora provenpackager Jeff Law (law [at] redhat.com) writes in the Fedora dist-git glusterfs.spec: This package uses top level ASM constructs which are incompatible with LTO. Top level ASMs are often used to implement symbol versioning. gcc-10 introduces a new mechanism for symbol versioning which works with LTO. Converting packages to use that mechanism instead of toplevel ASMs is recommended. In particular, note that the version of gluster in Fedora rawhide/f33 is glusterfs-8.0RC0. Once this fix is merged it will be necessary to backport it to the release-8 branch. At the time that gfapi symbol versions were first implemented we copied the GNU libc (glibc) symbol version implementation following Uli Drepper's symbol versioning HOWTO. Now gcc-10 has a symver attribute that can be used instead. (Maybe it has been there all along?) Both the original implemenation and this implemenation yield the same symbol versions. This can be seen by running `nm -D --with-symbol-versions libgfapi.so` on the libgfapi.so built before and after applying this fix. Change-Id: I05fda580afacfff1bfc07be810dd1afc08a92fb8 Fixes: #1352 Signed-off-by: Kaleb S. KEITHLEY --- api/src/glfs-resolve.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'api/src/glfs-resolve.c') diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c index ebc5282205f..2e06f04c98f 100644 --- a/api/src/glfs-resolve.c +++ b/api/src/glfs-resolve.c @@ -162,6 +162,7 @@ __glfs_refresh_inode(struct glfs *fs, xlator_t *subvol, inode_t *inode, return newinode; } +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_loc_touchup, 3.4.0) int priv_glfs_loc_touchup(loc_t *loc) { @@ -176,8 +177,6 @@ priv_glfs_loc_touchup(loc_t *loc) return ret; } -GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_loc_touchup, 3.4.0); - int glfs_resolve_symlink(struct glfs *fs, xlator_t *subvol, inode_t *inode, char **lpath) @@ -467,6 +466,7 @@ out: return inode; } +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_resolve_at, 3.4.0) int priv_glfs_resolve_at(struct glfs *fs, xlator_t *subvol, inode_t *at, const char *origpath, loc_t *loc, struct iatt *iatt, @@ -617,8 +617,6 @@ invalid_fs: return ret; } -GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_resolve_at, 3.4.0); - int glfs_resolve_path(struct glfs *fs, xlator_t *subvol, const char *origpath, loc_t *loc, struct iatt *iatt, int follow, int reval) @@ -647,6 +645,7 @@ out: return ret; } +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_resolve, 3.7.0) int priv_glfs_resolve(struct glfs *fs, xlator_t *subvol, const char *origpath, loc_t *loc, struct iatt *iatt, int reval) @@ -657,7 +656,6 @@ priv_glfs_resolve(struct glfs *fs, xlator_t *subvol, const char *origpath, return ret; } -GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_resolve, 3.7.0); int glfs_lresolve(struct glfs *fs, xlator_t *subvol, const char *origpath, @@ -965,6 +963,7 @@ __glfs_active_subvol(struct glfs *fs) return new_subvol; } +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_subvol_done, 3.4.0) void priv_glfs_subvol_done(struct glfs *fs, xlator_t *subvol) { @@ -992,8 +991,7 @@ priv_glfs_subvol_done(struct glfs *fs, xlator_t *subvol) } } -GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_subvol_done, 3.4.0); - +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_active_subvol, 3.4.0) xlator_t * priv_glfs_active_subvol(struct glfs *fs) { @@ -1021,8 +1019,6 @@ priv_glfs_active_subvol(struct glfs *fs) return subvol; } -GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_active_subvol, 3.4.0); - int __glfs_cwd_set(struct glfs *fs, inode_t *inode) { -- cgit