Bugzilla – Bug 1133276
LTO: pmdk build fails
Last modified: 2021-07-19 10:46:23 UTC
Fails due to: [ 92s] objcopy --localize-hidden `sed -n 's/^ *\([a-zA-Z0-9_]*\);$/-G \1/p' libpmempool.map` ../nondebug/libpmempool/libpmempool_unscoped.o ../nondebug/libpmempool/libpmempool_all.o [ 92s] ar rv ../nondebug/libpmempool/../libpmempool.a ../nondebug/libpmempool/libpmempool_all.o [ 92s] ar: creating ../nondebug/libpmempool/../libpmempool.a [ 92s] a - ../nondebug/libpmempool/libpmempool_all.o [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': [ 98s] (.text+0x0): multiple definition of `os_badblocks_get'; ../nondebug/libpmempool/badblock_linux.o (symbol from plugin):(.text+0x0): first defined here [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': [ 98s] (.text+0x0): multiple definition of `os_badblocks_count'; ../nondebug/libpmempool/badblock_linux.o (symbol from plugin):(.text+0x0): first defined here [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': [ 98s] (.text+0x0): multiple definition of `os_badblocks_check_file'; ../nondebug/libpmempool/badblock_linux.o (symbol from plugin):(.text+0x0): first defined here [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': [ 98s] (.text+0x0): multiple definition of `os_badblocks_clear'; ../nondebug/libpmempool/badblock_linux.o (symbol from plugin):(.text+0x0): first defined here [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': [ 98s] (.text+0x0): multiple definition of `os_badblocks_clear_all'; ../nondebug/libpmempool/badblock_linux.o (symbol from plugin):(.text+0x0): first defined here [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': [ 98s] (.text+0x0): multiple definition of `Realloc'; ../nondebug/libpmempool/util.o (symbol from plugin):(.text+0x0): first defined here [ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o (symbol from plugin): in function `os_badblocks_get': ...
This seems to come from the linker ignoring symbol locality. Is there anything PMDK could do to fix this, other than renaming symbols in each library (which is infeasible)?
(In reply to Marcin Ślusarz from comment #1) > This seems to come from the linker ignoring symbol locality. > Is there anything PMDK could do to fix this, other than renaming symbols in > each library (which is infeasible)? I can take a look in the future. But it's not critical to have LTO working for such package.
This is fixed in factory through disabling LTO for PMDK. Can we close this bz?
Please leave it open and assigned to me. Thanks.
Now I see a different issue: [ 18s] cc -Wl,-z,relro -Wl,--fatal-warnings -Wl,--warn-common -L../nondebug/libpmempool/.. -shared -Wl,--version-script=libpmempool.link,-soname,libpmempool.so.1 -o ../nondebug/libpmempool/../libpmempool.so.1.0.0 ../nondebug/libpmempool/alloc.o ../nondebug/libpmempool/badblock_ndctl.o ../nondebug/libpmempool/badblock.o ../nondebug/libpmempool/ctl.o ../nondebug/libpmempool/ctl_prefault.o ../nondebug/libpmempool/ctl_sds.o ../nondebug/libpmempool/ctl_fallocate.o ../nondebug/libpmempool/ctl_cow.o ../nondebug/libpmempool/extent_linux.o ../nondebug/libpmempool/file.o ../nondebug/libpmempool/file_posix.o ../nondebug/libpmempool/fs_posix.o ../nondebug/libpmempool/mmap.o ../nondebug/libpmempool/mmap_posix.o ../nondebug/libpmempool/os_posix.o ../nondebug/libpmempool/os_thread_posix.o ../nondebug/libpmempool/os_dimm_ndctl.o ../nondebug/libpmempool/os_deep_linux.o ../nondebug/libpmempool/out.o ../nondebug/libpmempool/pool_hdr.o ../nondebug/libpmempool/rand.o ../nondebug/libpmempool/set.o ../nondebug/libpmempool/shutdown_state.o ../nondebug/libpmempool/util.o ../nondebug/libpmempool/util_posix.o ../nondebug/libpmempool/uuid.o ../nondebug/libpmempool/uuid_linux.o ../nondebug/libpmempool/os_auto_flush_linux.o ../nondebug/libpmempool/libpmempool.o ../nondebug/libpmempool/check.o ../nondebug/libpmempool/check_bad_blocks.o ../nondebug/libpmempool/check_backup.o ../nondebug/libpmempool/check_btt_info.o ../nondebug/libpmempool/check_btt_map_flog.o ../nondebug/libpmempool/check_log.o ../nondebug/libpmempool/check_blk.o ../nondebug/libpmempool/check_pool_hdr.o ../nondebug/libpmempool/check_sds.o ../nondebug/libpmempool/check_util.o ../nondebug/libpmempool/check_write.o ../nondebug/libpmempool/pool.o ../nondebug/libpmempool/replica.o ../nondebug/libpmempool/feature.o ../nondebug/libpmempool/rpmem_common.o ../nondebug/libpmempool/rpmem_ssh.o ../nondebug/libpmempool/rpmem_cmd.o ../nondebug/libpmempool/rpmem_util.o ../nondebug/libpmempool/sync.o ../nondebug/libpmempool/transform.o ../nondebug/libpmempool/rm.o pmemblk_priv_funcs.o -pthread -lpmem -ldl -lndctl -ldaxctl [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/set.o: warning: multiple common of `Rpmem_persist' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/set.o: warning: multiple common of `Rpmem_remove' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/util.o: warning: multiple common of `Pagesize' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/set.o: warning: multiple common of `Rpmem_set_attr' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/mmap.o: warning: multiple common of `Mmap_no_random' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/util.o: warning: multiple common of `_Pmreorder_emit' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/set.o: warning: multiple common of `Rpmem_read' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/util.o: warning: multiple common of `_On_valgrind' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/util.o: warning: multiple common of `Mmap_align' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/mmap.o: warning: multiple common of `Mmap_hint' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/set.o: warning: multiple common of `Rpmem_deep_persist' [ 18s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: pmemblk_priv_funcs.o and ../nondebug/libpmempool/set.o: warning: multiple common of `Rpmem_close' [ 18s] objcopy --localize-hidden `sed -n 's/^ *\([a-zA-Z0-9_]*\);$/-G \1/p' libpmempool.link` ../nondebug/libpmempool/libpmempool_unscoped.o ../nondebug/libpmempool/libpmempool_all.o [ 18s] ar rv ../nondebug/libpmempool/../libpmempool.a ../nondebug/libpmempool/libpmempool_all.o [ 18s] ar: creating ../nondebug/libpmempool/../libpmempool.a [ 18s] a - ../nondebug/libpmempool/libpmempool_all.o [ 18s] collect2: error: ld returned 1 exit status [ 18s] make[2]: *** [../Makefile.inc:261: ../nondebug/libpmempool/../libpmempool.so.1.0.0] Error 1 [ 18s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/pmdk-1.8/src/libpmempool' [ 18s] make[1]: *** [Makefile:173: libpmempool] Error 2 [ 18s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/pmdk-1.8/src' [ 18s] make: *** [Makefile:83: all] Error 2 [ 18s] error: Bad exit status from /var/tmp/rpm-tmp.UXWZDm (%build) it's after LTO was disabled. @Marcin: Can you please take a look?
Still, the error seems to come from the linker ignoring symbol visibility. pmemblk_priv_funcs.o is created using objcopy --localize-hidden with a list of symbols that need to be visible, but somehow linker still sees those hidden symbols when linking everything.