From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29594 invoked by alias); 7 Aug 2013 15:59:05 -0000 Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org Received: (qmail 29569 invoked by uid 89); 7 Aug 2013 15:59:05 -0000 X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mail-pd0-f195.google.com) (209.85.192.195) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 07 Aug 2013 15:59:04 +0000 Received: by mail-pd0-f195.google.com with SMTP id u10so617883pdi.6 for ; Wed, 07 Aug 2013 08:58:59 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.222.1 with SMTP id qi1mr1429423pac.53.1375891139229; Wed, 07 Aug 2013 08:58:59 -0700 (PDT) Received: by 10.70.50.129 with HTTP; Wed, 7 Aug 2013 08:58:59 -0700 (PDT) Date: Wed, 07 Aug 2013 15:59:00 -0000 Message-ID: Subject: Compiler errors for eCos C++ files using __attribute__((init_priority(_pri_))) when compiling tests for a new Cortex-R4 hal. From: David Fernandez To: eCos development list Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-08/txt/msg00000.txt.bz2 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