2020-06-03 13:52:09

by Rob Landley

[permalink] [raw]
Subject: headers_install builds break on a lot of targets?

The headers_install_all target got removed last year (commit f3c8d4c7a728 and
would someone like to update Documentation/kbuild/headers_install.txt which
still describes it?)

The musl-libc maintainer is using a forked hand-hacked kernel header package in
his toolchain build project (https://github.com/richfelker/musl-cross-make), and
he said the reason for it is:

http://lists.landley.net/pipermail/toybox-landley.net/2020-March/011536.html

Because downloading 100 MB of kernel source and extracting it to a far
larger tree just to get the headers isn't really fun.

And I thought "that's why headers_install_all existed", and noticed the target
being removed, so I tried my hand at a small shell script vesion:

for i in $(echo arch/*/ | sed 's@arch/\([^/]*\)/@\1@g')
do
echo $i
X="$PWD/fruitbasket/$i"
mkdir -p "$X"
make ARCH=$i distclean defconfig headers_install \
INSTALL_HDR_PATH="$PWD/fruitbasket/$i" > /dev/null
done

On the bright side, the resulting fruitbasket.tar.xz is 1.5 megabytes. The
downside is I have no idea how broken the resulting header files are after this
error-fest:

alpha
arc
gcc: error: unrecognized command line option ‘-mmedium-calls’
gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
‘-fno-stats’?
gcc: error: unrecognized command line option ‘-mmedium-calls’
gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
‘-fno-stats’?
arm
arm64
c6x
csky
h8300
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mint32’; did you mean ‘-fintfc’?
hexagon
gcc: error: unrecognized command line option ‘-G0’
gcc: error: unrecognized command line option ‘-G0’
gcc: error: unrecognized command line option ‘-G0’
ia64
./arch/ia64/scripts/check-segrel.S: Assembler messages:
./arch/ia64/scripts/check-segrel.S:2: Error: unknown pseudo-op: `.rodata'
./arch/ia64/scripts/check-segrel.S:3: Error: no such instruction: `data4
@segrel(start)'
objdump: '/tmp/out17279': No such file
objdump: section '.rodata' mentioned in a -j option, but not found in any input file
./arch/ia64/scripts/toolchain-flags: 20: [: !=: unexpected operator
./arch/ia64/scripts/check-text-align.S: Assembler messages:
./arch/ia64/scripts/check-text-align.S:2: Error: unknown pseudo-op: `.proc'
./arch/ia64/scripts/check-text-align.S:3: Error: unknown pseudo-op: `.prologue'
./arch/ia64/scripts/check-text-align.S:4: Error: unknown pseudo-op: `.save'
./arch/ia64/scripts/check-text-align.S:7: Error: unknown pseudo-op: `.endp'
readelf: Error: '/tmp/out17279': No such file
./arch/ia64/scripts/check-gas-asm.S: Assembler messages:
./arch/ia64/scripts/check-gas-asm.S:1: Error: junk at end of line, first
unrecognized character is `['
./arch/ia64/scripts/check-gas-asm.S:2: Error: unknown pseudo-op: `.xdata4'
objdump: '/tmp/out17306.o': No such file
objdump: section '.data' mentioned in a -j option, but not found in any input file
./arch/ia64/scripts/check-gas: 11: [: !=: unexpected operator
./arch/ia64/scripts/check-segrel.S: Assembler messages:
./arch/ia64/scripts/check-segrel.S:2: Error: unknown pseudo-op: `.rodata'
./arch/ia64/scripts/check-segrel.S:3: Error: no such instruction: `data4
@segrel(start)'
objdump: '/tmp/out19677': No such file
objdump: section '.rodata' mentioned in a -j option, but not found in any input file
./arch/ia64/scripts/toolchain-flags: 20: [: !=: unexpected operator
./arch/ia64/scripts/check-text-align.S: Assembler messages:
./arch/ia64/scripts/check-text-align.S:2: Error: unknown pseudo-op: `.proc'
./arch/ia64/scripts/check-text-align.S:3: Error: unknown pseudo-op: `.prologue'
./arch/ia64/scripts/check-text-align.S:4: Error: unknown pseudo-op: `.save'
./arch/ia64/scripts/check-text-align.S:7: Error: unknown pseudo-op: `.endp'
readelf: Error: '/tmp/out19677': No such file
./arch/ia64/scripts/check-gas-asm.S: Assembler messages:
./arch/ia64/scripts/check-gas-asm.S:1: Error: junk at end of line, first
unrecognized character is `['
./arch/ia64/scripts/check-gas-asm.S:2: Error: unknown pseudo-op: `.xdata4'
objdump: '/tmp/out19705.o': No such file
objdump: section '.data' mentioned in a -j option, but not found in any input file
./arch/ia64/scripts/check-gas: 11: [: !=: unexpected operator
./arch/ia64/scripts/check-segrel.S: Assembler messages:
./arch/ia64/scripts/check-segrel.S:2: Error: unknown pseudo-op: `.rodata'
./arch/ia64/scripts/check-segrel.S:3: Error: no such instruction: `data4
@segrel(start)'
objdump: '/tmp/out19983': No such file
objdump: section '.rodata' mentioned in a -j option, but not found in any input file
./arch/ia64/scripts/toolchain-flags: 20: [: !=: unexpected operator
./arch/ia64/scripts/check-text-align.S: Assembler messages:
./arch/ia64/scripts/check-text-align.S:2: Error: unknown pseudo-op: `.proc'
./arch/ia64/scripts/check-text-align.S:3: Error: unknown pseudo-op: `.prologue'
./arch/ia64/scripts/check-text-align.S:4: Error: unknown pseudo-op: `.save'
./arch/ia64/scripts/check-text-align.S:7: Error: unknown pseudo-op: `.endp'
readelf: Error: '/tmp/out19983': No such file
./arch/ia64/scripts/check-gas-asm.S: Assembler messages:
./arch/ia64/scripts/check-gas-asm.S:1: Error: junk at end of line, first
unrecognized character is `['
./arch/ia64/scripts/check-gas-asm.S:2: Error: unknown pseudo-op: `.xdata4'
objdump: '/tmp/out20014.o': No such file
objdump: section '.data' mentioned in a -j option, but not found in any input file
./arch/ia64/scripts/check-gas: 11: [: !=: unexpected operator
m68k
microblaze
mips
nds32
nios2
openrisc
parisc
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: unrecognized command line option ‘-mno-space-regs’; did you mean
‘-fno-make-deps’?
gcc: error: unrecognized command line option ‘-mfast-indirect-calls’; did you
mean ‘-fno-indirect-classes’?
gcc: error: unrecognized command line option ‘-mdisable-fpregs’; did you mean
‘-fdisable-’?
powerpc
riscv
s390
sh
sparc
um
gcc: error: missing argument to ‘-Wframe-larger-than=’
Makefile:1230: *** Headers not exportable for the um architecture. Stop.
make: *** [__build_one_by_one] Error 2
unicore32
gcc: error: missing argument to ‘-Wframe-larger-than=’
gcc: error: missing argument to ‘-Wframe-larger-than=’
x86
xtensa
gcc: error: unrecognized command line option ‘-mlongcalls’
gcc: error: unrecognized command line option ‘-mtext-section-literals’; did you
mean ‘-fext-numeric-literals’?
gcc: error: unrecognized command line option ‘-mlongcalls’
gcc: error: unrecognized command line option ‘-mtext-section-literals’; did you
mean ‘-fext-numeric-literals’?
gcc: error: unrecognized command line option ‘-mlongcalls’
gcc: error: unrecognized command line option ‘-mtext-section-literals’; did you
mean ‘-fext-numeric-literals’?


2020-06-03 14:08:43

by Arnd Bergmann

[permalink] [raw]
Subject: Re: headers_install builds break on a lot of targets?

On Wed, Jun 3, 2020 at 3:49 PM Rob Landley <[email protected]> wrote:
>
> The headers_install_all target got removed last year (commit f3c8d4c7a728 and
> would someone like to update Documentation/kbuild/headers_install.txt which
> still describes it?)
>
> The musl-libc maintainer is using a forked hand-hacked kernel header package in
> his toolchain build project (https://github.com/richfelker/musl-cross-make), and
> he said the reason for it is:
>
> http://lists.landley.net/pipermail/toybox-landley.net/2020-March/011536.html
>
> Because downloading 100 MB of kernel source and extracting it to a far
> larger tree just to get the headers isn't really fun.
>
> And I thought "that's why headers_install_all existed", and noticed the target
> being removed, so I tried my hand at a small shell script vesion:
>
> for i in $(echo arch/*/ | sed 's@arch/\([^/]*\)/@\1@g')
> do
> echo $i
> X="$PWD/fruitbasket/$i"
> mkdir -p "$X"
> make ARCH=$i distclean defconfig headers_install \
> INSTALL_HDR_PATH="$PWD/fruitbasket/$i" > /dev/null
> done
>
> On the bright side, the resulting fruitbasket.tar.xz is 1.5 megabytes. The
> downside is I have no idea how broken the resulting header files are after this
> error-fest:

I think the problem is that you can no longer run 'make defconfig ARCH=foo'
without passing a CROSS_COMPILE=${ARCH}-linux-gnu- argument pointing
to a valid toolchain target triple.

You can use the cross-compilers from
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/
to do this if you need kernel headers for an architecture that you have no
cross-compilers for, but they are build against glibc and won't run on
a musl based host, or anything other than x86-64, arm64 or ppc64le
that I built for.

I don't know if you can just run 'make headers_install' without configuring
first, or if that is something that can be easily changed if it doesn't already
work.

Arnd

2020-06-03 14:17:14

by Richard Weinberger

[permalink] [raw]
Subject: Re: headers_install builds break on a lot of targets?

On Wed, Jun 3, 2020 at 3:51 PM Rob Landley <[email protected]> wrote:
> um
> gcc: error: missing argument to ‘-Wframe-larger-than=’
> Makefile:1230: *** Headers not exportable for the um architecture. Stop.
> make: *** [__build_one_by_one] Error 2

Exporting headers of UML makes not much sense.

--
Thanks,
//richard

2020-06-03 16:26:30

by David Woodhouse

[permalink] [raw]
Subject: Re: headers_install builds break on a lot of targets?

On Wed, 2020-06-03 at 16:05 +0200, Arnd Bergmann wrote:
> I don't know if you can just run 'make headers_install' without configuring
> first, or if that is something that can be easily changed if it doesn't already
> work.

It would be kind of wrong for the exported ABI headers to depend on
today's build configuration of the kernel, surely?


Attachments:
smime.p7s (5.05 kB)

2020-06-03 17:06:35

by Rich Felker

[permalink] [raw]
Subject: Re: headers_install builds break on a lot of targets?

On Wed, Jun 03, 2020 at 08:49:54AM -0500, Rob Landley wrote:
> The headers_install_all target got removed last year (commit f3c8d4c7a728 and
> would someone like to update Documentation/kbuild/headers_install.txt which
> still describes it?)
>
> The musl-libc maintainer is using a forked hand-hacked kernel header package in
> his toolchain build project (https://github.com/richfelker/musl-cross-make), and
> he said the reason for it is:

These are provided by sabotage-linux, and are not entirely hand-hacked
but have a documented and at least partly scripted process by which
they're built:

https://github.com/sabotage-linux/kernel-headers

There's no obligation to use them, but using them makes things easier.

Note that, at the time the default was switched, there were no
upstream kernel headers compatible with a time64 userspace yet, so
whichever source you wanted to use required patching anyway.

As of 5.6 I believe everything is upstream and we could add stock 5.6
(or later) headers as a supported choice.

> http://lists.landley.net/pipermail/toybox-landley.net/2020-March/011536.html
>
> Because downloading 100 MB of kernel source and extracting it to a far
> larger tree just to get the headers isn't really fun.
>
> And I thought "that's why headers_install_all existed", and noticed the target
> being removed, so I tried my hand at a small shell script vesion:
>
> for i in $(echo arch/*/ | sed 's@arch/\([^/]*\)/@\1@g')
> do
> echo $i
> X="$PWD/fruitbasket/$i"
> mkdir -p "$X"
> make ARCH=$i distclean defconfig headers_install \
> INSTALL_HDR_PATH="$PWD/fruitbasket/$i" > /dev/null
> done
>
> On the bright side, the resulting fruitbasket.tar.xz is 1.5 megabytes. The
> downside is I have no idea how broken the resulting header files are after this
> error-fest:
>
> alpha
> arc
> gcc: error: unrecognized command line option ‘-mmedium-calls’
> gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
> ‘-fno-stats’?
> gcc: error: unrecognized command line option ‘-mmedium-calls’
> gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
> ‘-fno-stats’?
> [...]

Uhg. Surely there should be some fix for whatever mistaken dep is
behind this? Headers shouldn't actually depend on any config/compiler
output, should they?? Or is that machinery somehow involved in
generating the syscall lists and similar?

Rich


2020-06-03 18:02:14

by Arnd Bergmann

[permalink] [raw]
Subject: Re: headers_install builds break on a lot of targets?

On Wed, Jun 3, 2020 at 7:04 PM Rich Felker <[email protected]> wrote:
> On Wed, Jun 03, 2020 at 08:49:54AM -0500, Rob Landley wrote:
> > make ARCH=$i distclean defconfig headers_install \
> >
> > On the bright side, the resulting fruitbasket.tar.xz is 1.5 megabytes. The
> > downside is I have no idea how broken the resulting header files are after this
> > error-fest:
> >
> > alpha
> > arc
> > gcc: error: unrecognized command line option ‘-mmedium-calls’
> > gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
> > ‘-fno-stats’?
> > gcc: error: unrecognized command line option ‘-mmedium-calls’
> > gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
> > ‘-fno-stats’?
> > [...]
>
> Uhg. Surely there should be some fix for whatever mistaken dep is
> behind this? Headers shouldn't actually depend on any config/compiler
> output, should they??

The first one of the two comes from "make defconfig", which definitely needs
a working $TARGET compiler, but isn't actually needed before
"make headers_install" as I just checked.

> Or is that machinery somehow involved in
> generating the syscall lists and similar?

The syscall list for ARC is still not generated (that's on my todo list), but
something does call it even for "make headers_install".

What it does is to set Makefile variables such as

CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
and trying out all kinds of gcc options that may or may not be supported
such as "$(call cc-option,-fno-tree-loop-im)".

Setting CC=: avoids this, like

make -s CC=: ARCH=$i headers_install INSTALL_HDR_PATH="$PWD/fruitbasket/$i"

Arnd

2020-06-04 01:54:44

by Masahiro Yamada

[permalink] [raw]
Subject: Re: headers_install builds break on a lot of targets?

On Thu, Jun 4, 2020 at 2:59 AM Arnd Bergmann <[email protected]> wrote:
>
> On Wed, Jun 3, 2020 at 7:04 PM Rich Felker <[email protected]> wrote:
> > On Wed, Jun 03, 2020 at 08:49:54AM -0500, Rob Landley wrote:
> > > make ARCH=$i distclean defconfig headers_install \
> > >
> > > On the bright side, the resulting fruitbasket.tar.xz is 1.5 megabytes. The
> > > downside is I have no idea how broken the resulting header files are after this
> > > error-fest:
> > >
> > > alpha
> > > arc
> > > gcc: error: unrecognized command line option ‘-mmedium-calls’
> > > gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
> > > ‘-fno-stats’?
> > > gcc: error: unrecognized command line option ‘-mmedium-calls’
> > > gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean
> > > ‘-fno-stats’?
> > > [...]
> >
> > Uhg. Surely there should be some fix for whatever mistaken dep is
> > behind this? Headers shouldn't actually depend on any config/compiler
> > output, should they??
>
> The first one of the two comes from "make defconfig", which definitely needs
> a working $TARGET compiler, but isn't actually needed before
> "make headers_install" as I just checked.
>
> > Or is that machinery somehow involved in
> > generating the syscall lists and similar?
>
> The syscall list for ARC is still not generated (that's on my todo list), but
> something does call it even for "make headers_install".
>
> What it does is to set Makefile variables such as
>
> CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
> and trying out all kinds of gcc options that may or may not be supported
> such as "$(call cc-option,-fno-tree-loop-im)".
>
> Setting CC=: avoids this, like
>
> make -s CC=: ARCH=$i headers_install INSTALL_HDR_PATH="$PWD/fruitbasket/$i"
>
> Arnd



You can do headers_install without the .config file.
'make defconfig' is unneeded.

headers_install should be independent of $(CC) too.


linux-next has some progress about this.

You can get clean headers_install without CROSS_COMPILE
for parisc, h8300, hexagon.


You still get warnings for ia64 and arc.
Our goal is to not require $(CC) for non-dot-config target
like 'make headers_install', 'make help', etc.


--
Best Regards
Masahiro Yamada