Jump to content

Cross-compilation environment for H3? (Orange Pi Lite / Jessie)


tarkin000

Recommended Posts

Hello every one,

  I have used crosstool-ng on my Jessie server (x86), and downloaded the linaro toolchain for my Ubuntu (x64 / 16.04) laptop, but ran into a wall both times: the cross-compilers won't (and now that I think about it, can't) link to the host libraries.

 

Do I simply get all the sources for the libraries I want/need, and adjust their configure parameters to point to dedicated directory, and then build my target? Is there an easy way to manage the versions / dependencies to match Jessie (the version on my target OPi)?

 

I am trying to compile Duktape with libreadline, if that matters.

 

Thanks,

  Steve

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

I sort of solved it. I switched from using readline to linenoise, and that killed my having to set up some sort of repository or chroot for Debian packages (more below).

As linenoise, Duktape, and a single header are all my binary needs, it now builds with my crosstool-ng compiler and a simple Makefile.

I created a handy shell wrapper called armbian-gcc that adjusts paths before invoking gcc.

 

I was able to make some headway with the libreadline6-dev package:

crosstool-ng creates a directory for every toolchain, usually in ~/x-tool

This toolchain directory, and its sub-directories, are readonly; a quick chmod fixes this.

I created a sub-directory named 'pkgs', and from there I used apt-get source libreadline6-dev,

which handily works without being root, as it downloads to whatever directory you are in.

Then, I invoked configure like this:

CC=arm-unknown-linux-gnueabihf-gcc ./configure --prefix=/home/foo/x-tool/arm-unknown-linux-gnueabihf --build=i686-linux-gnu --host=arm-unknown-linux-gnueabihf

Then, make, and make install as usual.

By setting the prefix, the library gets installed to ~/x-tool/<toolchain>/lib, and headers in ~/x-tool/<toolchain>/include,

which are accessed by default when compiling with the toolchain.

At this point, I hit a snag with not having built termcap, which is when I decided to go with linenoise.

 

Theoretically, as long as you calculate the dependencies yourself (with the help of the Debian Jessie package lists),

you can build any Jessie package for Arm on any host with a working crosstool-ng. I imagine targeting Ubuntu is much the same-

calculate the dependencies, fetch the sources matching your target version, configure with CC,--build,--host, and --prefix, make, install.

 

Hope this helps someone else.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines