gccross(1)

gccross1

A tool to wrap gcc calls in cross-compile aware manner

Usage

gccross [any parameter will be forwarded to GCC]

Overview

gccross is a tool which changes pathnames of GCC command line arguments -I, -L and any standalone full qualified file name, as defined in cross-compile configuration file. The conversion rules are the same as used by dpkg-cross so in most cases use of gccross allows you not to change your Makefiles to cross-compile your application.

To use gccross without dpkg-buildpackage you have to create symlinks for your cross-compiler that point to gccross. gccross identifies your compiler and convert all calling parameters based on your configuration.

No conversion is done if the architecture is not specified. dpkg-buildpackage sets the environment variable ARCH by default so you do not have to worry about this.

Using gccross outside of the Debian build process your have to choices where the host architecture is specified, cross-compile (local and system wide) or the environment variable ARCH

# export ARCH=powerpc 
# for fn in cc cpp gcc g++; do ln -s /usr/share/dpkg-cross/bin/gccross /usr/local/bin/powerpc-linux-$fn; done 
# export GCCROSS_PREFIX=/usr/bin/ccache 

This example assumes that /usr/local/bin is in your PATH before the directory that contains real cross-compiler binary.

The GCCROSS_PREFIX environment variable makes it simple to let an secondary tool precede your compiler. In this example we use the ccache compiler cache. Without GCCROSS_PREFIX the compiler is called directly.

gccross searches in PATH for compiler executable, skipping itself automatically.

When converting arguments, gccross leaves as is any pathnames that point to GCC library directory /usr/lib/gcc-lib and it's subdirectories, as well as directories that contain headers and libraries for the target.

Files

/etc/dpkg-cross/cross-compile

Version

$Revision: 1.7 $

Releases

3 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0

Authors

Raphael Bossek <[email protected]>

Neil Williams <[email protected]>

From dpkg-cross 2.3.0.1 in Debian 5.0 (Lenny). Parsed by carta from the page's man source.