binutils 2.42.50.20240618-1FTBFS of mir 2.17, undefined references to stdlib with LTO

Bug #2070302 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Status tracked in Oracular
Oracular
New
Undecided
Unassigned

Bug Description

With deps at 2024.06.18 things work:

```
$ git clone https://github.com/canonical/mir.git --depth 1
$ cd mir
$ apt build-dep . --snapshot 20240618T000000Z
$ dpkg-buildpackage -uc -us
```

Upgrading binutils causes a FTBFS
```
$ apt install binutils
# /var/log/apt/history.log
Commandline: apt install binutils
Upgrade: libctf-nobfd0:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), libbinutils:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), binutils-x86-64-linux-gnu:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), libctf0:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), binutils-common:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), libsframe1:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), libgprofng0:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1), binutils:amd64 (2.42-4ubuntu2, 2.42.50.20240618-1ubuntu1)

$ dpkg-buildpackage -uc -us
```

An excerpt from the errors:
```
/usr/bin/c++ -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/root/mir=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/root/mir=/usr/src/mir-2.17.0 -Wdate-time -D_FORTIFY_SOURCE=3 -pthread -g -Wall -fno-strict-aliasing -Wnon-virtual-dtor -Wextra -fPIC -Werror -Wno-mismatched-tags -Wno-psabi -flto -ffat-lto-objects -Wno-error=null-dereference -Wno-error=overloaded-virtual -Wno-sign-compare -Wno-error=maybe-uninitialized -Wno-pedantic -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,--as-needed -Wl,--no-undefined "CMakeFiles/miral-test.dir/external_client.cpp.o" "CMakeFiles/miral-test.dir/runner.cpp.o" "CMakeFiles/miral-test.dir/wayland_extensions.cpp.o" "CMakeFiles/miral-test.dir/zone.cpp.o" "CMakeFiles/miral-test.dir/server_example_decoration.cpp.o" "CMakeFiles/miral-test.dir/org_kde_kwin_server_decoration.c.o" "CMakeFiles/miral-test.dir/server-decoration_wrapper.cpp.o" -o ../../bin/miral-test.bin ../libmir-test-assist.a ../../lib/libmiral.so.7 ../../src/miral/libmiral-internal.a /usr/lib/x86_64-linux-gnu/libwayland-client.so /usr/lib/x86_64-linux-gnu/libyaml-cpp.so ../../lib/libmirserver.so.60 /usr/lib/x86_64-linux-gnu/libuuid.so ../../src/platforms/common/server/libserver_platform_common.a ../../lib/libmirplatform.so.28 ../../lib/libmirwayland.so.5 /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.83.0 /usr/lib/x86_64-linux-gnu/libepoxy.so ../../lib/libmircommon.so.11 /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.83.0 /usr/lib/x86_64-linux-gnu/libboost_atomic.so.1.83.0 -ldl /usr/lib/x86_64-linux-gnu/libxkbcommon.so ../../lib/libmircore.so.2 /usr/lib/x86_64-linux-gnu/libwayland-server.so ../../src/platforms/common/server/kms-utils/libkms_utils.a /usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.83.0 /usr/lib/x86_64-linux-gnu/libdrm.so /usr/lib/x86_64-linux-gnu/libEGL.so /usr/lib/x86_64-linux-gnu/libGLESv2.so /usr/lib/x86_64-linux-gnu/libudev.so /usr/lib/x86_64-linux-gnu/libgio-2.0.so /usr/lib/x86_64-linux-gnu/libgobject-2.0.so /usr/lib/x86_64-linux-gnu/libglib-2.0.so /usr/lib/x86_64-linux-gnu/libxcb.so /usr/lib/x86_64-linux-gnu/libxcb-composite.so /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so /usr/lib/x86_64-linux-gnu/libxcb-randr.so /usr/lib/x86_64-linux-gnu/libxcb-render.so /usr/lib/x86_64-linux-gnu/libXcursor.so /usr/lib/x86_64-linux-gnu/liblttng-ust.so /usr/lib/x86_64-linux-gnu/liblttng-ust-common.so /usr/lib/x86_64-linux-gnu/libdl.a /usr/lib/x86_64-linux-gnu/libfreetype.so -latomic /usr/lib/x86_64-linux-gnu/libapparmor.so /usr/lib/x86_64-linux-gnu/libboost_system.so.1.83.0 -lgtest_main ../../libGMock.a -lgtest /usr/bin/ld: /tmp/cccNaqUj.ltrans0.ltrans.o: in function `(anonymous namespace)::ExternalClient::ExternalClient() [clone .lto_priv.0]': /usr/src/mir-2.17.0/tests/miral/external_client.cpp:32:(.text+0x343e): warning: the use of `tmpnam' is dangerous, better use `mkstemp' /usr/bin/ld: ../../src/miral/libmiral-internal.a(input_device_config.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char)': /usr/include/c++/13/bits/basic_string.h:1388:(.text._ZNKSt8__format14__formatter_fpIcE6formatIDF128_NS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_[_ZNKSt8__format14__formatter_fpIcE6formatIDF128_NS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_]+0x1587): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)' /usr/bin/ld: /usr/include/c++/13/bits/basic_string.h:1388:(.text._ZNKSt8__format14__formatter_fpIcE6formatIeNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_[_ZNKSt8__format14__formatter_fpIcE6formatIeNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_]+0x1524): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)' /usr/bin/ld: /usr/include/c++/13/bits/basic_string.h:1388:(.text._ZNKSt8__format14__formatter_fpIcE6formatIdNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_[_ZNKSt8__format14__formatter_fpIcE6formatIdNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_]+0x1527): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)' /usr/bin/ld: /usr/include/c++/13/bits/basic_string.h:1388:(.text._ZNKSt8__format14__formatter_fpIcE6formatIfNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_[_ZNKSt8__format14__formatter_fpIcE6formatIfNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_]+0x1517): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)' /usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o): in function `std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&)': /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x32c7): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x374c): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x3b86): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x3bac): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x3bd8): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()'
/usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o): in function `std::lock_guard<std::mutex>::lock_guard(std::mutex&)':
/usr/include/c++/13/bits/std_mutex.h:249:(.text+0x5d68): undefined reference to `std::mutex::lock()'
/usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o): in function `std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&)':
/usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x6bdb): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()'
/usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x744f): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x74b6): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()'
/usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x74f6): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()'
/usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text+0x754f): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()'
/usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o):/usr/include/c++/13/bits/shared_ptr_base.h:1078: more undefined references to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' follow
/usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::__str_concat<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<
char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::value_type const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::value_type const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::allocator_type const&)': /usr/include/c++/13/bits/basic_string.h:3538:(.text.unlikely+0x607): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned long)' /usr/bin/ld: /usr/include/c++/13/bits/basic_string.h:3539:(.text.unlikely+0x615): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned long)' /usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o): in function `std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&)': /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text._ZN4YAML4Node5beginEv[_ZN4YAML4Node5beginEv]+0x47): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text._ZN4YAML4Node5beginEv[_ZN4YAML4Node5beginEv]+0x90): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text._ZN4YAML4Node3endEv[_ZN4YAML4Node3endEv]+0x47): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text._ZN4YAML4Node3endEv[_ZN4YAML4Node3endEv]+0x90): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: /usr/include/c++/13/bits/shared_ptr_base.h:1078:(.text._ZZNK4YAML6detail9node_data3getIiEEPNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEEENKUlSt4pairIS4_S4_EE_clESC_.isra.0[_ZNK4YAML6detail9node_data3getIiEEPNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x4b): undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' /usr/bin/ld: ../../src/miral/libmiral-internal.a(static_display_config.cpp.o):/usr/include/c++/13/bits/shared_ptr_base.h:1078: more undefined references to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()' follow
```

ProblemType: Bug
DistroRelease: Ubuntu 24.10
Package: binutils 2.42.50.20240618-1ubuntu1
ProcVersionSignature: Ubuntu 6.8.0-35.35-generic 6.8.4
Uname: Linux 6.8.0-35-generic x86_64
ApportVersion: 2.28.1-0ubuntu4
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudBuildName: server
CloudID: lxd
CloudName: lxd
CloudPlatform: lxd
CloudSerial: 20240622
CloudSubPlatform: LXD socket API v. 1.0 (/dev/lxd/sock)
Date: Mon Jun 24 17:04:03 2024
ProcEnviron:
 LANG=C.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=screen-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: binutils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Michał Sawicz (saviq) wrote :
Revision history for this message
Michał Sawicz (saviq) wrote :
Revision history for this message
Michał Sawicz (saviq) wrote :

2.42.50.20240625 has the same problem.

Revision history for this message
Matthias Klose (doko) wrote :

in https://sourceware.org/bugzilla/show_bug.cgi?id=31982, people are not able to reproduce this with GCC 14, however when I'm trying, I get:

/usr/bin/ld: CMakeFiles/mir_unit_tests.dir/frontend_wayland/test_desktop_file_manager.cpp.o: in function `DesktopFileManager_can_resolve_from_valid_flatpak_info_Test::TestBody()':

is this something to fix in mir?

please could you also address LP: #2073451 in mir?

Revision history for this message
Michał Sawicz (saviq) wrote :
Download full text (3.8 KiB)

@doko this is just a warning, the actual error, further up, is this:

2024-07-18T09:43:08.5982068Z [ 89%] Building CXX object examples/miral-shell/CMakeFiles/miral-shell.dir/shell_main.cpp.o
2024-07-18T09:43:08.5988615Z cd /<<PKGBUILDDIR>>/build-amd64/examples/miral-shell && ccache /usr/bin/g++-14 -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DEGL_NO_X11 -DLTTNG_UST_HAVE_SDT_INTEGRATION -DMIR_USE_APPARMOR -DMIR_VERSION_MAJOR=2 -DMIR_VERSION_MICRO=0 -DMIR_VERSION_MINOR=18 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/<<PKGBUILDDIR>>/examples/example-server-lib -I/<<PKGBUILDDIR>>/include/miral -I/<<PKGBUILDDIR>>/include/common -I/<<PKGBUILDDIR>>/include/core -I/<<PKGBUILDDIR>>/examples/miral-shell/spinner -isystem /usr/include/libdrm -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/mir-2.17.0 -Wdate-time -D_FORTIFY_SOURCE=3 -pthread -g -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC -Werror -Wno-mismatched-tags -Wno-psabi -std=c++23 -MD -MT examples/miral-shell/CMakeFiles/miral-shell.dir/shell_main.cpp.o -MF CMakeFiles/miral-shell.dir/shell_main.cpp.o.d -o CMakeFiles/miral-shell.dir/shell_main.cpp.o -c /<<PKGBUILDDIR>>/examples/miral-shell/shell_main.cpp
2024-07-18T09:43:08.5995706Z /usr/bin/ld: /tmp/ccAYk69S.ltrans0.ltrans.o: in function `(anonymous namespace)::ExternalClient::ExternalClient() [clone .lto_priv.0]':
2024-07-18T09:43:08.5997090Z /usr/src/mir-2.17.0/build-amd64/tests/miral/../../../tests/miral/external_client.cpp:32:(.text+0x391f): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
2024-07-18T09:43:08.5998695Z /usr/bin/ld: ../../src/miral/libmiral-internal.a(input_device_config.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char)':
2024-07-18T09:43:08.6001009Z /usr/include/c++/14/bits/basic_string.h:1399:(.text._ZNKSt8__format14__formatter_fpIcE6formatIDF128_NS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_[_ZNKSt8__format14__formatter_fpIcE6formatIDF128_NS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_]+0x1149): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)'
2024-07-18T09:43:08.6004107Z /usr/bin/ld: /usr/include/c++/14/bits/basic_string.h:1399:(.text._ZNKSt8__format14__formatter_fpIcE6formatIeNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_[_ZNKSt8__format14__formatter_fpIcE6formatIeNS_10_Sink_iterIcEEEENSt20basic_format_contextIT0_cE8iteratorET_RS7_]+0x111f): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)'
2024-07-18T09:43:08.6007318Z /usr/bin/ld: /usr/include/c++/14/bits/basic_string.h:1399:(.text._ZNKSt8__format14__formatter_fpIcE6formatIdNS_10_Sink_iterIcEEEENSt20basic_format_...

Read more...

Revision history for this message
Michał Sawicz (saviq) wrote :
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.