public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: David Fernandez <david.fernandez.work@googlemail.com>
To: eCos development list <ecos-devel@ecos.sourceware.org>
Subject: Compiler errors for eCos C++ files using __attribute__((init_priority(_pri_))) when compiling tests for a new Cortex-R4 hal.
Date: Wed, 07 Aug 2013 15:59:00 -0000	[thread overview]
Message-ID: <CAA6dH33ENzim2xv2gDRZTebbu2Gv1ZEhLHRkdGd94V81Ryhtew@mail.gmail.com> (raw)

Hi there,

I'm preparing a simple Cortex-R4 hal (based in the i386 and other
similar ones) meant to support only armv7 architecture in a cleaner
way than the existing arm hal.

I was compiling eCos tests (make tests) for my target with the posix
template and I'm getting some undefined symbols that appear to come
from the init_priority attribute, as undefined references to
__dso_handle:

...
arm-eabi-gcc -L/home/dfernand/tmp/ecos/lib -Ttarget.ld -o
/home/dfernand/tmp/ecos/tests/infra/current/tests/cxxsupp
tests/cxxsupp.o -mthumb -mthumb-interwork -mcpu=cortex-r4 -g -nostdlib
-Wl,-static -Wl,--fatal-warnings
/home/dfernand/tmp/ecos/lib/extras.o: In function
`__static_initialization_and_destruction_0':
/home/dfernand/dfernand_general/depot/dot11/accio/mac/ecos/packages/io/fileio/current/src/misc.cxx:103:
undefined reference to `__dso_handle'
/home/dfernand/dfernand_general/depot/dot11/accio/mac/ecos/packages/io/fileio/current/src/misc.cxx:103:
undefined reference to `__dso_handle'
/home/dfernand/dfernand_general/depot/dot11/accio/mac/ecos/packages/io/fileio/current/src/misc.cxx:123:
undefined reference to `__dso_handle'
/home/dfernand/dfernand_general/depot/dot11/accio/mac/ecos/packages/io/fileio/current/src/misc.cxx:123:
undefined reference to `__dso_handle'
/home/dfernand/tmp/ecos/lib/libtarget.a(kernel_intr.o): In function
`__static_initialization_and_destruction_0':
/home/dfernand/dfernand_general/depot/dot11/accio/mac/ecos/packages/kernel/current/src/intr/intr.cxx:71:
undefined reference to `__dso_handle'
/home/dfernand/tmp/ecos/lib/libtarget.a(kernel_intr.o):/home/dfernand/dfernand_general/depot/dot11/accio/mac/ecos/packages/kernel/current/src/intr/intr.cxx:71:
more undefined references to `__dso_handle' follow
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/lib/thumb/libsupc++.a(atexit_arm.o):
In function `__aeabi_atexit':
/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/atexit_arm.cc:35:
undefined reference to `__cxa_atexit'
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/lib/thumb/libsupc++.a(vterminate.o):
In function `__gnu_cxx::__verbose_terminate_handler()':
/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/vterminate.cc:67:
undefined reference to `_impure_ptr'
/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/vterminate.cc:67:
undefined reference to `_impure_ptr'
/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/vterminate.cc:49:
undefined reference to `_impure_ptr'
/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/vterminate.cc:49:
undefined reference to `_impure_ptr'
/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/vterminate.cc:93:
undefined reference to `_impure_ptr'
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/lib/thumb/libsupc++.a(vterminate.o):/home/arm2gcc/src/gcc-4.8.1/libstdc++-v3/libsupc++/vterminate.cc:93:
more undefined references to `_impure_ptr' follow
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/lib/thumb/libsupc++.a(cp-demangle.o):
In function `d_append_num':
/home/arm2gcc/build/gcc-4.8.1/arm-eabi/thumb/libstdc++-v3/libsupc++/cp-demangle.c:3739:
undefined reference to `sprintf'
/home/arm2gcc/build/gcc-4.8.1/arm-eabi/thumb/libstdc++-v3/libsupc++/cp-demangle.c:3739:
undefined reference to `sprintf'
/home/arm2gcc/build/gcc-4.8.1/arm-eabi/thumb/libstdc++-v3/libsupc++/cp-demangle.c:3739:
undefined reference to `sprintf'
/home/arm2gcc/build/gcc-4.8.1/arm-eabi/thumb/libstdc++-v3/libsupc++/cp-demangle.c:3739:
undefined reference to `sprintf'
/home/arm2gcc/build/gcc-4.8.1/arm-eabi/thumb/libstdc++-v3/libsupc++/cp-demangle.c:3739:
undefined reference to `sprintf'
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/lib/thumb/libsupc++.a(cp-demangle.o):/home/arm2gcc/build/gcc-4.8.1/arm-eabi/thumb/libstdc++-v3/libsupc++/cp-demangle.c:3739:
more undefined references to `sprintf' follow
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/thumb/libgcc.a(unwind-arm.o):
In function `get_eit_entry':
/home/arm2gcc/src/gcc-4.8.1/libgcc/unwind-arm-common.inc:221:
undefined reference to `__exidx_end'
/home/arm2gcc/src/gcc-4.8.1/libgcc/unwind-arm-common.inc:221:
undefined reference to `__exidx_start'
/home/arm2gcc/src/gcc-4.8.1/libgcc/unwind-arm-common.inc:221:
undefined reference to `__exidx_end'
/home/arm2gcc/src/gcc-4.8.1/libgcc/unwind-arm-common.inc:221:
undefined reference to `__exidx_start'
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/bin/ld:
/home/dfernand/tmp/ecos/tests/infra/current/tests/cxxsupp: hidden
symbol `__dso_handle' isn't defined
/home/arm2gcc/cortex-r4_gcc_481_001-binutils/lib/gcc/arm-eabi/4.8.1/../../../../arm-eabi/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [/home/dfernand/tmp/ecos/tests/infra/current/tests/cxxsupp] Error 1
make[1]: Leaving directory `/home/dfernand/tmp/ecos/infra/current'
make: *** [tests] Error 2

There are others that suggest that there are compiler support functions missing

Any ideas about why I'm getting this?

This is my compiler configuration (done following the usual ecos page
about toolchains, using the top of newlib sources for a few weeks
ago):
$ cortex-r4 gcc -v
Using built-in specs.
COLLECT_GCC=/home/arm2gcc/cortex-r4_gcc_481_001-binutils/bin/arm-eabi-gcc
COLLECT_LTO_WRAPPER=/home/arm2gcc/cortex-r4_gcc_481_001-binutils/libexec/gcc/arm-eabi/4.8.1/lto-wrapper
Target: arm-eabi
Configured with: /home/arm2gcc/src/gcc-4.8.1/configure
--target=arm-eabi --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
--with-newlib --prefix=/home/arm2gcc/cortex-r4_gcc_481_001-binutils
--with-gxx-include-dir=/home/arm2gcc/cortex-r4_gcc_481_001-binutils/arm-eabi/include
--with-mode=thumb --with-arch=armv7-r --with-cpu=cortex-r4
--with-abi=aapcs --with-float-abi=hard --with-fpu=vfpv3-d16
--enable-interwork
--with-gmp=/home/arm2gcc/cortex-r4_gcc_481_001-binutils
--with-mpfr=/home/arm2gcc/cortex-r4_gcc_481_001-binutils
--with-mpc=/home/arm2gcc/cortex-r4_gcc_481_001-binutils
Thread model: single
gcc version 4.8.1 (GCC)


Let me know if you need additional information on other stuff.

Regards

                 reply	other threads:[~2013-08-07 15:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA6dH33ENzim2xv2gDRZTebbu2Gv1ZEhLHRkdGd94V81Ryhtew@mail.gmail.com \
    --to=david.fernandez.work@googlemail.com \
    --cc=ecos-devel@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).