Commit Graph
66774 Commits
Author SHA1 Message Date
Lucas Chollet cc0939a666 Everywhere: Stop using pc in our target triples
While `pc` is not particularly wrong on x86_64, it's nonsensical on
other supported platforms, namely aarch64 and riscv64.

For consistency, we now don't use this vendor anymore, regardless of the
platform.

Within the LLVM project, we now build as `$arch-serenity`. This is
enough in most cases, the only place where we have to specify a vendor
is the target .cfg file where we use `$arch-unknown-serenity`.

When building GCC and friends, again we simply identify as
`$arch-serenity` and this is enough.

As a result, the tools in Toolchain/Local/$arch/bin are now named after
this pattern: `$arch-serenity-$tool`.

These changes affect the toolchain build scripts, serenity's build
scripts and the Ports.

The last place where we should see `x86_64-pc-serenity` is the output of
`config.sub`, which assume the vendor is `pc` on vendor-less `x86*`
triples. So `x86_64-serenity` is expanded to `x86_64-pc-serenity`,
luckily enough and AFAICT, the whole GNU ecosystem considers `pc`,
`unknown` and vendor-less target triples the same. So `configure`
shouldn't have an issue finding the right tools anyway.

The gn files were edited with sed and are not tested.

This commit also includes a check in `Meta/serenity.sh` to give a nicer
error message when trying to build the system with an old toolchain.

----

To test this patch, on a clean tree I:
 - Ran `./Meta/serenity.sh x86_64 GNU`
 - Ran `./Toolchain/BuildJakt.sh`
 - Tested these ports: python3(configure based), libjxl(cmake based) and
   rizin(meson based)
 - Also booted on aarch64 and risv64

I also repeated the steps above with a Clang toolchain.

On a working tree I tested all the affected ports, the results are:
 - tinycc build fine but can't compile programs, I observed the same on
   master.
 - gdb and epsilon don't build but report the same errors as on master.
 - I manually edited the libgpg-error, and it builds fine.
 - The gcc port works fine.
2026-03-13 20:59:49 +01:00
Lucas Chollet 3a272e71b8 Ports: Explicitely link against libintl when using libgpg-error
For some reason, this will become necessary in the next commit. This
library is already included in glibc so it is not needed to link against
it on Linux, but otherwise required.
2026-03-13 20:59:49 +01:00
Lucas Chollet 464fb9de01 Kernel: Build with -fzero-call-used-regs=used-gpr on Clang too
This is supported since LLVM 15.
2026-03-11 14:47:27 +01:00
dependabot[bot] 813d327bec CI: Bump docker/login-action from 3 to 4
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-03-10 14:05:23 +01:00
Sönke Holz 0dc3cb3f07 Kernel/SD: Add proper memory fences in ADMA2 implementation
This allows us to stop using MemoryType::IO for the DMA buffer.
MemoryType::NonCacheable is the default memory type parameter, so just
stop requesting MemoryType::IO explicitly.
2026-03-09 18:28:45 +01:00
Sönke Holz 8293daef96 Kernel/DeviceTree: Store Device::m_node as a reference
I forgot to do this in 4da3b074d8. We no longer need to use a pointer
since that commit made Device non-movable.
2026-03-07 18:19:40 +01:00
Sönke Holz 4da3b074d8 Kernel/DeviceTree: Make Device non-movable
Making it movable is no longer necessary since bfda800128.
Making it non-movable ensures that drivers can rely on pointers to
devices being stable.
2026-03-06 13:53:37 +01:00
Sönke Holz d0267b3521 Kernel/SD: Add a spec reference to SlotInformationRegister 2026-03-06 12:30:52 +01:00
Sönke Holz 370fb8bede Kernel/SD: Remove a redundant [[gnu::packed]] 2026-03-06 12:30:52 +01:00
Sönke Holz 6043b373f7 Kernel/SD: Propagate errors during PCISDHostController construction 2026-03-06 12:30:52 +01:00
Sönke Holz 3a85f95b25 Kernel/SD: Remove a redundant base class initializer
The base class doesn't take any arguments.
2026-03-06 12:30:52 +01:00
Sönke Holz 6b0489e6a8 Kernel/SD: Use PCI::map_bar in PCISDHostController
PCI::get_BAR just returns the raw BAR value, doesn't handle 64-bit BARs,
and doesn't handle non-identity mapped PCI address spaces.
2026-03-06 12:30:52 +01:00
dependabot[bot] 279999841b CI: Bump actions/upload-artifact from 5 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-03-04 19:49:55 +01:00
Lucas Chollet 94eedd35cd Ports: Drop the libtool patch for libgpg-error
These changes were upstreamed by timschumi a few years ago. The patch
was dropped by doing:
```
$ ./package.sh dev
$ git am --skip # As there are no changes on the git tree.
$ exit
```
2026-03-04 16:58:05 +01:00
Sönke Holz 6e180070e3 Kernel/USB: Don't crash if device returns incorrect descriptor type 2026-03-03 12:03:23 +01:00
Sönke Holz a8de2ac103 Kernel/USB: Actually print the hub creation error
Previously, we attempted to print the device creation error. But device
creation should have already succeeded to reach this if statement, so
we would always crash if hub creation failed (.error() panics if it's
not an error).
2026-03-03 12:03:23 +01:00
Sönke Holz 34989f0507 Toolchain: Update GDB to 17.1
The old version didn't build with modern compilers anymore.

Support for i686 was removed, so remove it from the config.bfd patch.
2026-03-01 12:49:20 +01:00
Lucas Chollet 20c2100676 Meta: Avoid grep failures in scripts that include shell_include.sh
In environments without any `SERENITY*` variables, grep returns an exit
status of 1. This patch ensures that the subcommand exits with status 0
regardless of whether grep finds a match. This prevents the script
from bailing out when `set -eo pipefail` is enabled.
2026-03-01 11:49:12 +01:00
Sönke Holz 5d7141dc6a Ports: Replace explicit mentions of x86_64 in README
Ports can be compiled for architectures other than x86-64.
2026-03-01 10:41:51 +01:00
Sönke Holz 8f0711e4ee Ports: Default to host architecture
serenity.sh defaults to the host architecture since ee2632fe0b,
so I think it's sensible to also default to it here.
2026-03-01 10:41:51 +01:00
Sönke Holz 27717e5859 Kernel+Base: Change AArch64 uname machine string to "aarch64"
Previously, only AArch64 used its "pretty" architecture name.

This matches other operating systems. Our own host architecture
detection code also only accepts "aarch64" and "arm64", not "AArch64".

I think matching the uname machine strings of other operating systems is
better than changing the other machine strings to "x86-64" and
"RISC-V 64" or "RV64I" (for RISC-V there isn't really an official
architecture name for the 64-bit variant except "RV64I").
2026-03-01 10:41:51 +01:00
Sönke Holz 18f72ce16b Meta: Factor out host architecture detection into shell_include.sh 2026-03-01 10:41:51 +01:00
Lucas Chollet b0e7120061 Ports: Don't use the fully qualified target triple
`configure` is smart enough to find the correct compiler from a
vendor-less target triple.

This will ease a future target-triple change.
2026-02-28 15:53:12 +01:00
Sönke Holz e16793201f Tests/LibC: Test %g printf format specifier with small fractions
Before the previous commit, these tests would result in an infinite
loop.

These test cases use small enough fractions to avoid the bug from
GitHub issue #26640. The default precision is 6, so this should be
printed as "10" both with correct and incorrect %g precision behavior.
2026-02-28 15:44:26 +01:00
Sönke Holz cf3d4a4f59 LibC: Properly handle small fractions in %g printf specifier
Previously, small fractions that round to zero when converting them to
an integer would cause an infinite loop, since `ifraction % 10` is
always zero in that case.

When `ifraction` is zero, we don't need to print a fraction, so just
skip printing it.
2026-02-28 15:44:26 +01:00
Lucas Chollet 5a5256fca7 Kernel: Stop specifying link_directories for GCC
These two lines seem unnecessary to boot on x86_64, aarch64 and riscv64.
It's not obvious to me why they were added in the first place (it was
in this commit: b5c98ede08).
2026-02-28 15:28:46 +01:00
Lucas Chollet c38fffcd82 Ports: Let the port system choose LD when building pv
This logic is already implemented in hosted_defs.sh.
2026-02-28 10:03:32 +01:00
Lucas Chollet 6e2424934e Ports: Update pv to 1.10.3
Looks like we don't need -Wno-deprecated-declarations anymore. Thanks
for catching this Sönke!
2026-02-28 10:03:32 +01:00
Lucas Chollet eb1d252345 Ports: Remove qop
The project looks abandoned. It never left the draft status and the
last commit was two years ago, which is only two months after the
initial commit.
2026-02-27 23:09:34 +01:00
Lucas CHOLLET 97b817817a LibGfx/JPEG: Add a deringing pass to the encoder
The idea is described here https://kornel.ski/deringing/. And allows
reducing the noise around sharp white edges. This is visible when
encoding an image like `buggie.png`. One nice aspect of the optimization
is that it only affects macroblocks where it can help.
2026-02-27 17:42:36 +01:00
Lucas Chollet 19ff88d0c2 Port: Stop passing unknown option to thesilversearcher's configure
I was hit by a "configure: WARNING: unrecognized options:
--disable-utf8" when testing the second-to-last commit.
2026-02-27 11:41:43 +01:00
Lucas Chollet 6dc773ac0f Port: Stop passing unknown option to make's configure
I was hit by a "configure: WARNING: unrecognized options:
--with-sysroot" when testing the last commit.
2026-02-27 11:41:43 +01:00
Lucas Chollet cdb52e6550 Port: Stop specifying the --target option when not necessary
These ports don't interact directly with target-specific binaries so
passing a --target option don't make sense for them.
2026-02-27 11:41:43 +01:00
Lucas Chollet 38439f4cc8 Ports: Update emu2
This allows us to drop a patch and doesn't force us to explicitely
specify CC anymore.
2026-02-27 11:31:05 +01:00
Sönke Holz 835be1085d LibC: Reorder definitions in endian.h to match POSIX spec order
No behavior change. This makes it a bit easier to compare the header
with the POSIX spec.
2026-02-26 23:09:53 +01:00
Sönke Holz e2a5a212e0 LibC: Use byte order definitions from the compiler
Instead of defining LITTLE_ENDIAN and BIG_ENDIAN ourselves, we should
use the definitions from the compiler.

Additionally, we don't have <bits/endian.h>, so it's never correct to
include that header.
2026-02-26 23:09:53 +01:00
Sönke Holz 051985c46b LibC: Add some POSIX spec comments to endian.h 2026-02-26 23:09:53 +01:00
Sönke Holz e8133a43fa LibC: Remove PDP_ENDIAN
I don't expect SerenityOS to ever run on a PDP-11. This definition is
not required by POSIX either.
2026-02-26 23:09:53 +01:00
Sönke Holz c3564fdb0f LibC: Remove __bswap{16,32,64}
These definitions are unused and not required by POSIX.
2026-02-26 23:09:53 +01:00
Sönke Holz 227ee20f3c LibC: Remove {le,be}toh{16,32,64}
These definitions appear to be unused and are not required by POSIX.
They appear to be specific to OpenBSD and do not seem to exist on any
other system.
2026-02-26 23:09:53 +01:00
Sönke Holz a6f1843787 Ports: Stop defining _GNU_SOURCE for endian.h in tree-sitter
This is no longer necessary since the previous commit.
2026-02-26 23:09:53 +01:00
Sönke Holz a718987a01 LibC: Don't check for feature test macros in endian.h
We don't check for feature test macros in any other LibC header, and
especially not for _GNU_SOURCE or _BSD_SOURCE. With no feature test
macro defined, this header would previously essentially be empty.

POSIX doesn't seem to require any feature test macros for this header
either.
2026-02-26 23:09:53 +01:00
Lucas Chollet 26cb397eb3 Toolchain+Ports: Update LLVM to 22.1.0 2026-02-26 21:13:47 +01:00
Lucas Chollet 60d92b3c3d AK/SIMD: Use __builtin_elementwise_sqrt when available
This was motivated by Clang removing `__builtin_ia32_sqrtps` for the
22.1.0 release:
https://github.com/llvm/llvm-project/pull/165682

This should also allow vectorized square root on non-x86 systems when
using Clang.
2026-02-26 21:13:47 +01:00
Lucas Chollet 7791306bf4 Ports: Make doom build with more recent compilers 2026-02-26 18:52:30 +01:00
Lucas Chollet 9a91221ff3 Ports: Use the main sourceforge address for timidity
The old one seems to be dead.
2026-02-26 18:52:30 +01:00
Sönke Holz 020b01a014 LibC: Remove __attribute__((weak)) from some symbols
These symbols don't need to be weak. They aren't overridden anywhere.
2026-02-24 13:52:50 +01:00
LittleT6109 f21157163c Meta: Use American English spelling for license 2026-02-24 11:43:53 +01:00
Sönke Holz f3635e75db Kernel: Improve early backtrace format
059f280eb9 forgot to add a final newline character, causing all
addresses to be printed in one line.
Additionally, early kernel addresses were previously not printed in a
kernel load address-relative format like we do for non-early backtraces.
2026-02-22 11:55:19 +01:00
Sönke Holz 7a5109876d Kernel/I2C: Add an HID over I²C driver 2026-02-22 01:33:56 +01:00