diff mbox

toolchain/build: Fix Linaro Android toolchain linking fail with FDO

Message ID AANLkTinkdu6rxHirnzbvT0ayi1XuJmwrmLgFJbRTBjL-@mail.gmail.com
State New
Headers show

Commit Message

Meng-Hsuan Cheng March 25, 2011, 3:19 a.m. UTC
Add --with-sysroot to fix Linaro Android toolchain linking fail with FDO

---
 linaro-build.sh |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

   echo "  --apply-gcc-patch=<yes|no>  Apply Linaro's extra gcc-patches
[no]"
   echo "  --help                      Print this help message"
   echo
@@ -134,6 +136,9 @@ while [ $# -gt 0 ]; do
     --with-gcc=*)
       ARG_WITH_GCC="${ARG#*=}"
       ;;
+    --with-sysroot=*)
+      ARG_WITH_SYSROOT="${ARG#*=}"
+      ;;
     --apply-gcc-patch=yes | --apply-gcc-patch=no)
       ARG_APPLY_PATCH="${ARG#*=}"
       ;;
@@ -149,6 +154,7 @@ done
 BUILD_ARCH=`uname -m`
 BUILD_WITH_LOCAL=
 BUILD_HOST=
+BUILD_SYSROOT=

 if [ "${ARG_TOOLCHAIN_SRC_DIR}" = "" ] || [ ! -f
"${ARG_TOOLCHAIN_SRC_DIR}/build/configure" ] ; then
   error "--toolchain-src-dir is not set or ${ARG_TOOLCHAIN_SRC_DIR} is not
ANDROID_TOOLCHAIN_ROOT"
@@ -158,6 +164,13 @@ if [ "${ARG_WITH_GCC}" = "" ]; then
   error "Must specify --with-gcc to build toolchain"
 fi

+if [ "${ARG_WITH_SYSROOT}" != "" ]; then
+  if [ ! -d "${ARG_WITH_SYSROOT}" ]; then
+    error "SYSROOT ${ARG_WITH_SYSROOT} not exist"
+  fi
+  BUILD_SYSROOT="--with-sysroot=${ARG_WITH_SYSROOT}"
+fi
+
 getGCCFrom $ARG_WITH_GCC

 if [ "x${ARG_APPLY_PATCH}" = "xyes" ]; then
@@ -172,7 +185,6 @@ if [ "x${ARG_APPLY_PATCH}" = "xyes" ]; then
   cd -
 fi

-
 GCC_VARIANT=`basename ${ARG_LINARO_GCC_SRC_DIR}`
 GCC_VARIANT=${GCC_VARIANT#gcc-*}

@@ -190,6 +202,7 @@ ${ARG_TOOLCHAIN_SRC_DIR}/build/configure \
   --prefix=${ARG_PREFIX_DIR} --target=arm-eabi \
   --disable-docs --disable-nls \
   --host=${BUILD_HOST} --build=${BUILD_HOST} \
+  ${BUILD_SYSROOT} \
   --with-gcc-version=${GCC_VARIANT} \
   --with-binutils-version=2.20.1 \
   --with-gmp-version=4.2.4 \

Comments

Jim Huang March 28, 2011, 8:10 p.m. UTC | #1
On 25 March 2011 11:19, Luse Cheng <luse@0xlab.org> wrote:
> Add --with-sysroot to fix Linaro Android toolchain linking fail with FDO
> ---
>  linaro-build.sh |   15 ++++++++++++++-
>  1 files changed, 14 insertions(+), 1 deletions(-)

hi Luse,

It looks great.  I will check in.

However, do you think it is reasonable to enable --with-sysroot by
default? (we can maintain sysroot somewhere at linaro.org.)  Please
consider the case when we would like to release Linaro edition of
Android Toolchain.

Regards,
-jserv
diff mbox

Patch

diff --git a/linaro-build.sh b/linaro-build.sh
index f238ba8..97da183 100755
--- a/linaro-build.sh
+++ b/linaro-build.sh
@@ -20,6 +20,7 @@  ARG_WGET_LINARO_GCC_SRC=
 ARG_BZR_LINARO_GCC_SRC=

 ARG_WITH_GCC=
+ARG_WITH_SYSROOT=

 ARG_APPLY_PATCH=no

@@ -53,6 +54,7 @@  usage() {
   echo "  --prefix=<path>             Specify installation path
[/tmp/android-toolchain-eabi]"
   echo "  --toolchain-src=<path>      Toolchain source directory [`dirname
$PWD`]"
   echo "  --with-gcc=<path>           Specify GCC source (support:
directory, bzr, url)"
+  echo "  --with-sysroot=<path>       Specify SYSROOT directory"