From patchwork Tue Mar 28 01:19:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9647977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC02A602D6 for ; Tue, 28 Mar 2017 01:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B19A5223A6 for ; Tue, 28 Mar 2017 01:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A475B28306; Tue, 28 Mar 2017 01:20:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66435223A6 for ; Tue, 28 Mar 2017 01:20:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753630AbdC1BTg (ORCPT ); Mon, 27 Mar 2017 21:19:36 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:35318 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753556AbdC1BTf (ORCPT ); Mon, 27 Mar 2017 21:19:35 -0400 Received: by mail-pg0-f54.google.com with SMTP id 81so42121116pgh.2 for ; Mon, 27 Mar 2017 18:19:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QkYKEadoXHGpwHH3sa9m24dIKvTbXCwJScJIJvhqkyE=; b=n6sCpxAwShxFQnSPCyxU2fStuvInKCQfUwLwYo2fEM4VF3SWPFoy4h5hHCUF5MobW9 tTxTmPrUwWhbKa+yYP2Dr8TXizoRUVJ5n9mznwvliOK3p6GxFZVIUjwwkjqT55tRl2xH nsW869LYUVwlFTR7QV/YjrpxP6xJDqh0rGRuohtgcsyh4S+KxJeued3rXsosroUnpFX1 S1fcmKnAn7KBFIVDNXN822N2uDGufxq3iY3GdREdwG9b7R5ALFt+uxWNhIKMANUTzU5l n0LG8WQKabeuXdgdndUdOl0Q/WlOABsDT7YEcMENnWF0Jin0qa2V05fHK2ahh6Vc1VzO MjWQ== X-Gm-Message-State: AFeK/H3mr3gCvLMqWYn60OJszbXEhdk3f0Xe/pR7aa8yrtOblA8euzFfdAR7n1hdg9lODIir X-Received: by 10.98.209.25 with SMTP id z25mr28797936pfg.200.1490663974298; Mon, 27 Mar 2017 18:19:34 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.64.162]) by smtp.gmail.com with ESMTPSA id w14sm3355329pgo.37.2017.03.27.18.19.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Mar 2017 18:19:33 -0700 (PDT) From: Matthias Kaehlcke To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Behan Webster , Greg Hackmann , Grant Grundler , Michael Davidson , Peter Foley , Matthias Kaehlcke Subject: [PATCH] kbuild: use -Oz instead of -Os when using clang Date: Mon, 27 Mar 2017 18:19:09 -0700 Message-Id: <20170328011909.150513-1-mka@chromium.org> X-Mailer: git-send-email 2.12.2.564.g063fe858b8-goog Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This generates smaller resulting object code when compiled with clang. Signed-off-by: Matthias Kaehlcke --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b2faa9319372..66bcdbf58371 100644 --- a/Makefile +++ b/Makefile @@ -638,7 +638,8 @@ KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) else ifdef CONFIG_PROFILE_ALL_BRANCHES KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)