Re: C++ Issues

Uwe Bonnes <bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org> Tue, 10 Nov 2020 12:14:25 +0100
Newsgroups gmane.comp.hardware.microcontrollers.ethernut
Message-ID <[email protected]>
Bob Wirka writes:
> Hello,I'm able to compile C++, and am able to link an executable for
> the Atmel AT91SAM7X.Am using the Code Sourcery "cs-eabi-lite"
> toolchain. The g++ is=A0 "arm-none-eabi-g++" ,=A0 and=A0-fno-exceptions is
> added to the compiler options.It works, but:
> 1. New and delete result
> in undefined reference errors when linking, even though the compile
> stage is successful.

Ethernut SVN Head or some of the releases?

What gcc?  Recent arm-none-eabi needs -specs=3Dnosys.specs:

commit 14b7df8711df64d254cefaa13969942460cd0821
Author: Uwe Bonnes <bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org>
Date:   Thu Oct 1 12:05:24 2020 +0200

    stm32: Nolibc needs nosys.spec for GNU Arm Embedded Toolchain 9-2020-q2=
-update

diff --git a/nut/conf/tools.nut b/nut/conf/tools.nut
index e2a3755cb..1280f6d02 100644
--- a/nut/conf/tools.nut
+++ b/nut/conf/tools.nut
@@ -170,7 +170,7 @@ nuttools =3D
             flavor =3D "boolean",
             exclusivity =3D toolchain_names,
             file =3D "include/cfg/arch.h",
-            makedefs =3D {"TOOLCHAIN=3Dcm3-gcc", "ADDLIBS =3D -lnutc"}
+            makedefs =3D {"TOOLCHAIN=3Dcm3-gcc", "ADDLIBS =3D -lnutc -spec=
s=3Dnosys.specs"}
         },
         {
             brief =3D "GCC Debug for CortexM (no libc)",
@@ -181,7 +181,7 @@ nuttools =3D
             flavor =3D "boolean",
             exclusivity =3D toolchain_names,
             file =3D "include/cfg/arch.h",
-            makedefs =3D {"TOOLCHAIN=3Dcm3-gccdbg", "ADDLIBS =3D -lnutc"}
+            makedefs =3D {"TOOLCHAIN=3Dcm3-gccdbg", "ADDLIBS =3D -lnutc -s=
pecs=3Dnosys.specs"}
         },
          {
             brief =3D "GCC for CortexM (newlib)",


Some experimenting and aquiring knowledge around these issues is
needed.

> 2. The toolchain, or standard, include files
> need to be enclosed in "C" {} binding, otherwise undefined
> references appear.A couple of the undefined references are:=A0 =A0
> unwind-arm.c:(.text+0x204): undefined reference to `__exidx_start'=A0
> =A0=A0abort.c:(.text+0x10): undefined reference to `_exit'I'm just
> experimenting with C++ compiling here, but would anyone have a
> suggestion as to why this might be happening?

A patch adding the braces is welcome.

Is this against SVN Head? For edix related issues, scan the log of the
stm32 linker files and implement according.

Please rport back!

Bye
-- =

Uwe Bonnes                bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion