From patchwork Tue Sep 15 03:19:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sedat Dilek X-Patchwork-Id: 7179801 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B075FBEEC1 for ; Tue, 15 Sep 2015 03:20:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5C9120782 for ; Tue, 15 Sep 2015 03:20:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0421520778 for ; Tue, 15 Sep 2015 03:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751923AbbIODUH (ORCPT ); Mon, 14 Sep 2015 23:20:07 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:37358 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbbIODUG (ORCPT ); Mon, 14 Sep 2015 23:20:06 -0400 Received: by wicfx3 with SMTP id fx3so8565175wic.0; Mon, 14 Sep 2015 20:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=4TEGDXO5A1nvef9e4v7upIDb8xQVaPkiCkeu/ATWyPU=; b=DSyohYjY0Gyqq3CPsVZKaJKe1EfxRw1K1gdmbVekIb4zdJ0wn3WUMJsHcMXWemm05X 2t0JL+d+ZB4UiH/q7VCQRkgwtfZReT1SD8axmXcyUg1/jEtgU4jnhVOfnrwPChv8gqqe ZGpXuFD9OI57uL8fSUOxzIrEV0Haa+fTZW0FWBr89w0xutW6zcrb0rV31C2kOcojMcvF QvWoWS2+Qmi/xjoblJ0/Lv/igwYKPKnk780yPZozPYCinsH6yYKPB5whuOg+GTz9/R06 9k9Y9ux9ESYLOEhLsHmEQLS0JPNK9Y8q69t8i5J0dg5vSDL6ggMR1GXyJHn9MvkwYbRj EmSg== X-Received: by 10.194.204.198 with SMTP id la6mr4699210wjc.20.1442287204217; Mon, 14 Sep 2015 20:20:04 -0700 (PDT) Received: from fambox.fambox-domain ([176.0.84.143]) by smtp.gmail.com with ESMTPSA id bi6sm18583398wjc.25.2015.09.14.20.20.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 20:20:03 -0700 (PDT) From: Sedat Dilek To: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sedat Dilek , Behan Webster Subject: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE Date: Tue, 15 Sep 2015 05:19:48 +0200 Message-Id: <1442287188-11326-1-git-send-email-sedat.dilek@gmail.com> X-Mailer: git-send-email 2.5.2 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Based on a patch of Behan Webster (see [1]). CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y and boots on bare metal. This is a Ubuntu/precise AMD64 system. Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. [1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch CC: Behan Webster --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4249441e535d..a57fb6b39ed7 100644 --- a/Makefile +++ b/Makefile @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) 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 KBUILD_CFLAGS += -O2 endif