pmdk not ready upstream for lto

Bug #1922031 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pmdk (Ubuntu)
Fix Released
Undecided
Unassigned
pmdk (openSUSE)
Confirmed
Medium

Bug Description

pmdk not ready upstream for lto

Tags: lto
Revision history for this message
In , Martin-liska (martin-liska) wrote :

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':
...

Revision history for this message
In , Marcin Ślusarz (mslusarz) wrote :

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)?

Revision history for this message
In , Martin-liska (martin-liska) wrote :

(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.

Revision history for this message
In , Nmoreychaisemartin (nmoreychaisemartin) wrote :

This is fixed in factory through disabling LTO for PMDK. Can we close this bz?

Revision history for this message
In , Martin-liska (martin-liska) wrote :

Please leave it open and assigned to me.
Thanks.

Revision history for this message
In , Martin-liska (martin-liska) wrote :
Download full text (5.1 KiB)

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 `_Pmr...

Read more...

Revision history for this message
In , Marcin Ślusarz (mslusarz) wrote :

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.

Matthias Klose (doko)
Changed in pmdk (Ubuntu):
status: New → Confirmed
tags: added: lto
Changed in pmdk (openSUSE):
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Paride Legovini (paride) wrote :

Hi Matthias,

This is fixed already in pmdk 1.10-1ubuntu1 (currently in hirsute-proposed). Christian filed an upstream bug for this here: https://github.com/pmem/pmdk/issues/5197.

Marking this as Fix Released.

Changed in pmdk (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.