Questions tagged [cross-compiling]

For general cross compiling issues, where a separate 'hosting' environment is used to build for the 'target' platform.

Cross compilation in the most general sense is simply building software on a platform that is different from the platform where the software will run.

A typical example is compiling software for an embedded system. It is usually not possible to run compilation tools on the target hardware, perhaps due to:

  • Resource constraints
  • The lack of a sufficiently functional operating system
  • The lack of a compiler to build the tools themselves

In the GNU Compiler Collection (GCC), the platform where the tool chain runs is known as the "host", and the platform where the software runs is called the "target".

4475 questions
65
votes
5 answers

what is cross compilation?

what is cross compilation?
debugger
64
votes
8 answers

How to list library dependencies of a non-native binary?

When developing for native platform, I can use ldd to list all the shared libraries (.so files) a binary executable I build will try to load upon start-up. But when cross-compiling, I don't know how to get the same information. The ldd is not a…
lvella
  • 12,754
  • 11
  • 54
  • 106
57
votes
6 answers

cross compiler ldd

I have created a cross compiled arm executable. I want to find the library dependency of the executable. I am using ubuntu natty and installed arm-linux-gnueabi tool chain, which does not contain ldd. Is there a tool available to view arm…
Talespin_Kit
  • 20,830
  • 29
  • 89
  • 135
54
votes
5 answers

C++ cross-compiler from Windows to Linux

Are there any user friendly tools out there to cross-compile from Windows to Linux?
neo_x3m
  • 595
  • 1
  • 5
  • 7
54
votes
3 answers

How to compile dts Linux device tree source files to dtb?

I have a device tree file (.dts) and I want to compile the file for my powerpc based board. How can I do it on my machine, which is not powerpc based?? Can I do it with the DTC installed on my Ubuntu system? Or will it be more like using a separate…
53
votes
7 answers

Is there an alternative to HTML?

Is there a language I can use to write my website's HTML, which: converts to HTML without having to write the HTML directly has all the power of HTML is less verbose than HTML and XML For example, it should be to HTML what CoffeeScript is to…
Alex
  • 8,518
  • 4
  • 28
  • 40
53
votes
2 answers

cmake : Set environment variables from a script

I have a script that sets all variables needed for the cross-compilation. Here is just part of it : export CONFIG_SITE=~/workspace/eldk-5.4/powerpc/site-config-powerpc-linux export CC="powerpc-linux-gcc -m32 -mhard-float…
BЈовић
  • 62,405
  • 41
  • 173
  • 273
52
votes
2 answers

Can anyone explain the gcc cross-compiler naming convention?

I have tried to understand the naming conventions behind the gcc cross-compilers, but there seems to be conflicting answers. I have the following three cross-compilers in my system: arm-none-linux-gnueabi (CodeSourcery ARM compiler for…
Leo
  • 2,328
  • 2
  • 21
  • 41
51
votes
8 answers

Cross-compilation for Raspberry Pi in GCC. Where to start?

TL/DR: Where can I find more information about building a GCC 4.7.0 cross-compiling toolchain for ARM (gnueabi) platform (intended to run on a Raspberry Pi device)? I have just got a brand new Raspberry Pi and I am very eager to start programming…
user267885
50
votes
1 answer

How to build an OCaml cross compiler

After finding a way to generate the fitting configuration files for the target machine, the cross compiler itself must still be built. The approach using the 1 1/2 build described here (and, with more details, here) does not seem to work if the host…
Percival Ulysses
  • 1,133
  • 11
  • 18
49
votes
4 answers

ffmpeg for a android (using tutorial: "ffmpeg and Android.mk")

I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial? I am not sure how…
Matthias
  • 491
  • 1
  • 5
  • 3
48
votes
5 answers

How to cross compile from Windows to Linux?

I've installed Go 1.2 on a Windows machine, wrote up a dummy program and set the environment variables GOARCH and GOOS to "AMD64" and "linux" respectively. When i issue the "go build" command, i receive an error: go build runtime: linux/amd64 must…
Dante
  • 10,722
  • 16
  • 51
  • 63
47
votes
8 answers

Embed resources (eg, shader code; images) into executable/library with CMake

I am writing an application in C++ which relies on various resources in my project. Right now, I have the relative path from the produced executable to each resource hard-coded in my sources, and that allows my program to open the files and read in…
Nicu Stiurca
  • 8,747
  • 8
  • 40
  • 48
46
votes
1 answer

When using CGO_ENABLED is must and what happens

Question Please help understand when CGO_ENABLED is must and unavoidable, and what happens with the go compilation process. When CGO_ENABLED is must After having read the articles in references, it looks as far as go has cross-compile native support…
mon
  • 18,789
  • 22
  • 112
  • 205
44
votes
2 answers

CMake: specifying build toolchain

Very new to CMake, and so far I'm finding it to be extremely helpful. I have a set of custom libraries that I would like to build for multiple platforms using cross-compilation. The toolchains are installed, and I can hand-create the Makefiles that…
Will
  • 3,500
  • 4
  • 30
  • 38