2021-03-19 07:38:21

by Naresh Kamboju

[permalink] [raw]
Subject: sparc: clang: error: unknown argument: '-mno-fpu'

Linux mainline master build breaks for sparc defconfig.
There are multiple errors / warnings with clang-12 and clang-11 and 10.
- sparc (defconfig) with clang-12, clang-11 and clang-10
- sparc (tinyconfig) with clang-12, clang-11 and clang-10
- sparc (allnoconfig) with clang-12, clang-11 and clang-10

make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=sparc
CROSS_COMPILE=sparc64-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache
clang'
clang: error: unknown argument: '-mno-fpu'
clang: error: unknown argument: '-fcall-used-g5'
clang: error: unknown argument: '-fcall-used-g7'
make[2]: *** [/builds/linux/scripts/Makefile.build:116:
scripts/mod/devicetable-offsets.s] Error 1
clang: error: unknown argument: '-mno-fpu'
clang: error: unknown argument: '-fcall-used-g5'
clang: error: unknown argument: '-fcall-used-g7'
make[2]: *** [/builds/linux/scripts/Makefile.build:271:
scripts/mod/empty.o] Error 1

Reported-by: Naresh Kamboju <[email protected]>

build link,
https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline/-/jobs/1110841374#L81

steps to reproduce:
--------------------------
# TuxMake is a command line tool and Python library that provides
# portable and repeatable Linux kernel builds across a variety of
# architectures, toolchains, kernel configurations, and make targets.
#
# TuxMake supports the concept of runtimes.
# See https://docs.tuxmake.org/runtimes/, for that to work it requires
# that you install podman or docker on your system.
#
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
# See https://docs.tuxmake.org/ for complete documentation.

tuxmake --runtime podman --target-arch sparc --toolchain clang-12
--kconfig defconfig


--
Linaro LKFT
https://lkft.linaro.org


2021-03-19 11:36:09

by Arnd Bergmann

[permalink] [raw]
Subject: Re: sparc: clang: error: unknown argument: '-mno-fpu'

On Fri, Mar 19, 2021 at 8:36 AM Naresh Kamboju
<[email protected]> wrote:
>
> Linux mainline master build breaks for sparc defconfig.
> There are multiple errors / warnings with clang-12 and clang-11 and 10.
> - sparc (defconfig) with clang-12, clang-11 and clang-10
> - sparc (tinyconfig) with clang-12, clang-11 and clang-10
> - sparc (allnoconfig) with clang-12, clang-11 and clang-10
>
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=sparc
> CROSS_COMPILE=sparc64-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache
> clang'

I don't think anyone has successfully built a sparc kernel with clang,
and I don't
think it's worth trying either, given how little upstream work the
sparc port sees
overall.

Arnd

Subject: Re: sparc: clang: error: unknown argument: '-mno-fpu'

On 3/19/21 12:31 PM, Arnd Bergmann wrote:
> On Fri, Mar 19, 2021 at 8:36 AM Naresh Kamboju
> <[email protected]> wrote:
>>
>> Linux mainline master build breaks for sparc defconfig.
>> There are multiple errors / warnings with clang-12 and clang-11 and 10.
>> - sparc (defconfig) with clang-12, clang-11 and clang-10
>> - sparc (tinyconfig) with clang-12, clang-11 and clang-10
>> - sparc (allnoconfig) with clang-12, clang-11 and clang-10
>>
>> make --silent --keep-going --jobs=8
>> O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=sparc
>> CROSS_COMPILE=sparc64-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache
>> clang'
>
> I don't think anyone has successfully built a sparc kernel with clang,
> and I don't
> think it's worth trying either, given how little upstream work the
> sparc port sees
> overall.

We'll get there. There are some other SPARC-related clang bugs that need
to be squashed first. We have made quite some improvements and it's actually
maintained by the community. Of course, we don't have a commercial backer
but that shouldn't be necessary for open source to work.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - [email protected]
`. `' Freie Universitaet Berlin - [email protected]
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

2021-03-19 11:58:11

by Arnd Bergmann

[permalink] [raw]
Subject: Re: sparc: clang: error: unknown argument: '-mno-fpu'

On Fri, Mar 19, 2021 at 12:38 PM John Paul Adrian Glaubitz
<[email protected]> wrote:
> On 3/19/21 12:31 PM, Arnd Bergmann wrote:
> > On Fri, Mar 19, 2021 at 8:36 AM Naresh Kamboju
> > <[email protected]> wrote:
> >>
> >> Linux mainline master build breaks for sparc defconfig.
> >> There are multiple errors / warnings with clang-12 and clang-11 and 10.
> >> - sparc (defconfig) with clang-12, clang-11 and clang-10
> >> - sparc (tinyconfig) with clang-12, clang-11 and clang-10
> >> - sparc (allnoconfig) with clang-12, clang-11 and clang-10
> >>
> >> make --silent --keep-going --jobs=8
> >> O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=sparc
> >> CROSS_COMPILE=sparc64-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache
> >> clang'
> >
> > I don't think anyone has successfully built a sparc kernel with clang,
> > and I don't
> > think it's worth trying either, given how little upstream work the
> > sparc port sees overall.
>
> We'll get there. There are some other SPARC-related clang bugs that need
> to be squashed first. We have made quite some improvements and it's actually
> maintained by the community. Of course, we don't have a commercial backer
> but that shouldn't be necessary for open source to work.

I meant there is no point for Naresh to do it as part of his build
testing with tuxmake.
If someone else gets it working, they can tell Naresh to try again, but until
then, I'd limit clang regression testing to x86, arm, powerpc, s390, mips, riscv
and arc.

Arnd

Subject: Re: sparc: clang: error: unknown argument: '-mno-fpu'

On 3/19/21 12:56 PM, Arnd Bergmann wrote:
>> We'll get there. There are some other SPARC-related clang bugs that need
>> to be squashed first. We have made quite some improvements and it's actually
>> maintained by the community. Of course, we don't have a commercial backer
>> but that shouldn't be necessary for open source to work.
>
> I meant there is no point for Naresh to do it as part of his build
> testing with tuxmake.
> If someone else gets it working, they can tell Naresh to try again, but until
> then, I'd limit clang regression testing to x86, arm, powerpc, s390, mips, riscv
> and arc.

It's definitely a useful report as I haven't done any tests in this regard yet
and we're certainly interested in getting this to work. We previously had Nick
give a session on building the kernel with clang in our monthly m68k meeting [1]
and he said, they are interested in supporting as many architectures as possible
in their efforts.

Adrian

> [1] http://m68k.info/#llvm:linux:video

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - [email protected]
`. `' Freie Universitaet Berlin - [email protected]
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

2021-03-19 18:13:03

by Nick Desaulniers

[permalink] [raw]
Subject: Re: sparc: clang: error: unknown argument: '-mno-fpu'

On Fri, Mar 19, 2021 at 4:56 AM Arnd Bergmann <[email protected]> wrote:
>
> On Fri, Mar 19, 2021 at 12:38 PM John Paul Adrian Glaubitz
> <[email protected]> wrote:
> > On 3/19/21 12:31 PM, Arnd Bergmann wrote:
> > > On Fri, Mar 19, 2021 at 8:36 AM Naresh Kamboju
> > > <[email protected]> wrote:
> > >>
> > >> Linux mainline master build breaks for sparc defconfig.
> > >> There are multiple errors / warnings with clang-12 and clang-11 and 10.
> > >> - sparc (defconfig) with clang-12, clang-11 and clang-10
> > >> - sparc (tinyconfig) with clang-12, clang-11 and clang-10
> > >> - sparc (allnoconfig) with clang-12, clang-11 and clang-10
> > >>
> > >> make --silent --keep-going --jobs=8
> > >> O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=sparc
> > >> CROSS_COMPILE=sparc64-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache
> > >> clang'
> > >
> > > I don't think anyone has successfully built a sparc kernel with clang,
> > > and I don't
> > > think it's worth trying either, given how little upstream work the
> > > sparc port sees overall.
> >
> > We'll get there. There are some other SPARC-related clang bugs that need
> > to be squashed first. We have made quite some improvements and it's actually
> > maintained by the community. Of course, we don't have a commercial backer
> > but that shouldn't be necessary for open source to work.
>
> I meant there is no point for Naresh to do it as part of his build
> testing with tuxmake.
> If someone else gets it working, they can tell Naresh to try again, but until
> then, I'd limit clang regression testing to x86, arm, powerpc, s390, mips, riscv
> and arc.

We definitely cannot yet build arc.
$ cmake ... -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="ARC"
$ ARCH=arc CROSS_COMPILE=arc-linux-gnu- make LLVM=1 -j72 defconfig vmlinux
...
clang-13: error: unknown argument: '-mmedium-calls'
clang-13: error: unknown argument: '-fsection-anchors'
clang-13: error: unknown argument: '-mlock'
clang-13: error: unknown argument: '-mswape'
clang-13: error: unknown argument: '-mno-sdata'
clang-13: error: unknown argument: '-fcall-used-gp'


--
Thanks,
~Nick Desaulniers