meta data for this page
  •  

This is an old revision of the document!


Cross compilation

Variables are defined in buildroot/package/Makefile.in

  • $(TARGET_CC) - cross compiler gcc binary (i.e.: TARGET_CC=/home/user/project/out/host/usr/bin/ccache /home/user/project/out/host/usr/bin/arm-linux-gcc)
  • $(TARGET_AR) $(TARGET_AS) $(TARGET_CPP) $(TARGET_CXX) _FC _LD _NM _RANLIB _READELF _OBJCOPY _OBJDUMP
  • $(TARGET_CC_NOCCACHE)
  • $(TARGET_CXX_NOCCACHE)
  • $(TARGET_CFLAGS) - (i.e: TARGET_CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -g2)
  • $(TARGEt_CPPFLAGS)
  • $(TARGET_CXXFLAGS)
  • $(TARGET_LDFLAGS)
  • $(TARGET_MAKE_ENV) - env which has to be set for cross compilation. It overrides search path, to get cross compiler first. (i.e:PATH=“/home/user/project/out/host/bin:/home/user/project/out/host/ …)
  • $(TARGET_DIR) - device root filesystem (i.e: needed for installing packages into $(TARGET_DIR)/usr/bin)
  • $(STAGING_DIR) - development target root filesystem (contains all needed libraries to build other packages, contains debug info and not stripped binary)

Additional variables (not needed in normal use)

  • $(CCACHE) - full path to ccache binary or empty (i.e: CCACHE=/home/user/project/out/host/usr/bin/ccache)
  • $(TARGET_CROSS) - prefix with full path to cross compiler (i.e: TARGET_CROSS=/home/user/project/out/host/usr/bin/arm-linux-)
  • $(ABI) - gnueabi[hf] | eabi[hf]

Examples

CC=“$(TARGET_CC) $(TARGET_CFLAGS)