V
V
Vi Vola2019-03-19 21:59:47
QNX
Vi Vola, 2019-03-19 21:59:47

How to cross compile gcc?

I decided to build the GCC compiler here. But not just to compile, but to compile in such a way that the compiled compiler compiles the sources under QNX. Now, I'm sure what I'm going to ask is on the Internet, but I'm a little confused.
First of all, you need to build gmp , mpfr and mpc . I put them together with the option (is this correct in my case?):

HOST=x86_64-pc-nto-qnx6.5.0
--host=$HOST

Next, you need to build GCC.
I am compiling version gcc-4.8.1.
This is where I got confused. There are three options:
System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET   configure for building compilers for TARGET [HOST]

--build - platform where the sources of any program
will be built --host - specify where the compiled program will run --target
- as I understand it, this is used to specify where GCC itself will be built?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-03-19
@hakain

--build - platform where the sources of any program
will be built --host - specify where the compiled program will run --target
- as I understand it, this is used to specify where GCC itself will be built?

In relation to the toolchain
, build is the machine on which you build the toolchain. In your case configure itself will define.
- host is the machine on which the toolchain will run. In your case, this is the same as build. You may not specify.
- target is the machine for which the toolchain will generate code.
I compiled them with the option (is this correct in my case?):
HOST=x86_64-pc-nto-qnx6.5.0

It looks like the truth.
To do this, you need to understand how code generated under QNX differs from code generated under the same processor architecture, but under a different OS.
spoiler
Basically, the C library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question