From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16829 invoked by alias); 4 Feb 2014 08:34:41 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 16818 invoked by uid 89); 4 Feb 2014 08:34:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f54.google.com Received: from mail-wg0-f54.google.com (HELO mail-wg0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 04 Feb 2014 08:34:39 +0000 Received: by mail-wg0-f54.google.com with SMTP id x13so12242995wgg.33 for ; Tue, 04 Feb 2014 00:34:36 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.87.104 with SMTP id w8mr154901wjz.90.1391502876399; Tue, 04 Feb 2014 00:34:36 -0800 (PST) Received: by 10.227.206.2 with HTTP; Tue, 4 Feb 2014 00:34:36 -0800 (PST) Date: Tue, 04 Feb 2014 08:34:00 -0000 Message-ID: Subject: [PATCH 2/3] GCC: Copy minimal sysroot instead of just headers From: Ray Donnelly To: "crossgcc@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00008.txt.bz2 # HG changeset patch # User Ray Donnelly # Date 1391500511 0 # Tue Feb 04 07:55:11 2014 +0000 # Node ID 45760158aca33981b5bb882191043bd708b57dbb # Parent 2eab7ceda925402555d7d3107e5828734ac74c11 GCC: Copy minimal sysroot instead of just headers Before starting the build of the 2nd stage GCC, as well as copying the headers, it is necessary to also copy the start libraries and stub libc. copy_headers is renamed to copy_minimal_sysroot and find is used to copy ${CT_SYSROOT_DIR}/lib* and ${CT_SYSROOT_DIR}/include otherwise linking libgcc_s.so fails since GCC "cannot find -lc". Signed-off-by: Ray Donnelly diff -r 2eab7ceda925 -r 45760158aca3 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Tue Feb 04 07:40:45 2014 +0000 +++ b/scripts/build/cc/gcc.sh Tue Feb 04 07:55:11 2014 +0000 @@ -189,6 +189,7 @@ local -a core_LDFLAGS local -a core_targets local arg + local sysroot_dirs for arg in "$@"; do eval "${arg// /\\ }" @@ -201,18 +202,18 @@ extra_config+=("--with-newlib") extra_config+=("--enable-threads=no") extra_config+=("--disable-shared") - copy_headers=y # For baremetal, as there's no headers to copy, - # we copy an empty directory. So, who cares? + copy_minimal_sysroot=y # For baremetal, as there's no minimal sysroot to copy, + # we copy some empty directories. So, who cares? ;; shared) extra_config+=("--enable-shared") - copy_headers=y + copy_minimal_sysroot=y ;; baremetal) extra_config+=("--with-newlib") extra_config+=("--enable-threads=no") extra_config+=("--disable-shared") - copy_headers=n + copy_minimal_sysroot=n ;; *) CT_Abort "Internal Error: 'mode' must be one of: 'static', 'shared' or 'baremetal', not '${mode:-(empty)}'" @@ -225,9 +226,14 @@ [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") fi - if [ "${copy_headers}" = "y" ]; then - CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2" - CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}" "${prefix}/${CT_TARGET}/include" + if [ "${copy_minimal_sysroot}" = "y" ]; then + CT_DoLog DEBUG "Copying headers and libs to install area of bootstrap gcc, so it can build libgcc2" + CT_Pushd "${CT_HEADERS_DIR}/.." + sysroot_dirs=$(find . -mindepth 1 -maxdepth 1 -type d \( -name "lib*" -or -name "include" \) -exec basename {} \;) + for sysroot_dir in $sysroot_dirs; do + CT_DoExecLog ALL cp -a "${sysroot_dir}" "${prefix}/${CT_TARGET}/${sysroot_dir}" + done + CT_Popd fi for tmp in ARCH ABI CPU TUNE FPU FLOAT; do -- For unsubscribe information see http://sourceware.org/lists.html#faq