C++ Constructor Initialization Failure for Cortex-A8

Thomas Kim thomas73.kim at gmail.com
Mon Dec 1 08:18:14 UTC 2014


Dear Sebastian,

Thank you for confirmation.

I used old RTEMS 4.10.99 with GCC 4.8.2(RSB).
Do you mean that I should update both lastest RTEMS 4.10.99 source with GCC
4.8.3(RSB) ?

Best Regards,
Thomas Kim


2014-12-01 17:14 GMT+09:00 Sebastian Huber <
sebastian.huber at embedded-brains.de>:

>  Hello,
>
> this test works fine with the latest RTEMS on arm/realview_pbx_a9_qemu, so
> I guess this is a BSP specific problem:
>
> realview_pbx_a9_qemu -i
> ./build/arm-rtems4.11-realview_pbx_a9_qemu/cxx/cxx_throw/cxx_throw.exe
> qemu-system-arm is /opt/qemu/bin/qemu-system-arm
> Hey I'm in base class constructor number 1 for 0x201dc4.
> Hey I'm in base class constructor number 2 for 0x201dcc.
> Hey I'm in derived class constructor number 3 for 0x201dcc.
>
>
> *** CONSTRUCTOR/DESTRUCTOR TEST ***
> Hey I'm in base class constructor number 4 for 0x20d304.
> Hey I'm in base class constructor number 5 for 0x20d2fc.
> Hey I'm in base class constructor number 6 for 0x20d2f4.
> Hey I'm in base class constructor number 7 for 0x20d2ec.
> Hey I'm in derived class constructor number 8 for 0x20d2ec.
> Testing a C++ I/O stream
> before try block
> Got it: Raising this
> catch got called, exception handling worked !!!
> Hey I'm in derived class destructor number 8 for 0x20d2ec.
> Derived class - Instantiation order 8
> Hey I'm in base class destructor number 7 for 0x20d2ec.
> Instantiation order 8
> Hey I'm in base class destructor number 6 for 0x20d2f4.
> Instantiation order 6
> Hey I'm in base class destructor number 5 for 0x20d2fc.
> Instantiation order 5
> Hey I'm in base class destructor number 4 for 0x20d304.
> Instantiation order 5
> *** END OF CONSTRUCTOR/DESTRUCTOR TEST ***
>
>
> Hey I'm in derived class destructor number 3 for 0x201dcc.
> Derived class - Instantiation order 3
> Hey I'm in base class destructor number 2 for 0x201dcc.
> Instantiation order 3
> Hey I'm in base class destructor number 1 for 0x201dc4.
> Instantiation order 1
>
> On 01/12/14 08:59, Thomas Kim wrote:
>
> Dear Sebastian,
>
>  I tested cxx_throw.exe. in my case, I successed to build cxx_throw.exe.
> After run cxx_throw.exe, my problem is occurred.
>
>  Best Regards,
> Thomas Kim
>
> 2014-12-01 16:45 GMT+09:00 Sebastian Huber <
> sebastian.huber at embedded-brains.de>:
>
>>  Hello,
>>
>> what is the name of the failing test?  Is this cxx_throw.exe?
>>
>> There seems to be also a build problem for the examples-v2:
>>
>> Waf: Entering directory
>> `/home/sh/git-rtems-examples-v2/build/arm-rtems4.11-realview_pbx_a9_qemu'
>> [  4/116] FilesystemImage:  -> file_io/crc/FilesystemImage
>> [  5/116] bin2c: file_io/crc/FilesystemImage ->
>> file_io/crc/FilesystemImage.c file_io/crc/FilesystemImage.h
>> [ 22/116] c: file_io/crc/FilesystemImage.c ->
>> build/arm-rtems4.11-realview_pbx_a9_qemu/file_io/crc/FilesystemImage.c.2.o
>> [115/116] rtrace:
>> build/arm-rtems4.11-realview_pbx_a9_qemu/hello/both_hello/test.c.2.o ->
>> build/arm-rtems4.11-realview_pbx_a9_qemu/hello/both_hello/hello-deep.texe
>> [115/116] cprogram:
>> build/arm-rtems4.11-realview_pbx_a9_qemu/file_io/crc/init.c.2.o
>> build/arm-rtems4.11-realview_pbx_a9_qemu/file_io/crc/crc_32.c.2.o
>> build/arm-rtems4.11-realview_pbx_a9_qemu/file_io/crc/FilesystemImage.c.2.o
>> -> build/arm-rtems4.11-realview_pbx_a9_qemu/file_io/crc/crc.exe
>> [116/116] rtrace:
>> build/arm-rtems4.11-realview_pbx_a9_qemu/hello/both_hello/test.c.1.o ->
>> build/arm-rtems4.11-realview_pbx_a9_qemu/hello/both_hello/both_hello.texe
>> /opt/rtems-4.11/bin/arm-rtems4.11-gcc:  hello-test.o: In function
>> `__wrap_Init':
>> /opt/rtems-4.11/bin/arm-rtems4.11-gcc:
>> /home/sh/git-rtems-examples-v2/build/arm-rtems4.11-realview_pbx_a9_qemu/
>> hello-test.c:70: undefined reference to `Init'
>> /opt/rtems-4.11/bin/arm-rtems4.11-gcc: collect2: error: ld returned 1
>> exit status
>> error: linking: Linker error
>> /opt/rtems-4.11/bin/arm-rtems4.11-gcc:  hello-deep.o: In function
>> `__wrap_Init':
>> /opt/rtems-4.11/bin/arm-rtems4.11-gcc:
>> /home/sh/git-rtems-examples-v2/build/arm-rtems4.11-realview_pbx_a9_qemu/
>> hello-deep.c:78: undefined reference to `Init'
>> /opt/rtems-4.11/bin/arm-rtems4.11-gcc: collect2: error: ld returned 1
>> exit status
>> error: linking: Linker error
>> Waf: Leaving directory
>> `/home/sh/git-rtems-examples-v2/build/arm-rtems4.11-realview_pbx_a9_qemu'
>> Build failed
>>  -> task in 'both_hello.texe' failed (exit status 10):
>>         {task 17773776: rtrace test.c.1.o -> both_hello.texe}
>> ['/opt/rtems-4.11/bin/rtems-tld', '-W hello-test', '-C',
>> '../../hello/both_hello/hello.ini', '-r', '/opt/rtems-4.11', '-B',
>> 'arm/realview_pbx_a9_qemu', '-c', '/opt/rtems-4.11/bin/arm-rtems4.11-gcc',
>> '-l', '/opt/rtems-4.11/bin/arm-rtems4.11-gcc', '--',
>> 'hello/both_hello/test.c.1.o', '-qrtems',
>> '-B/opt/rtems-4.11/arm-rtems4.11/lib/',
>> '-B/opt/rtems-4.11/arm-rtems4.11/realview_pbx_a9_qemu/lib/', '--specs',
>> 'bsp_specs', '-march=armv7-a', '-march=armv7-a', '-mthumb', '-mthumb',
>> '-mfpu=neon', '-mfpu=neon', '-mfloat-abi=hard', '-mfloat-abi=hard',
>> '-mtune=cortex-a9', '-mtune=cortex-a9', '-o',
>> '/home/sh/git-rtems-examples-v2/build/arm-rtems4.11-realview_pbx_a9_qemu/hello/both_hello/both_hello.texe',
>> '-Wl,-Bstatic']
>>  -> task in 'hello-deep.texe' failed (exit status 10):
>>         {task 17774032: rtrace test.c.2.o -> hello-deep.texe}
>> ['/opt/rtems-4.11/bin/rtems-tld', '-W hello-deep', '-C',
>> '../../hello/both_hello/hello-deep.ini', '-r', '/opt/rtems-4.11', '-B',
>> 'arm/realview_pbx_a9_qemu', '-c', '/opt/rtems-4.11/bin/arm-rtems4.11-gcc',
>> '-l', '/opt/rtems-4.11/bin/arm-rtems4.11-gcc', '--',
>> 'hello/both_hello/test.c.2.o', '-qrtems',
>> '-B/opt/rtems-4.11/arm-rtems4.11/lib/',
>> '-B/opt/rtems-4.11/arm-rtems4.11/realview_pbx_a9_qemu/lib/', '--specs',
>> 'bsp_specs', '-march=armv7-a', '-march=armv7-a', '-mthumb', '-mthumb',
>> '-mfpu=neon', '-mfpu=neon', '-mfloat-abi=hard', '-mfloat-abi=hard',
>> '-mtune=cortex-a9', '-mtune=cortex-a9', '-o',
>> '/home/sh/git-rtems-examples-v2/build/arm-rtems4.11-realview_pbx_a9_qemu/hello/both_hello/hello-deep.texe',
>> '-Wl,-Bstatic']
>>
>> On 01/12/14 05:26, Thomas Kim wrote:
>>
>> Dear Sir,
>>
>>  I am testing cxx example including C++ global constructor in example-v2
>> on Cortex-A8 based board.
>>
>>  As I remembered in csae of using cxx example on Sparc SIS, I resolved
>> this after removing below options according to your comment.
>>    CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
>>   LDFLAGS = -Wl,--gc-sections
>>
>>  But, when I test same cxx example on ARM Cortex-A8 board, I have
>> similar problem as like below;
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>  terminate called after throwing an instance of
>> '__gnu_cxx::__concurrence_lock_error'
>>   what():  __gnu_cxx::__concurrence_lock_error
>>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>  At this time, I used below config options for Cortex-A8.
>>  CPU_CFLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon
>> -mfloat-abi=softfp
>> CFLAGS_OPTIMIZE_V ?= -O2 -g
>>
>>  also, I am using RSB GCC 4.8.2 as like below;
>>
>>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>  Target: arm-rtems4.11
>> Configured with: ../gcc-4.8.2/configure --prefix=/opt/rtems-4.11
>> --bindir=/opt/rtems-4.11/bin --exec_prefix=/opt/rtems-4.11
>> --includedir=/opt/rtems-4.11/include --libdir=/opt/rtems-4.11/lib
>> --libexecdir=/opt/rtems-4.11/libexec --mandir=/opt/rtems-4.11/share/man
>> --infodir=/opt/rtems-4.11/share/info --datadir=/opt/rtems-4.11/share
>> --build=i686-linux-gnu --host=i686-linux-gnu --target=arm-rtems4.11
>> --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --verbose --with-newlib
>> --with-system-zlib --disable-nls --without-included-gettext
>> --disable-win32-registry --enable-version-specific-runtime-libs
>> --disable-lto --enable-newlib-io-c99-formats --enable-newlib-iconv
>> --enable-newlib-iconv-encodings=big5,cp775,cp850,cp852,cp855,cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,win_1253,win_1254,win_1255,win_1256,win_1257,win_1258
>> --enable-threads --disable-plugin --enable-obsolete --enable-languages=c,c++
>> Thread model: posix
>> gcc version 4.8.2 20131016 (RTEMS
>> 4.11-RSB-40d25dc8fe6da6b93b295d9b42632c1d3338a97a-1,gcc-4.8.2/newlib-2.1.0)
>> (GCC)
>>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>  Please let me  know how to resolve this problem ?
>>
>>  Thomas Kim
>>
>>
>>
>>
>>
>> _______________________________________________
>> users mailing listusers at rtems.orghttp://lists.rtems.org/mailman/listinfo/users
>>
>>
>> --
>> Sebastian Huber, embedded brains GmbH
>>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany
>> Phone   : +49 89 189 47 41-16
>> Fax     : +49 89 189 47 41-09
>> E-Mail  : sebastian.huber at embedded-brains.de
>> PGP     : Public key available on request.
>>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>>
>>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20141201/663c348f/attachment.html>


More information about the users mailing list