From patchwork Tue Feb 4 08:34:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Donnelly X-Patchwork-Id: 316478 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0B47F2C007C for ; Tue, 4 Feb 2014 19:34:47 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:date:message-id:subject:from:to :content-type; q=dns; s=default; b=PQs3BmiqkD6+UhlpM+kjXWteaGb/3 9KPxOqCZ3oUKLfE7OSjreYdCNuzrNGrnAB2OaKkPb0wgZM0A6s1bloPYTsbuNlTK 2VMj8KFlaADJNC/i9UBKounjv1c9oadbFohccUN48/Ko3swIEEtE/4RbH9+XfEQF x0I5YtgUOMI0Sk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:date:message-id:subject:from:to :content-type; s=default; bh=m5lBgJL5X4t1UxZlbKs0udO7Mu4=; b=qS1 Tujpu0KHvTsF3ZlRrXyFSFF+Bz/2vhBfp9kqid6pQmTMIg1eCHjpX26Bs7C570ln rvf+km6dxGVuJKRPOPi3HTOf24TrLol7id9a+lxuISid1CdBmRNjlQH3V6jwM7I0 4I/gO8+nquqf+roDCFUuRPprPnYqfaqxCTtOQzYc= 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@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, 4 Feb 2014 08:34:36 +0000 Message-ID: Subject: [PATCH 2/3] GCC: Copy minimal sysroot instead of just headers From: Ray Donnelly To: "crossgcc@sourceware.org" X-IsSubscribed: yes # 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 *) 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 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 ;;