Fails to build with gold linker

• Dec 3, 2009 - 19:23
Type
Functional
Severity
3
Status
closed
Project

I have also written to the mailing list.

"Some packages fail to build with binutils-gold due to undefined reference. This is in most cases the problem that your executable links against a library A which links against library B, but your executable needs symbols in library B. This is problematic in the situation where library A removes its dependency to library B. The next time the executable gets rebuild it will break and cannot be linked."

It seems the error seems localised to osdabzip, which is built statically. I do not know enough about the cmake build system to suggest a fix here. The following log is taken from the Debian bug report, which is against version 0.9.4, but I suspect the bug is still extant.

Linking CXX executable mscore
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::ZipPrivate():/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:526: error: undefined reference to 'get_crc_table'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::ZipPrivate():/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:526: error: undefined reference to 'get_crc_table'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:776: error: undefined reference to 'crc32'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:789: error: undefined reference to 'crc32'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:814: error: undefined reference to 'deflateInit2_'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:851: error: undefined reference to 'crc32'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:867: error: undefined reference to 'deflate'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:898: error: undefined reference to 'deflateEnd'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:879: error: undefined reference to 'deflateEnd'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function ZipPrivate::createEntry(QString const&, QIODevice&, QDateTime, bool, bool, Zip::CompressionLevel):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:845: error: undefined reference to 'deflateEnd'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function Zip::Zip():/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:526: error: undefined reference to 'get_crc_table'
/usr/bin/ld: ../osdabzip/libosdabzip.a(zip.o): in function Zip::Zip():/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/zip.cpp:526: error: undefined reference to 'get_crc_table'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1088: error: undefined reference to 'crc32'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1125: error: undefined reference to 'inflateInit2_'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1157: error: undefined reference to 'inflate'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1163: error: undefined reference to 'inflateEnd'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1183: error: undefined reference to 'inflateEnd'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1172: error: undefined reference to 'inflateEnd'
/usr/bin/ld: ../osdabzip/libosdabzip.a(unzip.o): in function UnzipPrivate::extractFile(QString const&, ZipEntryP&, QIODevice*, QFlags):/home/peter/rebuild/build/mscore/mscore-0.9.4+dfsg/mscore/osdabzip/unzip.cpp:1138: error: undefined reference to 'inflateEnd'
collect2: ld returned 1 exit status
make[4]: *** [mscore/mscore] Error 1


Comments