[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Library won't link



Hi,

For the past year, I've been (on and off) working with ola upstream on
getting new-gcc (first 9, then 10) and python3 issues resolved, so that
I would be able to get it into bullseye again. We're almost there,
except for one thing that mystifies me.

As part of the autopkgtest, I build a small program that initializes
libola to make sure that a basic initialization works. This worked
previously, but now fails with:

autopkgtest [15:27:45]: test command6:  - - - - - - - - - - stderr - - - - - - - - - -
/usr/bin/ld: /tmp/cczs0VkU.o: warning: relocation against `_ZTVN3ola2io18LoopbackDescriptorE' in read-only section `.text._ZN3ola2io18LoopbackDescriptorD2Ev[_ZN3ola2io18LoopbackDescriptorD5Ev]'
/usr/bin/ld: /tmp/cczs0VkU.o: in function `main':
hw.cc:(.text+0x11): undefined reference to `ola::io::LoopbackDescriptor::LoopbackDescriptor()'
/usr/bin/ld: hw.cc:(.text+0x24): undefined reference to `ola::client::OlaClient::OlaClient(ola::io::ConnectedDescriptor*)'
/usr/bin/ld: hw.cc:(.text+0x30): undefined reference to `ola::client::OlaClient::Setup()'
/usr/bin/ld: hw.cc:(.text+0xc1): undefined reference to `ola::client::OlaClient::~OlaClient()'
/usr/bin/ld: hw.cc:(.text+0xe0): undefined reference to `ola::client::OlaClient::~OlaClient()'
/usr/bin/ld: /tmp/cczs0VkU.o: in function `ola::io::BidirectionalFileDescriptor::~BidirectionalFileDescriptor()':
hw.cc:(.text._ZN3ola2io27BidirectionalFileDescriptorD2Ev[_ZN3ola2io27BidirectionalFileDescriptorD5Ev]+0xf): undefined reference to `vtable for ola::io::BidirectionalFileDescriptor'
/usr/bin/ld: hw.cc:(.text._ZN3ola2io27BidirectionalFileDescriptorD2Ev[_ZN3ola2io27BidirectionalFileDescriptorD5Ev]+0x1d): undefined reference to `vtable for ola::io::BidirectionalFileDescriptor'
/usr/bin/ld: /tmp/cczs0VkU.o: in function `ola::io::ConnectedDescriptor::~ConnectedDescriptor()':
hw.cc:(.text._ZN3ola2io19ConnectedDescriptorD2Ev[_ZN3ola2io19ConnectedDescriptorD5Ev]+0xf): undefined reference to `vtable for ola::io::ConnectedDescriptor'
/usr/bin/ld: hw.cc:(.text._ZN3ola2io19ConnectedDescriptorD2Ev[_ZN3ola2io19ConnectedDescriptorD5Ev]+0x1d): undefined reference to `vtable for ola::io::ConnectedDescriptor'
/usr/bin/ld: /tmp/cczs0VkU.o: in function `ola::io::LoopbackDescriptor::~LoopbackDescriptor()':
hw.cc:(.text._ZN3ola2io18LoopbackDescriptorD2Ev[_ZN3ola2io18LoopbackDescriptorD5Ev]+0xf): undefined reference to `vtable for ola::io::LoopbackDescriptor'
/usr/bin/ld: hw.cc:(.text._ZN3ola2io18LoopbackDescriptorD2Ev[_ZN3ola2io18LoopbackDescriptorD5Ev]+0x1d): undefined reference to `vtable for ola::io::LoopbackDescriptor'
/usr/bin/ld: hw.cc:(.text._ZN3ola2io18LoopbackDescriptorD2Ev[_ZN3ola2io18LoopbackDescriptorD5Ev]+0x31): undefined reference to `ola::io::LoopbackDescriptor::Close()'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
autopkgtest [15:27:45]: @@@@@@@@@@@@@@@@@@@@ summary

(as observed on
https://salsa.debian.org/wouter/ola/-/jobs/1173462#L1297)

>From what I can make out, the first message happens when a file is
compiled without -fPIC and then linked into a shared library. This would
be surprising if that is the reason, for libola is built using libtool
throughout, and trying the build on stable works with no problem
whatsoever.

What am I missing?

-- 
To the thief who stole my anti-depressants: I hope you're happy

  -- seen somewhere on the Internet on a photo of a billboard


Reply to: