Missing __error symbol in btrfs-progs-4.10
Subsystems (2)
A Gentoo user reports that snapper broke after upgrading to btrfs-progs-4.10.
snapper: symbol lookup error: /usr/lib64/libbtrfs.so.0: undefined
symbol: __error
https://bugs.gentoo.org/show_bug.cgi?id=613890
It seems that the __error symbol is referenced, but not included in libbtrfs.
Exporting this symbol seems like a bad idea, so I would suggest renaming it, or go back to inlining it in the headers.
Quoted 11 lines · Mike Gilbert
A Gentoo user reports that snapper broke after upgrading to btrfs-progs-4.10.
snapper: symbol lookup error:
/usr/lib64/libbtrfs.so.0: undefined
symbol:__errorhttps://bugs.gentoo.org/show_bug.cgi?id=613890
It seems that the
__errorsymbol is referenced, but not included in libbtrfs.Exporting this symbol seems like a bad idea, so I would suggest renaming it, or go back to inlining it in the headers.
Right, the name is too generic. I'd like to keep the function not inlined, so I'll rename them to __btrfs_error etc, but the macros could still clash with other symbols from the library user.
PATCH 1/1 btrfs-progs: fix missing __error symbol in libbtrfs.so.0
From: Sergei Trofimovich <[email protected]>
The easiest way to reproduce the error is to try to build btrfs-progs with
$ make LDFLAGS=-Wl,--no-undefined
btrfs-list.o: In function `lookup_ino_path':
btrfs-list.c:(.text+0x7d2): undefined reference to `__error'
Noticed by Denis Descheneaux when snapper tool stopped working after upgrade to btrfs-progs-4.10.
As soname didn't change in 4.9 -> 4.10 release I assume it's just an object file omission in library depends and not the API/ABI change of the library error printing.
--- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Makefile +4 -4
@@ -95,7 +95,7 @@ objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \ qgroup.o raid56.o free-space-cache.o kernel-lib/list_sort.o props.o \ kernel-shared/ulist.o qgroup-verify.o backref.o string-table.o task-utils.o \ inode.o file.o find-root.o free-space-tree.o help.o send-dump.o \ - fsfeatures.o messages.o + fsfeatures.o cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \ cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \ cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
@@ -104,7 +104,7 @@ cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \ cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o \ mkfs/common.o libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \ - kernel-lib/crc32c.o \ + kernel-lib/crc32c.o messages.o \ uuid-tree.o utils-lib.o rbtree-utils.o libbtrfs_headers = send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \ kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
@@ -446,7 +446,7 @@ test-ioctl: ioctl-test ioctl-test-32 ioctl-test-64 $(Q)./ioctl-test-32 > ioctl-test-32.log $(Q)./ioctl-test-64 > ioctl-test-64.log -library-test: library-test.c messages.o $(libs_shared) +library-test: library-test.c $(libs_shared) @echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d)) $(Q)mkdir -p $(TMPD)/include/btrfs && \ cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
@@ -456,7 +456,7 @@ library-test: library-test.c messages.o $(libs_shared) @echo " [TEST CLEAN] $@" $(Q)$(RM) -rf -- $(TMPD) -library-test.static: library-test.c messages.static.o $(libs_static) +library-test.static: library-test.c $(libs_static) @echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d)) $(Q)mkdir -p $(TMPD)/include/btrfs && \ cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
Signature · 1 line
2.12.1
Re: [PATCH] btrfs-progs: fix missing __error symbol in libbtrfs.so.0
Quoted 17 lines · On Mon, Mar 27, 2017 at 10:07:20PM +0100, [email protected] wrote:
From: Sergei Trofimovich <[email protected]>
The easiest way to reproduce the error is to try to build btrfs-progs with
$ make LDFLAGS=-Wl,--no-undefinedbtrfs-list.o: In function `lookup_ino_path':
btrfs-list.c:(.text+0x7d2): undefined reference to `__error'Noticed by Denis Descheneaux when snapper tool stopped working after upgrade to btrfs-progs-4.10.
As soname didn't change in 4.9 -> 4.10 release I assume it's just an object file omission in library depends and not the API/ABI change of the library error printing.
Quoted 6 lines
Cc Mike Gilbert <[email protected]>Reported-by Denis DescheneauxSigned-off-by Sergei Trofimovich <[email protected]>
I've replaced my patch with yours, thanks.