From patchwork Fri Mar 25 03:19:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng-Hsuan Cheng X-Patchwork-Id: 775 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:43 -0000 Delivered-To: patches@linaro.org Received: by 10.42.161.68 with SMTP id s4cs149165icx; Thu, 24 Mar 2011 20:19:08 -0700 (PDT) Received: by 10.43.69.199 with SMTP id yd7mr412269icb.370.1301023147919; Thu, 24 Mar 2011 20:19:07 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id f8si1432357ibb.88.2011.03.24.20.19.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2011 20:19:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of luse@0xlab.com) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of luse@0xlab.com) smtp.mail=luse@0xlab.com Received: by iyi12 with SMTP id 12so780318iyi.37 for ; Thu, 24 Mar 2011 20:19:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.43.59.72 with SMTP id wn8mr468815icb.48.1301023146026; Thu, 24 Mar 2011 20:19:06 -0700 (PDT) Sender: luse@0xlab.com Received: by 10.42.177.194 with HTTP; Thu, 24 Mar 2011 20:19:06 -0700 (PDT) Date: Fri, 25 Mar 2011 11:19:06 +0800 X-Google-Sender-Auth: sgBen7knajXo9o__hDen8x_m14w Message-ID: Subject: [PATCH] toolchain/build: Fix Linaro Android toolchain linking fail with FDO From: Luse Cheng To: linaro-dev@lists.linaro.org, patches@linaro.org 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= 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 \ 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= Specify installation path [/tmp/android-toolchain-eabi]" echo " --toolchain-src= Toolchain source directory [`dirname $PWD`]" echo " --with-gcc= Specify GCC source (support: directory, bzr, url)" + echo " --with-sysroot= Specify SYSROOT directory"