Skip to content
Advertisement

gdb can’t cross-compile for arm-linux

The Linux already having both gcc & arm-gcc in the environment path:

JavaScript

So I configure the gdb 6.6:

JavaScript

compiled without error, but looks like gdb used the wrong compiler.

JavaScript

So How to indicate the correct CC for gdb?

I tried make CC=arm-none-linux-gnueabi-gcc, but will get the error:

JavaScript

Advertisement

Answer

JavaScript

Don’t use --target. It means something else to Autotools.

Use --build and --host. Something like:

JavaScript

--build should specify the machine you are running Autotools on, and --host should specify the machine the package will run on.

Note there is some Autootols bug that requires you to specify both --build and --host. It is yet another Autotools problem that has never been fixed.

Also see 2.2.8, Cross-Compilation in the Autools manual.

You will still need to get the paths and sysroot right, but this should provide the proper configure command so things begin to fail as expected.


config.guess will return a triplet for the machine you are running Autotools on:

JavaScript

If you find the package has one but it is out of date you can update it with the following command. You usually need to do this for AIX and Solaris machines.

JavaScript

And you can update config.sub the same way:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement