public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/105678] New: Undefined reference to stacktrace standard library
@ 2022-05-20 19:14 fcolecumberri at hotmail dot com
  2022-05-20 19:23 ` [Bug libstdc++/105678] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fcolecumberri at hotmail dot com @ 2022-05-20 19:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105678

            Bug ID: 105678
           Summary: Undefined reference to stacktrace standard library
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fcolecumberri at hotmail dot com
  Target Milestone: ---

I'm trying to test the stacktrace C++23 feature by creating the next program:

```c++
#include <stacktrace>

int main(){
        std::stacktrace::current();
        return 0;
}
```

using the next g++:

```
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/franky/Descargas/gcc-libs/src/gcc/configure
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-linker-build-id --enable-lto
--enable-multilib --enable-plugin --enable-shared --enable-threads=posix
--disable-libssp --disable-libstdcxx-pch --disable-werror
--with-build-config=bootstrap-lto --enable-link-serialization=1
--enable-libstdcxx-backtrace=yes
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.0 (GCC)
```

Notice I added the `--enable-libstdcxx-backtrace=yes`

with this command:

```bash
g++ -std=gnu++2b cpp_file.cpp
```

And I get the next output:

```
/usr/bin/ld: a-cpp_file.o: in function `std::stacktrace_entry::_S_init()':
cpp_file.cpp:(.text._ZNSt16stacktrace_entry7_S_initEv[_ZNSt16stacktrace_entry7_S_initEv]+0x4a):
undefined reference to `__glibcxx_backtrace_create_state'
/usr/bin/ld: a-cpp_file.o: in function
`std::basic_stacktrace<std::allocator<std::stacktrace_entry>
>::current(std::allocator<std::stacktrace_entry> const&)':
cpp_file.cpp:(.text._ZNSt16basic_stacktraceISaISt16stacktrace_entryEE7currentERKS1_[_ZNSt16basic_stacktraceISaISt16stacktrace_entryEE7currentERKS1_]+0x70):
undefined reference to `__glibcxx_backtrace_simple'
collect2: error: ld returned 1 exit status
```

Maybe I am missing something, maybe the documentation is missing something, or
maybe this is still very experimental.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-23 21:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 19:14 [Bug libstdc++/105678] New: Undefined reference to stacktrace standard library fcolecumberri at hotmail dot com
2022-05-20 19:23 ` [Bug libstdc++/105678] " pinskia at gcc dot gnu.org
2022-05-20 19:27 ` fcolecumberri at hotmail dot com
2022-05-23  8:51 ` redi at gcc dot gnu.org
2022-05-23  8:52 ` redi at gcc dot gnu.org
2022-05-23 19:47 ` fcolecumberri at hotmail dot com
2022-05-23 19:50 ` pinskia at gcc dot gnu.org
2022-05-23 20:16 ` fcolecumberri at hotmail dot com
2022-05-23 21:12 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).