Commit Graph

18 Commits

Author SHA1 Message Date
Peter Kokot
e358634cdc
Sync Zend/*_i386_sysv_elf_gas.S with upstream (#15788)
This is a sync with upstream already fixed in early 2024 which fixes
64-bit builds on 32-bit hosts. PHP's bundled config.guess sets the
host_alias, for example, on Solaris systems to 64-bit if the compiler
supports it even though the architecture is actually 32-bit. These
assembly files resolve this situation in a build-system-agnostic way by
including the architecture file that is supported by the compiler.
2024-09-07 21:27:02 +02:00
Peter Kokot
de48b90d61
Convert CRLF line endings to LF (#15767)
This patch simplifies line endings tracked in the Git repository and
syncs them to the LF style instead of the CRLF.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git also provides `.gitattributes` file to specify files that need
specific line endings in the working directory on all platforms (either
CRLF or LF):

```
file-with-crlf text eol=crlf
```

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion if core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2024-09-07 11:03:32 +02:00
Peter Kokot
824f55ae84
Sync Zend/asm/make_ppc64_sysv_macho_gas.S with upstream (#15769)
There was a typo in make_ppc64_sysv_macho_gas.S with missing closing
multi-line comment. Upstream fixed it in ~2023:
https://github.com/boostorg/context/
2024-09-06 08:42:44 +02:00
Ørjan Malde
ff76cb738b
rudimentary midipix port (#13896) 2024-04-18 08:19:44 +02:00
qiangxuhui
0766ac6e35
loongarch64 support for fibers
Add loongarch64 assembly files from Boost, needed for fibers support,
and hook up loongarch64 fibers support during configure.

Close GH-13914
2024-04-08 18:59:02 +01:00
Claudio Jeker
4bf4c24aa8 Implement fcontext handling for sparc64_sysv_elf.
This was tested on OpenBSD sparc64 and all fiber related tests pass.
On OpenBSD stackghost prevents the modification of the return address
and therefor an extra trampoline is needed in make_fcontext(). This
should not matter on other OS implementing sysv ABI and the trampoline
should work there as well.

Close GH-13382.
2024-03-12 11:06:18 +00:00
David Carlier
f9a83a4bd4 fiber fix wrong asm directives on (default) solaris build mode.
Illumos/Solaris while being 64 bits produces by default 32 bits build.
In this case building the i386 assembly.

Close GH-13320
2024-02-04 17:39:24 +00:00
David Carlier
cd01639b59 Merge branch 'PHP-8.2' 2023-02-05 16:47:09 +00:00
David Carlier
c6f0e89f16 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-05 16:41:34 +00:00
Niels Dossche
49551d7c29 Sync boost/context assembly files for fibers
Fixes GH-10398

The stack was misaligned upon entering the trampoline function [1], this
causes a CPU trap when the SSE instruction is executed to copy data from
the stack. This was fixed upstream [2]. This commit syncs all upstream
changes from the boost/context assembly files to our copy.

[1] https://github.com/php/php-src/pull/10407#issuecomment-1404180877
[2] https://github.com/boostorg/context/pull/219

Closes GH-10407.
2023-02-05 16:40:54 +00:00
Chen, Hu
37b84b7e32
Fiber: add shadow stack support
Shadow stack is part of Intel's Control-Flow Enforcement Technology (CET).

Whenever a function is called, the return address is pushed onto both
the regular stack and the shadow stack. When that function returns, the
return addresses are popped off both stacks and compared; if they fail
to match, #CP raised.

With this commit, we create shadow stack for each fiber context and
switch the shadow stack accordingly during fcontext switch.

Signed-off-by: Chen, Hu <hu1.chen@intel.com>

Closes GH-9283.
2022-11-07 14:48:27 +01:00
dixyes
279a297172
Windows arm64 build system support
Closes GH-9116.
2022-08-09 16:22:14 +02:00
Chen
040a37d3f1
Add IBT support for fiber
Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.

This commit adds IBT support for fiber:
1. Add endbr32/64 in assembly
2. Inform compiler jump_fcontext may return via indirect branch

Furthermore:
gcc support CET since v8.1 and set it to default since gcc 11. That is,
the ELF header of sapi/cli/php has a property named IBT. However, such
property is lost since PHP8.1 because the assembly introduced by Fiber.
This commit also fixes this.

Closes GH-8339

Signed-off-by: Chen, Hu <hu1.chen@intel.com>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-05-25 13:42:31 -05:00
Jeremie Courreges-Anglas
70b02d75f2
riscv64 support for fibers
We add riscv64 assembly files from Boost, needed for fibers support,
and hook up riscv64 fibers support during configure.

Closes GH-7879.
2022-01-04 12:06:37 +01:00
Aaron Piotrowski
5eead6dfa4
Update bundled boost asm to latest versions 2021-11-22 18:00:43 -06:00
Clément Chigot
cfe8a455a6 Fix bug #81507: Adjust XCOFF asm files for AIX assembler
AIX assembler is a bit more strict than GNU assembler. Thus, adjust
the XCOFF asm files to be able to accept both assembler.

This pulls in upstream boost context changes from
https://github.com/boostorg/context/pull/191.

Closes GH-7579.
2021-11-04 10:54:42 +01:00
Calvin Buckley
ea604f0917
AIX/XCOFF support for fibers (#7338) 2021-08-16 17:05:58 -05:00
Aaron Piotrowski
c276c16b66
Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

Closes GH-6875.
2021-04-26 11:07:06 -05:00