Date: Tue, 8 Sep 2020 01:27:04 +0000 (UTC) From: Brandon Bergren <bdragon@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365441 - head/sys/conf Message-ID: <202009080127.0881R4Cl046207@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdragon Date: Tue Sep 8 01:27:03 2020 New Revision: 365441 URL: https://svnweb.freebsd.org/changeset/base/365441 Log: [PowerPC] Work around -O miscompile on powerpc 32 bit. Work around llvm 11 miscompile in 32 bit powerpc that appears to cause ifuncs to branch to the wrong address by forcing -O2. This worked in previous versions because -O was mapped to -O2 previously (but is now -O1.) While here, remove the old temporary workaround from r224882 that does the opposite thing for powerpc non-DEBUG kernels, bringing it in line with other platforms that compile at -O2. This fixes kernel boot on powerpc and powerpcspe after the llvm11 transition. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Sep 8 00:48:18 2020 (r365440) +++ head/sys/conf/kern.pre.mk Tue Sep 8 01:27:03 2020 (r365441) @@ -51,14 +51,15 @@ OBJCOPY?= objcopy SIZE?= size .if defined(DEBUG) +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" +# Work around clang 11 miscompile on 32 bit powerpc. +_MINUS_O= -O2 +.else _MINUS_O= -O +.endif CTFFLAGS+= -g .else -.if ${MACHINE_CPUARCH} == "powerpc" -_MINUS_O= -O # gcc miscompiles some code at -O2 -.else _MINUS_O= -O2 -.endif .endif .if ${MACHINE_CPUARCH} == "amd64" .if ${COMPILER_TYPE} == "clang"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009080127.0881R4Cl046207>