lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a3ph=9f0LV1JoAhP8ZO4-9GGqmSmV6ajXZzw2zJPSXOPw@mail.gmail.com>
Date:   Fri, 31 Mar 2017 10:48:53 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Michal Marek <mmarek@...e.com>,
        Nicholas Piggin <npiggin@...il.com>,
        Namhyung Kim <namhyung.with.foss@...il.com>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mark Charlebois <charlebm@...il.com>
Subject: Re: [PATCH] [SUBMITTED 20170314] [v333kbuild: disable
 -ffunction-sections on gcc-4.7 with ftrace

On Thu, Mar 30, 2017 at 5:42 PM, Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> 2017-03-29 18:30 GMT+09:00 Arnd Bergmann <arnd@...db.de>:
>> On Wed, Mar 29, 2017 at 4:07 AM, Masahiro Yamada
>> <yamada.masahiro@...ionext.com> wrote:
>>> 2017-03-15 6:37 GMT+09:00 Arnd Bergmann <arnd@...db.de>:
>>> [2]
>>> This question is more technical.
>>>
>>> The cause of the problem seems that GCC warns it cannot support the
>>> two at the same time,
>>> but it does handle it as an error.  So, cc-option assumes this
>>> combination is OK.
>>>
>>> Is it a good idea to add -Werror to cc-option checking?
>>
>> Hmm, I've actually been running with that change as a side-effect
>> of having the llvmlinux patches applied, which contain this one:
>>
>> commit 03497934e211325fc2913476897daf7a5ddb008a
>> Author: Mark Charlebois <charlebm@...il.com>
>> Date:   Mon Sep 22 14:33:05 2014 -0700
>>
>>     kbuild, LLVMLinux: Add -Werror to cc-option to support clang
>>
>>     Clang will warn about unknown warnings but will not return false
>>     unless -Werror is set. GCC will return false if an unknown
>>     warning is passed.
>>
>>     Adding -Werror make both compiler behave the same.
>>
>>     Signed-off-by: Mark Charlebois <charlebm@...il.com>
>>     Signed-off-by: Behan Webster <behanw@...verseincode.com>
>>     Reviewed-by: Jan-Simon Möller <dl9pf@....de>
>>
>> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
>> index 285acc57c0a4..3629bd9c7e79 100644
>> --- a/scripts/Kbuild.include
>> +++ b/scripts/Kbuild.include
>> @@ -116,12 +116,12 @@ CC_OPTION_CFLAGS = $(filter-out
>> $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
>>  # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
>>
>>  cc-option = $(call try-run,\
>> -       $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c
>> /dev/null -o "$$TMP",$(1),$(2))
>> +       $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c
>> -x c /dev/null -o "$$TMP",$(1),$(2))
>>
>>  # cc-option-yn
>>  # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
>>  cc-option-yn = $(call try-run,\
>> -       $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c
>> /dev/null -o "$$TMP",y,n)
>> +       $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c
>> -x c /dev/null -o "$$TMP",y,n)
>>
>>  # cc-option-align
>>  # Prefix align with either -falign or -malign
>> @@ -131,7 +131,7 @@ cc-option-align = $(subst -functions=0,,\
>>  # cc-disable-warning
>>  # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
>>  cc-disable-warning = $(call try-run,\
>> -       $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1))
>> -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
>> +       $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip
>> $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
>>
>>  # cc-name
>>  # Expands to either gcc or clang
>>
>> This is identical to your version, except it applies the same
>> thing to cc-disable-warning.
>
> Ah, I see.
>
> I'm also moving
> KBUILD_CFLAGS  += $(call cc-option,-ffunction-sections,)
> below
> CC_FLAGS_FTRACE := -pg
> to fix the warning.
>
>
>
>
>> I think this is good to get merged,
>> and there are probably a couple of other patches in that series
>> that we may want to look at again.
>
>
> I agree.
>
>
> At least, 03497934e21 looks good to be merged.
> (I need to get access to Mark, and ask him to send this patch.)
>
> Then, swap the -ffunction-sections and -pg order.
>
> I hope this will make you and clang guys happy.

I may have a number of clang related patches in the future,
and can also forward this patch. I suspect that Mark (added to
Cc) is currently not able to send a tested patch for the latest
kernel, he worked on it in 2014, but I don't think he's following
llvmlinux at the moment.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ