https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119822
Bug ID: 119822 Summary: Linker failure with std::stacktrace Product: gcc Version: 14.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: terra at gnome dot org Target Milestone: --- Created attachment 61125 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61125&action=edit Preprocessed source Linking fails when std::stacktrace is used in a 32-bit program. This could be worse than it looks: 32-bit-ness is not part of the class' signature. If a method in it doesn't have native_handle_type in its arguments but still uses it internally, then the 32-bit and 64-bit methods would have the name. I think. (On the other hand it's 2025 so maybe 32-bit isn't very high of the list of priorities.) # /usr/local/products/gcc/14.1.0/bin/g++ -Wall -std=gnu++23 -m32 -g -O2 ttt.C /usr/local/products/gcc/14.1.0/include/c++/14.1.0/stacktrace:203: error: undefined reference to 'std::__stacktrace_impl::_S_current(int (*)(void*, unsigned int), void*, int)' /usr/local/products/gcc/14.1.0/include/c++/14.1.0/stacktrace:163: error: undefined reference to 'std::stacktrace_entry::_Info::_M_populate(unsigned int)' collect2: error: ld returned 1 exit status # cat ttt.C #include <stacktrace> #include <iostream> int main() { std::cout << std::stacktrace::current() << std::endl; return 0; } # /usr/local/products/gcc/14.1.0/bin/g++ -v Using built-in specs. COLLECT_GCC=/usr/local/products/gcc/14.1.0/bin/g++ COLLECT_LTO_WRAPPER=/usr/local/products/gcc/14.1.0/lib/gcc/x86_64-suse-linux/14.1.0/lto-wrapper Target: x86_64-suse-linux Configured with: ../../gcc-14.1.0/configure --enable-languages=c,c++,fortran,jit --enable-host-shared --with-pic --enable-targets=x86_64-suse-linux,i686-suse-linux --prefix=/usr/local/products/gcc/14.1.0 --with-gnu-as --with-as=/usr/local/products/gcc/binutils-2.40/bin/as --with-ld=/usr/local/products/gcc/binutils-2.40/bin/ld.gold --enable-link-mutex --enable-gnu-indirect-functions --enable-linux-futex --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new x86_64-suse-linux --enable-libstdcxx-backtrace=yes Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.1.0 (GCC)