From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8415 invoked by alias); 16 Nov 2011 03:24:13 -0000 Received: (qmail 8401 invoked by uid 22791); 16 Nov 2011 03:24:11 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from snapmx1.ironport.snap.net.nz (HELO snapmx1.ironport.snap.net.nz) (202.37.100.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Nov 2011 03:23:25 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAEssw057/y/M/2dsb2JhbABDqXKCeT8/LQ8VHzoUE8EeihcEmW+MVw Received: from rupert.snap.net.nz ([202.37.100.140]) by smtp1.ironport.snap.net.nz with ESMTP; 16 Nov 2011 16:23:23 +1300 X-Sender-IP: 123.255.47.204 X-Sender-IP: 123.255.47.204 X-Sender-IP: 123.255.47.204 Received: from [127.0.1.1] (204.47.255.123.static.snap.net.nz [123.255.47.204]) by rupert.snap.net.nz (Postfix) with ESMTPS id DB8571FD3A; Wed, 16 Nov 2011 16:23:23 +1300 (NZDT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH] scripts: add support for a pre-built sysroot X-Mercurial-Node: 1c30b090c664d9ca063f1c1d0926d49f512c3a14 Message-Id: <1c30b090c664d9ca063f.1321413798@crucis> User-Agent: Mercurial-patchbomb/1.7.5 Date: Wed, 16 Nov 2011 03:24:00 -0000 From: Michael Hope To: "Yann E. MORIN" Cc: crossgcc@sourceware.org, patches@linaro.org X-IsSubscribed: yes 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 X-SW-Source: 2011-11/txt/msg00063.txt.bz2 # HG changeset patch # User Michael Hope # Date 1321413746 -46800 # Branch prebuilt-sysroot-2 # Node ID 1c30b090c664d9ca063f1c1d0926d49f512c3a14 # Parent c6d10ee4ab25a8b0547b69e9a101d856d3b951a1 scripts: add support for a pre-built sysroot. Useful when building a compiler that targets an existing system such as Ubuntu or Debian. Fetches a tarball that contains the libc libraries, libc headers, and kernel headers and uses that as the sysroot. Assumes the libc is GLIBC-like and the kernel is Linux-like. Adds a new libc option called 'prebuilt'. Adds a new kernel option called 'prebuilt'. Messy: I haven't scattered 'depends ! PREBUILT_SYSROOT' across the config files. It's possible to configure something inconsistent. For discussion. I'm happy to keep this in our own tree. Signed-off-by: Michael Hope diff -r c6d10ee4ab25 -r 1c30b090c664 config/kernel/prebuilt.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/kernel/prebuilt.in Wed Nov 16 16:22:26 2011 +1300 @@ -0,0 +1,8 @@ +# Prebuilt Linux kernel options + +## depends on PREBUILT_SYSROOT +## +## select KERNEL_SUPPORTS_SHARED_LIBS +## +## help Build a toolchain targeting systems running Linux as a kernel. +## \ No newline at end of file diff -r c6d10ee4ab25 -r 1c30b090c664 config/libc/prebuilt.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/libc/prebuilt.in Wed Nov 16 16:22:26 2011 +1300 @@ -0,0 +1,8 @@ +# Prebuilt libc options + +## depends on PREBUILT_SYSROOT +## +## select LIBC_SUPPORT_NPTL +## +## help Use the EGLIBC/GLIBC from the prebuilt sysroot. +## diff -r c6d10ee4ab25 -r 1c30b090c664 config/toolchain.in --- a/config/toolchain.in Mon Nov 14 13:29:12 2011 +0100 +++ b/config/toolchain.in Wed Nov 16 16:22:26 2011 +1300 @@ -17,6 +17,28 @@ You definitely want to say 'Y' here. Yes you do. I know you do. Say 'Y'. +config PREBUILT_SYSROOT + bool + depends on USE_SYSROOT + prompt "Use a pre-built sysroot" + help + A pre-built sysroot contains the headers and libraries that were + built elsewhere for the target system. Useful when building + a compiler that targets an existing distribution like Debian or + Ubuntu. + +config PREBUILT_NAME + string + prompt "Pre-built sysroot name" + depends on PREBUILT_SYSROOT + help + Base name of the pre-built sysroot without the URL or extension. + +config PREBUILT_BASE_URL + string + prompt "Pre-built sysroot base URL" + depends on PREBUILT_SYSROOT + config SYSROOT_NAME string prompt "sysroot directory name" if ! BACKEND diff -r c6d10ee4ab25 -r 1c30b090c664 scripts/build/arch/arm.sh --- a/scripts/build/arch/arm.sh Mon Nov 14 13:29:12 2011 +0100 +++ b/scripts/build/arch/arm.sh Wed Nov 16 16:22:26 2011 +1300 @@ -7,6 +7,7 @@ # The system part of the tuple: case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in *glibc,y) CT_TARGET_SYS=gnueabi;; + prebuilt,y) CT_TARGET_SYS=gnueabi;; uClibc,y) CT_TARGET_SYS=uclibcgnueabi;; *,y) CT_TARGET_SYS=eabi;; esac diff -r c6d10ee4ab25 -r 1c30b090c664 scripts/build/kernel/prebuilt.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/build/kernel/prebuilt.sh Wed Nov 16 16:22:26 2011 +1300 @@ -0,0 +1,19 @@ +# This file declares functions for pre-built Linux kernel +# Copyright 2011 Linaro Limited +# Licensed under the GPL v2. See COPYING in the root of this package + +CT_DoKernelTupleValues() { + CT_TARGET_KERNEL="linux" +} + +do_kernel_get() { + : +} + +do_kernel_extract() { + : +} + +do_kernel_headers() { + : +} diff -r c6d10ee4ab25 -r 1c30b090c664 scripts/build/libc/prebuilt.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/build/libc/prebuilt.sh Wed Nov 16 16:22:26 2011 +1300 @@ -0,0 +1,32 @@ +# This file adds functions to fetch and use a prebuilt sysroot. +# Copyright 2011 Linaro Limited +# Licensed under the GPL v2. See COPYING in the root of this package + +do_libc_get() { + CT_DoLog DEBUG "Fetching ${CT_PREBUILT_NAME}" + CT_GetFile "${CT_PREBUILT_NAME}" "${CT_PREBUILT_BASE_URL}" + + return 0 +} + +do_libc_extract() { + CT_Extract "${CT_PREBUILT_NAME}" +} + +do_libc_check_config() { + : +} + +do_libc_start_files() { + # do_kernel_headers has already run + CT_DoLog EXTRA "Installing the pre-built sysroot" + CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${CT_PREBUILT_NAME}"/* "${CT_SYSROOT_DIR}" +} + +do_libc() { + : +} + +do_libc_finish() { + : +} diff -r c6d10ee4ab25 -r 1c30b090c664 scripts/functions --- a/scripts/functions Mon Nov 14 13:29:12 2011 +0100 +++ b/scripts/functions Wed Nov 16 16:22:26 2011 +1300 @@ -971,6 +971,7 @@ # by architecture-specific values. case "${CT_LIBC}" in *glibc) CT_TARGET_SYS=gnu;; + prebuilt) CT_TARGET_SYS=gnu;; uClibc) CT_TARGET_SYS=uclibc;; *) CT_TARGET_SYS=elf;; esac -- For unsubscribe information see http://sourceware.org/lists.html#faq