Open
Description
Test case:
#include <vector>
std::vector<int> v;
int main (void)
{
v.push_back (1);
}
Invocation:
$ avr-g++-15 -mmcu=atmega128 -Os main.cpp -I$DIR/include $DIR/examples/common/new.cpp $DIR/examples/common/cxxabi.cpp -fno-exceptions -std=c++17
where $DIR
denotes the top_srcdir of avr-libstdcpp. The message from the linker is:
$prefix/bin/../lib/gcc/avr/15.1.1/../../../../avr/bin/ld: main.o: in function `.L2':
main.cpp:(.text.startup+0x48): undefined reference to `std::__throw_length_error(char const*)'
$prefix/bin/../lib/gcc/avr/15.1.1/../../../../avr/bin/ld: new.o: in function `operator new(unsigned int)':
new.cpp:(.text+0x8): undefined reference to `std::__throw_bad_alloc()'
$prefix/bin/../lib/gcc/avr/15.1.1/../../../../avr/bin/ld: new.o: in function `operator new[](unsigned int)':
new.cpp:(.text+0x16): undefined reference to `std::__throw_bad_alloc()'
collect2: error: ld returned 1 exit status
where $prefix
denotes the installation path of the toolchain (what has been specified with configure).
Configured with: ../../source/gcc-15/configure --target=avr --disable-nls --with-dwarf2 --with-gnu-as --with-gnu-ld --with-long-double=64 --disable-libcc1 --disable-shared --enable-languages=c,c++
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 15.1.1 20250430 (GCC)
I see that there is stuff in src/functexcept.cc
, other parts of the stdlib like new
are located in examples/common
.
Isn't there one place for object sources that would be expected in some libstdc++? Concerning the error above, is there a way to avoid using these throw handlers? compiling with -fno-exceptions
didn't do the trick.
Metadata
Metadata
Assignees
Labels
No labels