Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20c55f25 authored by Sebastian Schmidt's avatar Sebastian Schmidt Committed by Gerrit Code Review
Browse files

Support for more specific toolchain versions

This adds support for more specific versions of a given prebuilt
toolchain. In addition to $(HOST_PREBUILT_TAG) (like darwin-ppc or
linux-x86) a new $(HOST_PREBUILT_EXTRA_TAG) is introduced containing (so
far) the number of address bits (32/64) for the build host or the same
value as $(HOST_PREBUILT_TAG) if this could not be determined.

Subsequently everything in the building process that needs to determine
the full path for a prebuilt tool should check with
$(HOST_PREBUILT_EXTRA_TAG) first and then fall back to
$(HOST_PREBUILT_TAG).

The advantage for the user is that she can place a 64-bit or a 32-bit
version of, say, gcc and binutils next to the default prebuilts without
messing around with the directory structure, repo manifest and having a
working fallback to the default binaries.

Long story short: To make Jelly Bean build on 32-bit hosts again,
something like
 <project
  name="yath/android_prebuilts_gcc_linux-x86-32_arm_arm-linux-androideabi-4.6"
  path="prebuilts/gcc/linux-x86-32/arm/arm-linux-androideabi-4.6" />
can be added to local_manifest.xml. make will pick the 32-bit versions
of gcc and binutils instead of trying to run the new 64-bit ones.

Change-Id: I89ed0f00eda1a0bebbc35f39af4bbf0e97f6fade
parent f6e7f9bb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -43,7 +43,11 @@ include $(TARGET_ARCH_SPECIFIC_MAKEFILE)

# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
ifneq ($(strip $(wildcard prebuilts/gcc/$(HOST_PREBUILT_EXTRA_TAG)/arm/arm-linux-androideabi-4.6)),)
TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_EXTRA_TAG)/arm/arm-linux-androideabi-4.6
else
TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6
endif
TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/arm-linux-androideabi-
endif

+4 −0
Original line number Diff line number Diff line
@@ -19,7 +19,11 @@

# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
ifneq ($(strip $(wildcard prebuilt/$(HOST_PREBUILT_EXTRA_TAG)/toolchain/sh-4.3.3)),)
TARGET_TOOLCHAIN_ROOT := prebuilt/$(HOST_PREBUILT_EXTRA_TAG)/toolchain/sh-4.3.3
else
TARGET_TOOLCHAIN_ROOT := prebuilt/$(HOST_PREBUILT_TAG)/toolchain/sh-4.3.3
endif
TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/sh-linux-gnu-
endif

+4 −0
Original line number Diff line number Diff line
@@ -36,7 +36,11 @@ include $(TARGET_ARCH_SPECIFIC_MAKEFILE)

# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
ifneq ($(strip $(wildcard prebuilts/gcc/$(HOST_PREBUILT_EXTRA_TAG)/x86/i686-android-linux-4.4.3)),)
TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_EXTRA_TAG)/x86/i686-android-linux-4.4.3
else
TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-android-linux-4.4.3
endif
TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/i686-android-linux-
endif

+11 −3
Original line number Diff line number Diff line
@@ -66,9 +66,17 @@ ifneq ($(USE_CCACHE),)
  ifeq ($(HOST_OS)-$(BUILD_OS),windows-linux)
    CCACHE_HOST_TAG := linux-$(BUILD_ARCH)
  endif
  CCACHE_HOST_EXTRA_TAG := $(subst $(HOST_PREBUILT_TAG),$(CCACHE_HOST_TAG),$(HOST_PREBUILT_EXTRA_TAG))

  # search executable
  ifneq ($(strip $(wildcard prebuilts/misc/$(CCACHE_HOST_EXTRA_TAG)/ccache/ccache)),)
    ccache := prebuilts/misc/$(CCACHE_HOST_EXTRA_TAG)/ccache/ccache
  else
    ifneq ($(strip $(wildcard prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache)),)
      ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache
  # Check that the executable is here.
  ccache := $(strip $(wildcard $(ccache)))
    endif
  endif

  ifdef ccache
    # prepend ccache if necessary
    ifneq ($(ccache),$(firstword $($(combo_target)CC)))
+4 −0
Original line number Diff line number Diff line
@@ -327,7 +327,11 @@ endif
ifeq ($(HOST_OS),darwin)
dir := $(HOST_OS)-$(HOST_ARCH)
endif
ifneq ($(strip $(wildcard prebuilt/$(HOST_PREBUILT_EXTRA_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX))),)
OLD_FLEX := prebuilt/$(HOST_PREBUILT_EXTRA_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX)
else
OLD_FLEX := prebuilt/$(HOST_PREBUILT_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX)
endif

ifeq ($(HOST_OS),darwin)
# Mac OS' screwy version of java uses a non-standard directory layout
Loading