tlbuild: Cross compilation

 
 4.7 Cross compilation
 =====================
 
 In a cross compilation a "build" system is used to create binaries to be
 executed on a "host" system with different hardware and/or operating
 system.
 
    In simple cases, the build system can execute binaries for the host
 system.  This typically occurs for bi-arch systems where, e.g.,
 'i386-linux' binaries can run on 'x86_64-linux' systems and 'win32'
 binaries can run on 'win64' systems.  Although sometimes called "native
 cross", technically this is not cross compilation at all.  In most such
 cases it suffices to specify suitable compiler flags.  It might be
 useful to add the configure option '--build=HOST' to get the correct
 canonical host name, but note that this should _not_ be '--host=HOST'
 (⇒(autoconf)Hosts and Cross-Compilation).
 
    In order to build, e.g., 32-bit binaries with 'clang' on a 64-bit
 MacOSX system one could use:
 
      TL_BUILD_ENV="CC='clang -arch i386' \
        CXX='clang++ -arch i386' \
        OBJCXX='clang++ -arch i386'" \
        ./Build --build=i386-apple-darwin
 

Menu