From patchwork Thu Sep 4 23:20:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Hundven X-Patchwork-Id: 386044 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 ED093140088 for ; Fri, 5 Sep 2014 09:20:43 +1000 (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:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=I07u3vWoN3aQEW+MmDZuuZfm1akIs/L 1an2baiT6MCbMKFcyVSIlDcG7VtGu/H5nF7bAGqMzKwMLSo0mSq6t0DlAib4c0iZ pxm/1DiUJCjCz9+g6lIioRVp9zRxDpGiG3Eo99WyXZH/QVMlBr4geMqIDkGGeakR 830KiT6xU1gg= 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:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=8q5r7n/j6X1rNcYGnPutIgsS5i8=; b=uez3W 3TsJW3t/P/ECiFBhmB3n7Zvp75ZuXO7l19PvXbRUmF7CpnafUkIX9ciYCWqt+RhD Y7ldK4BkBHJ+X4h54rehnEskgA008mEU8gXDVUhUfj2hDTU1fc9LLV7uc76PTkg8 Q0NdgR+bYYYEIfCTb8AyaeVVQOimYd8GW0m084= Received: (qmail 29857 invoked by alias); 4 Sep 2014 23:20:35 -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 29832 invoked by uid 89); 4 Sep 2014 23:20:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f182.google.com Received: from mail-pd0-f182.google.com (HELO mail-pd0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 04 Sep 2014 23:20:31 +0000 Received: by mail-pd0-f182.google.com with SMTP id fp1so14665501pdb.27 for ; Thu, 04 Sep 2014 16:20:30 -0700 (PDT) X-Received: by 10.70.52.74 with SMTP id r10mr6042600pdo.12.1409872830212; Thu, 04 Sep 2014 16:20:30 -0700 (PDT) Received: from fuzzy.hsd1.wa.comcast.net (c-50-135-131-187.hsd1.wa.comcast.net. [50.135.131.187]) by mx.google.com with ESMTPSA id pd7sm186326pdb.78.2014.09.04.16.20.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 16:20:29 -0700 (PDT) From: Bryan Hundven To: "Yann E. MORIN" Cc: crossgcc@sourceware.org, Bryan Hundven Subject: [PATCH 2/4] libc/musl: Add options for optimization Date: Thu, 4 Sep 2014 16:20:24 -0700 Message-Id: <1409872826-19507-2-git-send-email-bryanhundven@gmail.com> In-Reply-To: <1409872826-19507-1-git-send-email-bryanhundven@gmail.com> References: <1409872826-19507-1-git-send-email-bryanhundven@gmail.com> X-IsSubscribed: yes This commit adds configuration knobs for optimizing musl-libc. Signed-off-by: Bryan Hundven --- config/libc/musl.in.2 | 39 +++++++++++++++++++++++++++++++++++++++ scripts/build/libc/musl.sh | 6 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 config/libc/musl.in.2 diff --git a/config/libc/musl.in.2 b/config/libc/musl.in.2 new file mode 100644 index 0000000..96101a0 --- /dev/null +++ b/config/libc/musl.in.2 @@ -0,0 +1,39 @@ +# musl second-part option + +choice + prompt "How to optimize musl-libc" + default LIBC_MUSL_OPTIMIZE_AUTO + +config LIBC_MUSL_OPTIMIZE_NONE + bool + prompt "Do not optimize musl-libc" + help + This option sets `--optimize=no' + +config LIBC_MUSL_OPTIMIZE_AUTO + bool + prompt "Use musl-libc's automatic optimization" + help + This option allows musl-libc's ./configure script to automatically + set the optimization. + +config LIBC_MUSL_OPTIMIZE_SPEED + bool + prompt "Optimize musl-libc for speed" + help + This option sets `--optimize=yes' + +config LIBC_MUSL_OPTIMIZE_SIZE + bool + prompt "Optimize musl-libc for size" + help + This option sets `--optimize=size' + +endchoice + +config LIBC_MUSL_OPTIMIZE + string + default "no" if LIBC_MUSL_OPTIMIZE_NONE + default "auto" if LIBC_MUSL_OPTIMIZE_AUTO + default "yes" if LIBC_MUSL_OPTIMIZE_SPEED + default "size" if LIBC_MUSL_OPTIMIZE_SIZE diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh index f997d25..6d77786 100644 --- a/scripts/build/libc/musl.sh +++ b/scripts/build/libc/musl.sh @@ -37,6 +37,7 @@ do_libc_check_config() { do_libc_configure() { CT_DoLog EXTRA "Configuring C library" local -a extra_cflags + local -a extra_config # From buildroot: # gcc constant folding bug with weak aliases workaround @@ -45,6 +46,8 @@ do_libc_configure() { extra_cflags+=("-fno-toplevel-reorder") fi + extra_config+=( "--optimize=${CT_LIBC_MUSL_OPTIMIZE}" ) + # NOTE: musl handles the build/host/target a little bit differently # then one would expect: # build : not used @@ -57,7 +60,8 @@ do_libc_configure() { --host="${CT_TARGET}" \ --target="${CT_TARGET}" \ --prefix="/usr" \ - --disable-gcc-wrapper + --disable-gcc-wrapper \ + "${extra_config[@]}" } do_libc_start_files() {