Build cross toolchain for arm

86 views
Skip to first unread message

Macleod Chang

unread,
Jul 2, 2014, 10:17:32 PM7/2/14
to native-cli...@googlegroups.com

 Hi everyone,

   I'm building cross toolchain for arm on ubuntu 12.04 x86_64 without using nacl_sdk build for some change.
   This arm-nacl cross toolchain should run on x86_64 platform and build code for arm.
   I made some change as below, and here is the gcc compile error message on dbxout.c. 
   Did I miss anything to build this toolchain? Thanks!

   native_client/tools/Makefile:
     CROSSARCH = arm-nacl
     BITSPLATFORM = 32
     LIB_BITS ?= 32

   Error Message:
     /home/test/nacl/native_client/tools/SRC/gcc/gcc/dbxout.c: In function ‘dbxout_symbol_location’:
     /home/test/nacl/native_client/tools/SRC/gcc/gcc/dbxout.c:2977:16: error: ‘TARGET_64BIT’ undeclared (first use in this function)
     /home/test/nacl/native_client/tools/SRC/gcc/gcc/dbxout.c:2977:16: note: each undeclared identifier is reported only once for each function it appears in
     /home/test/nacl/native_client/tools/SRC/gcc/gcc/dbxout.c:2977:16: error: ‘dbx64_register_map’ undeclared (first use in this function)
     /home/test/nacl/native_client/tools/SRC/gcc/gcc/dbxout.c:2977:16: error: ‘svr4_dbx_register_map’ undeclared (first use in this function) 


Roland McGrath

unread,
Jul 6, 2014, 9:51:34 PM7/6/14
to native-cli...@googlegroups.com
The tools/Makefile code is wholly unrelated to anything about the tools that target ARM.

See toolchain_build/toolchain_build.py.  If you invoke that as is on an x86-64 Linux system, it will try to build for several hosts, x86_64-linux among them.  With appropriate arguments (or editting the file) you can narrow that down to build only the pieces you are interesting in.

Macleod Chang

unread,
Jul 7, 2014, 5:24:39 AM7/7/14
to native-cli...@googlegroups.com

 I found the problem, the gcc version for arm is 4.8.3 not 4.4.3 according to pepper sdk.
 There is no nacl definition for arm in gcc 4.4.3, now I'm trying to build with newlib.
 

Roland McGrath於 2014年7月7日星期一UTC+8上午9時51分34秒寫道:

Felix Kam

unread,
Jul 11, 2014, 1:37:42 AM7/11/14
to native-cli...@googlegroups.com
Hi Macleod, 

Did you have any luck ?
I am also trying to build the arm toolchain, and have been pretty stuck.

Cheers,
Felix

Roland McGrath

unread,
Jul 11, 2014, 12:24:04 PM7/11/14
to native-c...@googlegroups.com, Felix Kam, Macleod Chang
[I've moved native-client-discuss to BCC.  Please use native-client-dev for this sort of question.  Developers generally use the SDK rather than trying to build the toolchains themselves.  This discussion is of more interest to people hacking on the Native Client implementation itself, for which native-client-dev is the right group.]

You can find everything in the native_client source tree available via svn or git (git is recommended).  To get the source tree, start with http://dev.chromium.org/developers/how-tos/install-depot-tools so you have the 'gclient' and 'fetch' tools available.  Then you just run 'fetch nacl' in an empty directory and it will get you set up with a git checkout.  From there, go into native_client/ and then you will find toolchain_build/toolchain_build.py therein.  You can run that script to build the ARM toolchains (it will try to build for several hosts), or just read it to see the steps that are involved.  If you run 'python toolchain_build/toolchain_build.py -y patches' then it will build just the "patches" component (look in toolchain_build/out/patches_install when it finishes) and that will show you what we are using relative to the upstream baselines.

We are using upstream binutils unmodified, though you need to use a snapshot from the 2.24 release branch made after the 2.24 release.
We are using a GCC based on 4.8.3, but with modifications that are not (yet) upstream.
We are using a newlib based on the upstream trunk, but heavily modified.

The patches are an easy way to see our baselines and our differences from upstream.
But you might want instead just to build the various components by checking out from our git repositories directly (that's what toolchain_build.py does).
The exact repository URLs can be found in toolchain_build.py.

Felix said he was "stuck", but didn't give any information about what he tried and what problems he had.  If you haven't looked at toolchain_build.py yet, then you aren't really trying.  If you've followed everything I said above and are having specific issues, then you need to post the details before anyone can help you.


Thanks,
Roland
Reply all
Reply to author
Forward
0 new messages