Commit graph

366 commits

Author SHA1 Message Date
Linus Groh
f55eb18abb libc: Add mach-o/getsect.h and mach/exception.h macOS headers
Closes #18257.
2025-11-04 21:51:48 +00:00
Linus Groh
e2fb103ce1 libc: Add all macOS CommonCrypto headers
Closes #23795.
2025-11-04 21:48:06 +00:00
Linus Groh
abca5bd588 libc: Update macOS headers to SDK 26.1 2025-11-04 21:40:21 +00:00
Alex Rønne Petersen
031b0d6063 glibc: change library link order to prefer libc.so symbols
Also avoid resolving symbols in libraries that were later removed if possible.

closes #24347
2025-10-19 11:50:32 +02:00
Alex Rønne Petersen
9b4f2b40e3 musl: avoid r0 as address register in s390x __tls_get_offset
https://www.openwall.com/lists/musl/2025/10/12/4

See also 7b92d5f4052be651e9bc5cd4ad78a69ccbee865d...
2025-10-12 11:38:43 +02:00
Alex Rønne Petersen
df1909900c libc: update Linux headers to 6.17 2025-09-29 22:53:06 +02:00
Alex Rønne Petersen
ba19c1104b
musl: delete dead __restore and __restore_rt functions for hexagon, loongarch64, riscv32, riscv64
https://www.openwall.com/lists/musl/2025/09/28/2
2025-09-28 17:04:56 +02:00
Alex Rønne Petersen
993a1a3df1
musl: delete SA_RESTORER for hexagon
https://github.com/quic/musl/pull/7
2025-09-28 16:25:24 +02:00
Alex Rønne Petersen
e89cb377d0
musl: delete SA_RESTORER for riscv32
https://www.openwall.com/lists/musl/2025/09/28/1
2025-09-28 15:54:21 +02:00
Alex Rønne Petersen
1f7ee99b35 musl: add missing fenv C dummy functions for loongarch64-linux-muslsf
https://www.openwall.com/lists/musl/2025/09/27/1

closes #25367
2025-09-27 17:13:29 +02:00
Kyle Schwarz
6260d2772f glibc: guard inet-fortified.h 2025-09-24 02:55:50 +02:00
Linus Groh
93218eacaa libc: Update macOS headers to SDK 26.0 2025-09-16 21:15:13 +01:00
Alex Rønne Petersen
dfa55e193d
musl: replace .data.rel.ro with .section .data.rel.ro,"aw"
The former was an LLVM extension that appears to have been removed in LLVM 21.

I won't bother fixing gen_stubs.zig; see #23881.
2025-08-30 06:36:41 +02:00
David Senoner
70e22d79a4 libc: delete superfluous c and assembly trunc implementations 2025-08-28 20:09:07 +02:00
David Senoner
f707de15a1 libc: delete superfluous c and assembly ceil implementation 2025-08-28 07:33:50 +02:00
David Senoner
f6b0d64ddc libc: remove c floorl implementaions forgotten in #24335 2025-08-27 13:40:08 +02:00
David Senoner
9399fcddce libc: use zig isnan and derivates for mingw 2025-08-27 03:58:32 +02:00
Yefeng Li
aae5560712 Remove memcmp and memset from bundled musl and wasi 2025-08-27 03:35:18 +02:00
Alex Rønne Petersen
07cc32b004 wasi-libc: update to c89896107d7b57aef69dcadede47409ee4f702ee 2025-08-20 19:18:11 +02:00
Alex Rønne Petersen
234630bb8d
netbsd: add some missing system headers
The Lua headers are needed because, yes, NetBSD has a kernel module for Lua
support. soundcard.h is technically a system header but is installed by
libossaudio and so was missed previously.

This also removes some riscv headers that shouldn't have been added because
NetBSD does not yet officially support the riscv32/riscv64 ports.

Closes #24737.
2025-08-14 08:25:08 +02:00
Alex Rønne Petersen
675b1a15a1
glibc: update crt0 code to 2.42 2025-08-01 09:00:27 +02:00
Alex Rønne Petersen
1804251dfb
glibc: update headers to 2.42 2025-07-31 22:02:37 +02:00
Alex Rønne Petersen
cdd6e9ee3a
glibc: update abilists file to 2.42 2025-07-31 21:47:02 +02:00
DubbleClick
c7bcdb4802 fix glibc version for single_threaded.h (2.32 instead of 2.35) 2025-07-16 19:18:15 +02:00
David Senoner
b78751051f
delete superfluous assembly libc floor implementations 2025-07-04 20:05:18 +02:00
David Senoner
3124f700c7
delete superfluous libc floor implementations 2025-07-04 12:54:31 +02:00
Marc
75d6d4c3f2
add glibc versioning for a number of headers (#24237)
* getrandom was added in glibc 2.25
https://sourceware.org/bugzilla/show_bug.cgi?id=17252

* copy_file_range was added in glibc 2.27
https://sourceware.org/git/?p=glibc.git;a=commit;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f

* threads.h should not exist for glibc < 2.28

* single_threaded.h should not exist for glibc < 2.35

* Apply suggestions from code review

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

* 2.35 instead of 35

* before 2.35 instead of 2.34 and before

---------

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-06-24 16:14:00 +00:00
Alex Rønne Petersen
879bc2e5cb
mingw: Update MinGW-w64 sources to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e. 2025-06-11 18:27:15 +02:00
Alex Rønne Petersen
0979e56bd2
mingw: Update MinGW-w64 headers to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e. 2025-06-11 15:28:36 +02:00
Alex Rønne Petersen
6671442a7c
mingw: Update MinGW-w64 definitions to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e. 2025-06-11 15:28:36 +02:00
Alex Rønne Petersen
3b2bef8a95
Merge pull request #24025 from alexrp/glibc-deduplication
`libc`: Merge header directories for glibc and NetBSD libc where applicable
2025-06-04 05:14:21 +02:00
Andrew Kelley
826e1c30ba
Merge pull request #24013 from alexrp/test-matrix
More target coverage in the module test matrix
2025-06-03 17:05:15 -04:00
Andrew Kelley
597dd328e3
Merge pull request #24034 from papparapa/remove-musl-trigonometric-function
libc: replace musl's and MinGW's trigonometric functions with compiler_rt's
2025-06-03 02:54:36 -04:00
Super User
7bc3f294ce Added zig patch comments to annotate the deletion of the sincos symbol 2025-06-02 14:05:03 +00:00
Koki Ueha
71ff3830df libc: replace MinGW's trigonometric functions with compiler_rt's
- sinf
- cosf
- sincos
- sincosf
- tanf
2025-06-01 11:25:51 +00:00
Linus Groh
c907866d55 libc: update macOS headers to SDK 15.5 2025-05-31 22:40:38 +02:00
Koki Ueha
21d9e03758 libc: replace musl's trigonometric functions with compiler_rt's
- sin
- sinf
- cos
- cosf
- sincos
- sincosf
- tan
- tanf
2025-05-30 15:32:52 +00:00
Alex Rønne Petersen
0cbff2ff7f mingw: Remove libscrnsav(e,w) support.
This defines a WinMain() function that can be potentially problematic when it
isn't wanted. If we add back support for this library in the future, it should
be built separately from mingw32.lib and on demand.
2025-05-30 01:03:47 +02:00
Alex Rønne Petersen
63a9048baf
libc: Merge header directories for glibc and NetBSD libc where applicable.
Manual patches:

* lib/libc/include/csky-linux-gnu/gnu/{lib-names,stubs}.h
* lib/libc/include/powerpc-linux-gnu/bits/long-double.h

Takes lib/libc/include from 115.5 MB to 113.4 MB.

Closes #21258.
2025-05-30 00:15:39 +02:00
Alex Rønne Petersen
cbf9d3c570
libc: Remove riscv32-netbsd-none and riscv64-netbsd-none headers.
These were not intended to be included as NetBSD's RISC-V port has not had an
official release yet.
2025-05-29 16:48:28 +02:00
David
55848363fd
libc: implement common abs for various integer sizes (#23893)
* libc: implement common `abs` for various integer sizes

* libc: move imaxabs to inttypes.zig and don't use cInclude

* libc: delete `fabs` c implementations because already implemented in compiler_rt

* libc: export functions depending on the target libc

Previously all the functions that were exported were handled equally,
though some may exist and some not inside the same file. Moving the
checks inside the file allows handling different functions differently

* remove empty ifs in inttypes

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

* remove empty ifs in stdlib

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

* libc: use `@abs` for the absolute value calculation

---------

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-05-21 00:57:38 +02:00
Alex Rønne Petersen
c36d483ba0
libc: Add NetBSD libc abilists file.
Currently covers version 10.1.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
1c342ca7c3
libc: Add NetBSD libc startup code from 10.1.
* sysident_assym.h was manually expanded.
    * The ELF_NOTE_MARCH_DESC and ELF_NOTE_MARCH_DESCSZ macros will be defined
      by the compiler.
* Legacy .init/.fini stuff was removed.
* GCJ nonsense was removed.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
553cb3ed46
libc: Add NetBSD system and libc headers from 10.1.
sys/param.h was manually adjusted to not define __NetBSD_Version__ since it will
be defined by the compiler.
2025-05-17 04:41:27 +02:00
Bryson Miller
08d534e8d8
Introduce common strcasecmp and strncasecmp implementations (#23840) 2025-05-15 10:58:33 +02:00
Linus Groh
abbead1fb8 libc: update macOS headers to SDK 15.2 2025-05-12 16:50:17 +02:00
Alex Rønne Petersen
be566a4c11
libc: Add FreeBSD libc abilists file.
Currently covers version 1.7 (FreeBSD 14.0.0).
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
a36dcef7dc
libc: Add FreeBSD libc startup code from 14.2.0.
* NT_FREEBSD_ABI_TAG was manually adjusted from using a hardcoded value to using
  __FreeBSD_version which will be defined by the compiler.
* GCJ stuff was removed.
* HAVE_CTORS definitions were removed.
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
6e64bc845f
libc: Add FreeBSD system and libc headers from 14.2.0.
osreldate.h and sys/param.h were manually adjusted to not __FreeBSD_version
since it will be defined by the compiler.
2025-05-10 12:19:26 +02:00
David
2c241b263c
Introduce common bzero libc implementation. (#23812)
* Introduce common `bzero` libc implementation.

* Update test name according to review

Co-authored-by: Linus Groh <mail@linusgroh.de>

* address code review

- import common implementation when musl or wasi is included
- don't use `c_builtins`, use `@memset`

* bzero calling conv to .c

* Apply review

Co-authored-by: Veikka Tuominen <git@vexu.eu>

---------

Co-authored-by: Linus Groh <mail@linusgroh.de>
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2025-05-10 10:37:21 +02:00