undefined reference to __bss_start when linking xtrabackup_56 in ubuntu raring

Bug #1177182 reported by Ignacio Nin on 2013-05-07
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Vlad Lesin
Fix Released
Vlad Lesin
Fix Released
Vlad Lesin

Bug Description

When linking xtrabackup_56 in latest Ubuntu Raring, ld fails with the following error:

g++ xtrabackup.o innodb_int.o compact.o fil_cur.o write_filt.o changed_page_bitmap.o read_filt.o ds_archive.o ds_xbstream.o ds_local.o ds_stdout.o ds_compress.o ds_encrypt.o xbcrypt_common.o xbcrypt_write.o ds_tmpfile.o ds_buffer.o datasink.o xbstream_write.o quicklz/quicklz.o /mnt/src/work/percona-xtrabackup-2.1.0rc1-581.raring/mysql-5.6/libmysqld/libmysqld.a -lrt -lpthread `libgcrypt-config --libs` -laio -ldl -lcrypt -lssl \
        libarchive/libarchive/libarchive.a -o xtrabackup_56
/usr/bin/ld: /mnt/src/work/percona-xtrabackup-2.1.0rc1-581.raring/mysql-5.6/libmysqld/libmysqld.a(stacktrace.c.o): undefined reference to symbol '__bss_start'
/usr/bin/ld: note: '__bss_start' is defined in DSO /lib/i386-linux-gnu/libgpg-error.so.0 so try adding it to the linker command line
/lib/i386-linux-gnu/libgpg-error.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

After some investigation, it was confirmed that the issue goes away when adding -lwrap to the linkage options.

Related branches

description: updated
Vlad Lesin (vlad-lesin) on 2013-05-07
Changed in percona-xtrabackup:
assignee: nobody → Vlad Lesin (vlad-lesin)
Alexey Kopytov (akopytov) wrote :

The reason is in ds_encrypt / libgcrypt. This combination does something nasty to the linker resulting in __bss_start not defined. I'm not willing to debug it any further, mostly because that code is not used by XtraBackup, so we should look into a workaround rather than a real fix.

The previously suggested workaround of adding -lwrap to linker flags simply because __bss_start is defined in that library will not work. Not all system have libwrap.so, and even Ubuntu 13.04 does not have in a default install.

I suggest we just patch configure.cmake in innodb56.patch to remove the check for __bss_start, i.e. pretend the target system does not support it.

Note that XtraBackup does not use stacktrace. Even if it did (or will be at some point), __bss_start is not actually used on Linux (it uses /proc instead).

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-133

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers