From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933197AbdDETL2 (ORCPT ); Wed, 5 Apr 2017 15:11:28 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:36155 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754311AbdDETLS (ORCPT ); Wed, 5 Apr 2017 15:11:18 -0400 MIME-Version: 1.0 In-Reply-To: <20170405190130.GD145051@google.com> References: <20170317001520.85223-1-md@google.com> <20170317001520.85223-3-md@google.com> <20170405190130.GD145051@google.com> From: Michael Davidson Date: Wed, 5 Apr 2017 12:11:17 -0700 Message-ID: Subject: Re: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags To: Matthias Kaehlcke Cc: Masahiro Yamada , Michal Marek , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Herbert Xu , "David S. Miller" , Shaohua Li , Alexander Potapenko , Dmitry Vyukov , X86 ML , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-crypto@vger.kernel.org, linux-raid@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It "works" for the cases that I currently care about but I have to say that I am uneasy about adding -Werror to the cc-option test in this way. Suppose that one of the *other* flags that is implicitly passed to the compiler by cc-option - eg something that was explicitly specified in $(KBUILD_CFLAGS) - triggers a warning. In that case all calls to cc-option will silently fail because of the -Werror and valid options will not be detected correctly. If everyone is OK with that because "it shouldn't normally ever happen" then that is fine, but if does result in a subtle change from existing behavior (and a trap that I almost immediately fell into after applying a similar patch). On Wed, Apr 5, 2017 at 12:01 PM, Matthias Kaehlcke wrote: > Hi Masahiro, > > El Thu, Apr 06, 2017 at 03:08:26AM +0900 Masahiro Yamada ha dit: > >> 2017-03-17 9:15 GMT+09:00 Michael Davidson : >> > Unfortunately, while clang generates a warning about these flags >> > being unsupported it still exits with a status of 0 so we have >> > to explicitly disable them instead of just using a cc-option check. >> > >> > Signed-off-by: Michael Davidson >> >> >> Instead, does the following work for you? >> https://patchwork.kernel.org/patch/9657285/ > > Thanks for the pointer, I was about to give this change (or rather its > ancestor) a rework myself :) > >> You need to use >> $(call cc-option, ...) >> for -falign-jumps=1 and -falign-loops=1 > > I can confirm that this works. > > Thanks > > Matthias