This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to support c++ feature std::nothrow

Hi all,

I added newliib-nano to my GCC project, when I use new(std::nothrow)  I got

Fullscreen
1
undefined reference to `std::nothrow'
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I add some C++ flags and link flags:

Fullscreen
1
2
3
4
CXXFLAGS += -std=gnu++11
CXXFLAGS += -fno-exceptions -fno-rtti -fcheck-new
LDFLAGS += --specs=nano.specs --specs=$(ROOT_DIR)/newlib_nano/src/custom-nano.specs
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

custom-nano.specs:

Fullscreen
1
2
3
4
5
*link:
%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lnewlib_nano) %:replace-outfile(-lrdimon -lrdimon_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano)
*lib:
-lnewlib_nano %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

How should I modify the makefile or should I add some stubs function? Any help would be really appreciated.