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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Nov 2017 10:18:38 -0800
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Behan Webster <behanw@...verseincode.com>,
        Jan-Simon Möller <dl9pf@....de>,
        Mark Charlebois <charlebm@...il.com>,
        Greg Hackmann <ghackmann@...gle.com>,
        Matthias Kaehlcke <mka@...omium.org>,
        Douglas Anderson <dianders@...omium.org>,
        Chris Fries <cfries@...gle.com>,
        Michal Marek <mmarek@...e.com>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-mips@...ux-mips.org, linux-arm-kernel@...ts.infradead.org,
        linux-hexagon@...r.kernel.org, openrisc@...ts.librecores.org
Subject: Re: [PATCH v3] kbuild: Set KBUILD_CFLAGS before incl. arch Makefile

Hi Masahiro,

Thanks for merging Chris' patch, and sorry for taking so long to respond.

On Wed, Nov 22, 2017 at 8:24 PM, Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> Linus suggests to move compiler flag testing to Kconfig.

Do you have an LKML link for context?

On Wed, Nov 15, 2017 at 6:32 PM, Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> BTW, I notice another issue.
>
> If we move clang settings before including arch Makefile,
> "ifneq ($(CROSS_COMPILE),)" comes early.
>
> Some arch Makefiles (arch/mips/Makefile, arch/blackfin/Makefile, etc.)
> set CROSS_COMPILE there if CROSS_COMPILE is not given.
>
> Then, we have a conflict between two requirements among arch.
>
> [1] arm64, powerpc use ld-option in their Makefile.
>     So, clang flags must be set before inc. arch Makefile.
> [2] mips, blackfin, etc. may set CROSS_COMPILE in their Makefile.
>     So, we want to reference CROSS_COMPILE only after inc. arch Makefile
>
> I have no idea how to solve it.
>
> At this moment, I guess clang is intended to support
> only limited architectures.
>
> It might be OK to be compromised here.

I definitely find it curious that certain arch's define CROSS_COMPILE
themselves.  The benefit is one less argument to supply at compile
time, but it assumes that the toolchain always has a certain prefix.
This makes sense to me when cross compiling, but seems odd when
compiling natively on that arch as the host and target.  Maybe those
arch's use that convention, or simply are always cross compiled for?

Taking a survey of all arch's currently in the kernel via `cd arch; ag
CROSS_COMPILE` and quickly eyeballing the result:

m68k if not set
arc if not set
openrisc for some configs (openrisc/configs/or1ksim_defconfig,
openrisc/configs/simple_smp_defconfig)
blackfin if not set
hexagon for some configs (hexagon/configs/comet_defconfig)
parisc if not set
sh if not set
xtensa if not set
score always
arm for some configs (arm/configs/lpc18xx_defconfig)
h8300 if not set
mips if not set (and explicitly emptied for some configs,
mips/configs/nlm_xlr_defconfig )
unicore32 if not set
tile if not set

The * if not set (or not being on the list) seems correct, as the top
level Makefile will handle this correctly.  Setting it for some
configs seems curious (not necessarily wrong?), emptying it/always
setting it via config sounds wrong to me, but maybe those hosts don't
have toolchains and must always be cross compiled for?

For reference, this file in LLVM source defines the supported backend
targets: https://llvm.org/doxygen/Triple_8h_source.html

Either way, it sounds like we're all set here, I guess I'm just
curious about the LKML link/context and why some configs set
CROSS_COMPILE themselves?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ