[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make for cross-compilation/Feature Request, not Bug Report

From: Schwarz, Konrad
Subject: Make for cross-compilation/Feature Request, not Bug Report
Date: Tue, 18 Jul 2006 10:37:13 +0200


the GNU GCC and Binutils packages have the following feature: when
compiled for cross compilation, e.g., for
they are compiled with the names $TARGET-gcc, $TARGET-nm, etc.  Various
programs such as the compiler driver, the linker etc. automatically
change their search paths, such as the standard include or library
directories, which basically change from $PREFIX/lib to
$PREFIX/$TARGET/lib etc.

In general, make is oblivious to these changes, and has predefined
macros, such as CC, etc. to allow a single Makefile to be used for
several environments, both hosted and cross-compilation.

However, the Info node (make.info)Libraries/Search documents the
"Directory Search for Link Libraries" feature.  This feature does not
extend to cross compilation environments: make does not take a possible
cross-compilation environment into account.  That is, the compiled-in
path /lib, /usr/lib, and PREFIX/lib is not changed to e.g.,
PREFIX/TARGET/lib.  Makefiles that use the feature will require rework
for cross-compilation environments, which is a shame.

It does not seem difficult to extend the current feature to work in
cross-compilation environments.  E.g., the name of the executable could
be examined to determine if it was invoked with a base name of XXX-make
and to use XXX as the prefix.  At the same time, the location of the
executable would need to be determined to instantiate PREFIX.

By referring to the same executable by different names (multiple hard
links to the file), different cross compilation environments could be
supported by one executable.

A related change would be to instantiate the predefined macros such as
CC from gcc to $TARGET-gcc in those cases where CC is initialized to


Konrad Schwarz

Attachment: Konrad Schwarz.vcf
Description: Konrad Schwarz.vcf

reply via email to

[Prev in Thread] Current Thread [Next in Thread]