Age | Commit message (Collapse) | Author |
|
On architectures that do not always spill the return address to the stack,
it is possible for local stack frame data corruption in leaf functions to
span stack frames if the retguard cookie is not spilled in the function.
In leaf functions on these architectures, now spill the retguard cookie if
the function contains arrays or has variables which have their address taken.
|
|
This adapts the -mfix-loongson2f-btb workaround from as(1) to
LLVM/clang. Because LLVM emits machine code directly without using
assembly as intermediary form, the workaround has to be applied
in the compiler backend in addition to the integrated assembler.
Discussed with miod@
OK mortimer@
|
|
Add R_PPC_ADDR24 to lld. We need R_PPC_ADDR24 for absolute branches
"ba" and "bla" in locore.S in the kernel.
In Makefile.macppc, add a gapdummy (like in Makefile.powerpc64) to
avoid an lld error. Also adapt a part of Makefile.i386, so my
powerpc64 can use clang and lld to build and link the macppc kernel.
(I didn't boot that kernel.)
My macppc can now build, link, and boot kernels with either ld.bfd or
ld.lld. Beware that kernels linked with ld.lld have at least one
problem (wrong &etext) not yet fixed.
ok kettenis@
|
|
undefined references to .got2 on powerpc making it possible to link
llvm with lld.
ok gkoehler@
|
|
ok hackroom
tested by plenty
|
|
In the PPC32 SVR4 ABI, a va_list has copies of registers from the
function call. va_arg looked in the wrong registers for (the pointer
representation of) an object in Objective-C, and for some types in
C++. Fix va_arg to look in the general-purpose registers, not the
floating-point registers. Also fix va_arg for some C++ types, like a
member function pointer, that are aggregates for the ABI.
Anthony Richardby found the problem in Objective-C. Eli Friedman
suggested part of this fix.
Fixes https://bugs.llvm.org/show_bug.cgi?id=47921
I have submitted this diff as https://reviews.llvm.org/D90329
ok kettenis@
|
|
ok hackroom
tested by plenty
|
|
object file.
ok guenther@
|
|
Change the 64-bit target to use "ld" (load 64-bit doubleword) for the
cookie. The 32-bit target stays with "lwz" (load 32-bit word).
ok mortimer@
|
|
ok deraadt@ kettenis@
|
|
ok deraadt@
|
|
ok hackroom
tested by plenty
|
|
registers with retguard enabled.
ok kettenis@
|
|
Disable options like clang -fno-unsafe-math-optimizations for all
targets except X86 (and SystemZ). This prevents a crash of clang,
reported by cwen@, in graphics/babl or emulators/mednafen for powerpc.
ok mortimer@
This change comes from llvm 11.x:
https://github.com/llvm/llvm-project/commit/d4ce862
Reland "[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support."
We currently have strict floating point/constrained floating point enabled
for all targets. Constrained SDAG nodes get converted to the regular ones
before reaching the target layer. In theory this should be fine.
However, the changes are exposed to users through multiple clang options
already in use in the field, and the changes are _completely_ _untested_
on almost all of our targets. Bugs have already been found, like
"https://bugs.llvm.org/show_bug.cgi?id=45274".
This patch disables constrained floating point options in clang everywhere
except X86 and SystemZ. A warning will be printed when this happens.
Use the new -fexperimental-strict-floating-point flag to force allowing
strict floating point on hosts that aren't already marked as supporting
it (X86 and SystemZ).
Differential Revision: https://reviews.llvm.org/D80952
|
|
This comment was from my commit of 2020-05-02,
> Don't make an illegal adde. Avoids fatal error on PowerPC.
When we merged LLVM 10, we got upstream's fix for the illegal adde
problem, and this comment became the only difference in this file
between us and upstream.
Found by Brad Smith.
|
|
ok hackroom
tested by plenty
|
|
ok hackroom
tested by plenty
|
|
LLVM 10 includes a different fix (https://reviews.llvm.org/D71954), so
this change (by kettenis on 2019-02-18) is no longer needed. Thanks to
Brad Smith for providing the removal diff.
ok kettenis@
|
|
ok hackroom
tested by plenty
|
|
ok kettenis@
|
|
ok kettenis@
|
|
|
|
|
|
|
|
llvm 9 and later take more care not to inline cmpxchg8b/cx8 with
-march=i486 instead calling __atomic_* functions. This in turn breaks
the build of a large number of ports.
To avoid having to add a lock or conditionally building individual ports
with -march=i586 change the default so 64 bit atomics will always be
available.
ok patrick@ sthen@ deraadt@
|
|
|
|
ok hackroom
tested by plenty
|
|
ok hackroom
tested by plenty
|
|
|
|
|
|
"where is the kaboom?" deraadt@
|
|
|
|
|
|
|
|
development effort on OpenBSD/arm64.
|
|
|
|
ok hackroom@
|
|
ok deraadt@
|
|
This makes sure the compiler defines the _CALL_ELF pre-processor symbol
correctly.
ok mortimer@
|
|
powerpc. This matched what FreeBSD does.
ok patrick@
|
|
32-bit PowerPC doesn't have instructions for lock-free atomic ops on
8-byte values, and needs libcalls like __atomic_fetch_add_8(). In
code like "_Atomic long long a; a++;", clang doesn't emit a libcall.
This was causing linker errors on symbols like __sync_fetch_and_add_8.
Now that LLVM knows the max atomic size, its AtomicExpandPass changes
these 8-byte ops into libcalls.
ok mortimer@
|
|
This should simplify bringup and make it easier to support Big Endian
and Little Endian with the same code.
May be reconsidered if it causes too many problems with Ports.
ok kettenis@
|
|
ok kettenis@
|
|
"where is the kaboom?" deraadt@
|
|
ok hackroom@
|
|
clang defaulted to -fomit-frame-pointer when optimizing PowerPC code
for Linux and NetBSD. Now do it for all systems, including OpenBSD.
This affects both 32-bit and powerpc64 code.
ok kettenis@
|
|
This lets the kernel detect retguard traps and send SIGABRT instead
of SIGEMT.
SIGEMT does not indicate correctly the nature of the error (stack
overflow, violation of control flow). It can confuse the user to restart
the program without further investigation.
Prompted by and OK deraadt@
OK mortimer@
|
|
Prompted and tested by drahn@
ok deraadt@ drahn@ kettenis@ visa@
|
|
When the DAG truncates an ISD::ADDE node, DAGCombiner may optimize it
by making an adde with smaller operands. PowerPC has i1 registers,
and may truncate an i32 adde to i1, but an i1 adde is not legal for
PowerPC, and the legalize-ops phase can't fix it. This was causing
"fatal error: error in backend: Cannot select..."
cwen@ reported the error
ok mortimer@ kettenis@ deraadt@
|
|
ok hackroom@
|