From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-10-12 23:00:20
If GCC is not built with glibc support then we must explicitly tell it
which register to use for TLS mode stack protector, otherwise it will
error out and the cc-option check will fail.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
If GCC is not built with glibc support then we must explicitly tell it
which register to use for TLS mode stack protector, otherwise it will
error out and the cc-option check will fail.
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-10-13 11:57:05
Christophe LEROY [off-list ref] writes:
Le 13/10/2018 à 00:58, Michael Ellerman a écrit :
quoted
If GCC is not built with glibc support then we must explicitly tell it
which register to use for TLS mode stack protector, otherwise it will
error out and the cc-option check will fail.
Yes, you're right.
$ /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc -o empty.o -Wall -c empty.c -mstack-protector-guard=tls
$ echo $?
0
But with mine:
$ /home/kerkins/toolchains/ppc/gcc-8-branch/powerpc-linux/bin/powerpc-linux-gcc -o empty.o -Wall -c empty.c -mstack-protector-guard=tls
cc1: error: ‘-mstack-protector-guard=tls’ needs a valid base register
So it's only my cross compilers that don't work.
The kernel.org ones are:
Configured with: /home/arnd/git/gcc/configure --target=powerpc64-linux
--enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/powerpc64-linux
--enable-languages=c --without-headers --disable-bootstrap
--disable-nls --disable-threads --disable-shared --disable-libmudflap
--disable-libssp --disable-libgomp --disable-decimal-float
--disable-libquadmath --disable-libatomic --disable-libcc1
--disable-libmpx --enable-checking=release
Whereas mine is:
Configured with: ../../src/gcc/configure
--prefix=/home/kerkins/workspace/gcc-build/gcc/gcc-8-branch/target/ppc/build/install/powerpc-linux
--disable-multilib --disable-bootstrap --enable-languages=c
--with-pkgversion='Custom 2c79ff811dfcee1c' --target=powerpc-linux
--enable-targets=all
So I wonder if something in there is making the difference?
I guess I'll just rewrite the change log to say "some toolchains".
cheers
On Sat, Oct 13, 2018 at 10:55:01PM +1100, Michael Ellerman wrote:
So it's only my cross compilers that don't work.
The kernel.org ones are:
Configured with: /home/arnd/git/gcc/configure --target=powerpc64-linux
--enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/powerpc64-linux
--enable-languages=c --without-headers --disable-bootstrap
--disable-nls --disable-threads --disable-shared --disable-libmudflap
--disable-libssp --disable-libgomp --disable-decimal-float
--disable-libquadmath --disable-libatomic --disable-libcc1
--disable-libmpx --enable-checking=release
Whereas mine is:
Configured with: ../../src/gcc/configure
--prefix=/home/kerkins/workspace/gcc-build/gcc/gcc-8-branch/target/ppc/build/install/powerpc-linux
--disable-multilib --disable-bootstrap --enable-languages=c
--with-pkgversion='Custom 2c79ff811dfcee1c' --target=powerpc-linux
--enable-targets=all
So I wonder if something in there is making the difference?
You have --disable-libssp on the buildall-built compiler, which makes GCC
assume your libc has the SSP support routines, which gives you these default
offsets (which are what they are on glibc). Never mind that you explicitly
do not have a libc ;-)
I guess I'll just rewrite the change log to say "some toolchains".
From: Michael Ellerman <hidden> Date: 2018-10-15 04:42:35
On Fri, 2018-10-12 at 22:58:32 UTC, Michael Ellerman wrote:
If GCC is not built with glibc support then we must explicitly tell it
which register to use for TLS mode stack protector, otherwise it will
error out and the cc-option check will fail.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Christophe Leroy <redacted>
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-10-15 09:54:17
Segher Boessenkool [off-list ref] writes:
On Sat, Oct 13, 2018 at 10:55:01PM +1100, Michael Ellerman wrote:
quoted
So it's only my cross compilers that don't work.
The kernel.org ones are:
Configured with: /home/arnd/git/gcc/configure --target=powerpc64-linux
--enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/powerpc64-linux
--enable-languages=c --without-headers --disable-bootstrap
--disable-nls --disable-threads --disable-shared --disable-libmudflap
--disable-libssp --disable-libgomp --disable-decimal-float
--disable-libquadmath --disable-libatomic --disable-libcc1
--disable-libmpx --enable-checking=release
Whereas mine is:
Configured with: ../../src/gcc/configure
--prefix=/home/kerkins/workspace/gcc-build/gcc/gcc-8-branch/target/ppc/build/install/powerpc-linux
--disable-multilib --disable-bootstrap --enable-languages=c
--with-pkgversion='Custom 2c79ff811dfcee1c' --target=powerpc-linux
--enable-targets=all
So I wonder if something in there is making the difference?
You have --disable-libssp on the buildall-built compiler, which makes GCC
assume your libc has the SSP support routines, which gives you these default
offsets (which are what they are on glibc). Never mind that you explicitly
do not have a libc ;-)
OK thanks, things just get weirder and weirder :)
quoted
I guess I'll just rewrite the change log to say "some toolchains".
Or "most".
As it happens I forgot to update the change log anyway :/
Oh well.
cheers