Building for RTEMS ARM

339 views
Skip to first unread message

Chris Johns

unread,
Jan 21, 2015, 1:04:25 AM1/21/15
to prot...@googlegroups.com
Hello,

I am building Protocol Buffers from github for RTEMS (http://www.rtems.org/) to run on a Xilinx Zynq (ARM CortexA9) and I am making some progress but I have some questions.

I am using the current development head for RTEMS which is called 4.11 and it is stable and almost about to be released. The gcc is:

$ arm-rtems4.11-gcc -v
Using built-in specs.
COLLECT_GCC
=/opt/work/rtems/4.11/bin/arm-rtems4.11-gcc
COLLECT_LTO_WRAPPER
=/opt/work/rtems/4.11/libexec/gcc/arm-rtems4.11/4.9.2/lto-wrapper
Target: arm-rtems4.11
Configured with: ../gcc-4.9.2/configure --prefix=/opt/work/rtems/4.11 --bindir=/opt/work/rtems/4.11/bin --exec_prefix=/opt/work/rtems/4.11 --includedir=/opt/work/rtems/4.11/include --libdir=/opt/work/rtems/4.11/lib --libexecdir=/opt/work/rtems/4.11/libexec --mandir=/opt/work/rtems/4.11/share/man --infodir=/opt/work/rtems/4.11/share/info --datadir=/opt/work/rtems/4.11/share --build=x86_64-freebsd10.0 --host=x86_64-freebsd10.0 --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: rtems
gcc version
4.9.2 20141030 (RTEMS 4.11, RSB e7cbf74fe2c94f0a233b8a7efcac3e75c239333c, Newlib de616601501c4f82968683e80c112604a2d40222) (GCC)


The first are errors related to Atromics. We are adding -fpermissive to make then warning. Here are a few of the many warnings we are seeing:

                 from ../../protobuf.git/src/google/protobuf/arenastring.h:40,
                 
from ../../protobuf.git/src/google/protobuf/descriptor.pb.h:23,
                 
from ../../protobuf.git/src/google/protobuf/compiler/ruby/ruby_generator.cc:36:
../../protobuf.git/src/google/protobuf/stubs/once.h: In function 'void google::protobuf::GoogleOnceInit(google::protobuf::ProtobufOnceType*, void (*)())':
../../protobuf.git/src/google/protobuf/stubs/once.h:125:34: warning: invalid conversion from 'google::protobuf::ProtobufOnceType* {aka int*}' to 'const volatile Atomic32* {aka const volatile long int*}' [-fpermissive]
 
if (internal::Acquire_Load(once) != ONCE_STATE_DONE) {
                                 
^

In file included from ../../protobuf.git/src/google/protobuf/stubs/atomicops.h:205:0,
                 
from ../../protobuf.git/src/google/protobuf/stubs/atomic_sequence_num.h:33,
                 
from ../../protobuf.git/src/google/protobuf/arena.h:38,
                 
from ../../protobuf.git/src/google/protobuf/descriptor.pb.h:22,
                 
from ../../protobuf.git/src/google/protobuf/compiler/ruby/ruby_generator.cc:36:
../../protobuf.git/src/google/protobuf/stubs/atomicops_internals_arm_gcc.h:136:17: note: initializing argument 1 of 'google::protobuf::internal::Atomic32 google::protobuf::internal::Acquire_Load(const volatile Atomic32*)'


The other issue is RTEMS is not self hosting and so always cross-compiled. Is there a way to disable running tests ? It makes no sense to run the tests when the build and host are not the same.

Thanks

Chris

Chris Johns

unread,
Jan 22, 2015, 11:05:08 PM1/22/15
to prot...@googlegroups.com
Following up my own post ...


On Wednesday, January 21, 2015 at 5:04:25 PM UTC+11, Chris Johns wrote:


The first are errors related to Atromics. We are adding -fpermissive to make then warning. Here are a few of the many warnings we are seeing:

                 from ../../protobuf.git/src/google/protobuf/arenastring.h:40,
                 
from ../../protobuf.git/src/google/protobuf/descriptor.pb.h:23,
                 
from ../../protobuf.git/src/google/protobuf/compiler/ruby/ruby_generator.cc:36:
../../protobuf.git/src/google/protobuf/stubs/once.h: In function 'void google::protobuf::GoogleOnceInit(google::protobuf::ProtobufOnceType*, void (*)())':
../../protobuf.git/src/google/protobuf/stubs/once.h:125:34: warning: invalid conversion from 'google::protobuf::ProtobufOnceType* {aka int*}' to 'const volatile Atomic32* {aka const volatile long int*}' [-fpermissive]
 
if (internal::Acquire_Load(once) != ONCE_STATE_DONE) {
                                 
^

In file included from ../../protobuf.git/src/google/ 


I have tracked the warnings down to a gcc/newlib interaction as described here https://sourceware.org/ml/newlib/2014/msg00724.html. We are now using this code as part of the test to see if we have cleaned things up.

This warning and the atomic code has made me wonder why c11 is not checked for and <stdatomic.h> used or even c++11 used where possible ?

Chris
Reply all
Reply to author
Forward
0 new messages