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

undefined reference to `std::nothrow'

I add some C++ flags and link flags:

CXXFLAGS += -std=gnu++11
CXXFLAGS += -fno-exceptions -fno-rtti -fcheck-new

LDFLAGS += --specs=nano.specs --specs=$(ROOT_DIR)/newlib_nano/src/custom-nano.specs

custom-nano.specs:

*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}}

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

Related