From patchwork Thu Sep 4 20:56:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Hundven X-Patchwork-Id: 386015 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 9244E1400B9 for ; Fri, 5 Sep 2014 06:57:52 +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=SY6UdKIFsV0gVzTOqnWbv+7U6gsu2WT 6+xrNKSSeORnR2xNTPo7Rwv3BVMnDCaYGYziV8zOJQc26AHwbq/Squlcd0Y7V6rG rsdWZm+b2oXXbrohf8WAuMiQea6CfK+CuUUxKQ/3ICafq4w6FY4P6DefJ76Y1wXy aAUpOcqdL11I= 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=KLkFwmEm7c5KlBudAeCIe8n2qRE=; b=LZpX8 s/fyLlzMtrouvx5FnHkcBLprOUuVfGR/XDMizi197rm5iqq6g/twZumyHlb4u0GU /R0iznRFcmQ/Y8L4sPc2RVux+e5IfABB4LgMAMacWkC/qrYI8P/bqrubNPZjQYyR 9UKljlVxvFsVPOUspHIOqgG9CfeVrlHEQ/lr54= Received: (qmail 12446 invoked by alias); 4 Sep 2014 20:57:08 -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 12318 invoked by uid 89); 4 Sep 2014 20:57:06 -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-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 04 Sep 2014 20:57:05 +0000 Received: by mail-pa0-f47.google.com with SMTP id hz1so20698106pad.20 for ; Thu, 04 Sep 2014 13:57:03 -0700 (PDT) X-Received: by 10.70.37.12 with SMTP id u12mr12995512pdj.79.1409864223690; Thu, 04 Sep 2014 13:57:03 -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 qk2sm70394pbc.18.2014.09.04.13.57.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 13:57:02 -0700 (PDT) From: Bryan Hundven To: "Yann E. MORIN" Cc: crossgcc@sourceware.org, Bryan Hundven Subject: [PATCH 2/5] libc/musl: Add options for optimization Date: Thu, 4 Sep 2014 13:56:54 -0700 Message-Id: <1409864217-17035-2-git-send-email-bryanhundven@gmail.com> In-Reply-To: <1409864217-17035-1-git-send-email-bryanhundven@gmail.com> References: <1409864217-17035-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 | 32 ++++++++++++++++++++++++++++++++ scripts/build/libc/musl.sh | 14 +++++++++++++- 2 files changed, 45 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..42f45e1 --- /dev/null +++ b/config/libc/musl.in.2 @@ -0,0 +1,32 @@ +# 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 "Optimize musl-libc based CFLAGS passed" + 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 diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh index 6dbf657..bd7ae2a 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_conf # From buildroot: # gcc constant folding bug with weak aliases workaround @@ -45,6 +46,16 @@ do_libc_configure() { extra_cflags+=("-fno-toplevel-reorder") fi + if [ "${CT_LIBC_MUSL_OPTIMIZE_NONE}" = "y" ]; then + extra_conf+=("--optimize=no") + elif [ "${CT_LIBC_MUSL_OPTIMIZE_AUTO}" = "y" ]; then + extra_conf+=("--optimize=auto") + elif [ "${CT_LIBC_MUSL_OPTIMIZE_SPEED}" = "y" ]; then + extra_conf+=("--optimize=yes") + elif [ "${CT_LIBC_MUSL_OPTIMIZE_SIZE}" = "y" ]; then + extra_conf+=("--optimize=size") + fi + # NOTE: musl handles the build/host/target a little bit differently # then one would expect: # build : not used @@ -56,7 +67,8 @@ do_libc_configure() { ./configure \ --host="${CT_TARGET}" \ --target="${CT_TARGET}" \ - --prefix="/usr" + --prefix="/usr" \ + "${extra_config[@]}" } do_libc_start_files() {