Commit Graph

29479 Commits

Author SHA1 Message Date
Michael Dusan
2cd536d7e8 libcxx: fix building when -fsingle-threaded
* Skip building libcxx mt-only source files when single-threaded.
* This change is required for llvm18 libcxx.
* Add standalone test to link a trivial:
    - mt-executable with libcxx
    - st-executable with libcxx
2024-06-08 15:34:19 -04:00
Krzysztof Wolicki
6327a3994a
std.Build: remove deprecated b.host in favor of b.graph.host (#20237) 2024-06-08 12:22:38 -07:00
MrDmitry
84d1580873 Report error on missing values for addConfigHeader 2024-06-08 15:18:56 -04:00
Andrew Kelley
0884a43411 CMake: remove -Dstd-docs=false flag when building stage3
This now defaults to false already since the autodocs rework.

The langref still cannot be enabled by default because the langref
contains doctests that exercise the `@cImport` feature which is disabled
in zig2 builds.
2024-06-07 12:42:14 -07:00
Andrew Kelley
aab5cccc78 start the 0.14.0 release cycle 2024-06-06 12:05:37 -07:00
Andrew Kelley
cf90dfd309 Release 0.13.0 2024-06-06 12:05:11 -07:00
Ben Crist
a9e9c9965d
Build system: Support Windows depfiles with unquoted, backslash escaped spaces (#20100) 2024-06-06 18:40:10 +00:00
Andrew Kelley
63754916c5 disable failing IoUring test
tracked by #20212
2024-06-06 11:13:22 -07:00
Maciej 'vesim' Kuliński
a4e01074b5 Add support for []enum in Build.option 2024-06-06 12:27:29 -04:00
Andrew Kelley
4d499359d5
Merge pull request #20207 from ziglang/glibc-2.39
add support for targeting glibc 2.39
2024-06-06 12:23:59 -04:00
Andrew Kelley
1118ea2e34 glibc: add min version annotation for riscv32 and loongarch64 2024-06-05 22:43:54 -07:00
Pat Tullmann
d8fffee3fb glibc: restore "weak_hidden_alias" macro for older glibc versions
The fstat,lstat,stat,mknod stubs used to build older (before v2.33)
glibc versions depend on the weak_hidden_alias macro.  It was removed
from the glibc libc-symbols header, so patch it back in for the older
builds.
2024-06-05 22:43:54 -07:00
Kang Seonghoon
5293bdfe63 glibc patch: get correct files compiled into libc_nonshared.a
The scope of libc_nonshared.a was greatly changed in glibc 2.33 and
2.34, but only the change from 2.34 was reflected so far. Glibc 2.33
finally switched to versioned symbols for stat functions, meaning that
libc_nonshared.a no longer contains them since 2.33. Relevant files were
therefore reverted to 2.32 versions and renamed accordingly.

This commit also removes errno.c, which was probably added to
libc_nonshared.a based on a wrong assumption that glibc/include/errno.h
requires glibc/csu/errno.c. In reality errno.h should refer to
__libc_errno (not to be confused with the public __errno_location),
which should be imported from libc.so. The inclusion of errno.c resulted
in wrong compile options as well; this commit fixes them as well.
2024-06-05 22:43:54 -07:00
Andrew Kelley
fd8b50ca5c glibc patch: remove some static asserts from fstatat
These are tripping on 32-bit x86 but are intended to prevent glibc
itself from being built with a bad configuration. Zig is only using this
file to create libc_nonshared.a, so it's not relevant.
2024-06-05 22:43:53 -07:00
Andrew Kelley
82ec333f27 glibc patch: don't check __LIBC macro
This is the only place in all of glibc that this macro is referenced.
What is it doing? Only preventing fstatat.c from knowing the type
definition of `__time64_t`, apparently.

Fixes compilation of fstatat.c on 32-bit x86.
2024-06-05 22:43:53 -07:00
Andrew Kelley
090025c457 glibc patch: add missing includes for inttypes.h
I don't know where glibc thinks uintptr_t is coming from, but here it
is.
2024-06-05 22:43:53 -07:00
Andrew Kelley
eead70f2d6 glibc patch: make fstatat.c and fstatat64.c compile
instead of importing every header file under the sun, I copied a couple
inline functions into these files to make them work.
2024-06-05 22:43:53 -07:00
Andrew Kelley
4c068c3be1 glibc patch: inline x86-lp_size.h
I could have just included the file from upstream glibc, but it was too
silly so I just inlined it. This patch could be dropped in a future
glibc update if desired. If omitted it will cause easily solvable
C compilation failures building glibc nonshared.
2024-06-05 22:43:53 -07:00
Motiejus Jakštys
9e76385afc glibc patch: add backwards compatibility for some symbols
- `fcntl` was renamed to `fcntl64` in glibc 2.28 (see #9485)
- `res_{,n}{search,query,querydomain}` became "their own" symbols since
  glibc 2.34: they were prefixed with `__` before.

This PR makes it possible to use `fcntl` with glibc 2.27 or older and
the `res_*` functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be
dropped. But we have to do with what we have now.
2024-06-05 22:43:53 -07:00
Andrew Kelley
ad34de32a8 update glibc start files to 2.39
README file stays intact.
2024-06-05 22:43:53 -07:00
Andrew Kelley
53137050f8 glibc: update abilists file
generated from ziglang/glibc-abi-tool commit
fc5d0a7046b76795e4219f8f168e118ec29fbc53 which now contains glibc 2.39
2024-06-05 22:43:53 -07:00
Markus F.X.J. Oberhumer
4c2e57d406 glibc: use __GLIBC_USE_DEPRECATED_SCANF for glibc versions < 2.7 2024-06-05 22:43:53 -07:00
Markus F.X.J. Oberhumer
a8db261ebb glibc: move __GLIBC__ version defines to the top of the file 2024-06-05 22:43:53 -07:00
Pat Tullmann
95a9053363 glibc: strlcpy and strlcat arrived in glibc 2.38
So only expose these in generic-glibc/string.h if Zig is building
a v2.38 (or later) glibc stub.

Announcement of 2.38 that notes strlcpy and strlcat:
https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html
2024-06-05 22:43:53 -07:00
Pat Tullmann
8a82496520 glibc headers: reallocarray added to glibc in v2.26
Here's the glibc commit that adds reallocarray to glibc:
https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da

The reallocarray symbol is declared in both stdlib.h and malloc.h.

Fix #17607
2024-06-05 22:43:53 -07:00
Xavier Bouchoux
9f9fa2df93 glibc patch: add backwards compatibility for strtol-family functions
following suit from b40943e253,
add a version guard in addition to the ISOC2X check.
2024-06-05 22:43:53 -07:00
Motiejus Jakštys
7c4bf07060 glibc patch: add a few dn_* functions
This is necessary to build glib.
2024-06-05 22:43:53 -07:00
Motiejus Jakštys
5af14711a8 glibc patch: add backwards compatibility for some symbols
- `fcntl` was renamed to `fcntl64` in glibc 2.28 (see #9485)
- `res_{,n}{search,query,querydomain}` became "their own" symbols since
  glibc 2.34: they were prefixed with `__` before.

This PR makes it possible to use `fcntl` with glibc 2.27 or older and
the `res_*` functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be
dropped. But we have to do with what we have now.
2024-06-05 22:43:53 -07:00
Andrew Kelley
a4a88e441f glibc patch: version-gate _DYNAMIC_STACK_SIZE_SOURCE
This is a patch to glibc features.h which makes
_DYNAMIC_STACK_SIZE_SOURCE undefined unless the version is >= 2.34.

This feature was introduced with glibc 2.34 and without this patch, code
built against these headers but then run on an older glibc will end up
making a call to sysconf() that returns -1 for the value of SIGSTKSZ
and MINSIGSTKSZ.
2024-06-05 22:43:53 -07:00
Andrew Kelley
cbe9923c22 glibc patch: don't hardcode __GLIBC_MINOR__
Instead Zig passes it based on the target.
2024-06-05 22:43:53 -07:00
Andrew Kelley
c09f5f3795 glibc: add riscv32 and loongarch64 2024-06-05 22:43:53 -07:00
Andrew Kelley
16d65358e9 musl: add missing entry to available_libcs 2024-06-05 22:43:53 -07:00
Andrew Kelley
8a4f583bb5 update glibc headers to 2.39 2024-06-05 22:43:53 -07:00
Andrew Kelley
3964b2a315
Merge pull request #20000 from Frojdholm/fix-gpa-crash-when-deallocating-metadata
Fix GeneralPurposeAllocator crash when deallocating metadata
2024-06-05 21:13:58 -04:00
wooster0
aef66eebe3 objcopy build step: don't accept multiple sections
The actual `zig objcopy` does not accept keeping multiple sections.
If you pass multiple `-j .section` arguments to `zig objcopy`, it will
only respect the last one passed.

Originally I changed `zig objcopy` to accept multiple sections
and then concatenate them instead of returning after outputting the
first section (see emitElf) but I realized concatenating probably doesn't make sense.
2024-06-05 19:39:43 -04:00
YANG Xudong
87150468fc generate loongarch64 Linux syscalls 2024-06-05 18:54:14 -04:00
Andrew Kelley
95f0dce7da seriously people, don't put "zig-" in your package names
related #20178
2024-06-05 15:49:47 -07:00
Ryan Liptak
b32aa99b87 File.getOrEnableAnsiEscapeSupport: Do not attempt to set DISABLE_NEWLINE_AUTO_RETURN
Follow up to #20172. Fixes #20188
2024-06-05 18:06:29 -04:00
Michael Dusan
9fe0c1dc50 ld.lld: fix -m option for big-endian arm/aarch64 2024-06-05 18:05:49 -04:00
freakmangd
9bbfb09fc3
translate-c: promote macros that reference var decls to inline functions 2024-06-05 23:06:51 +03:00
Andrew Kelley
8f27fdb84e
Merge pull request #20120 from vahur/move-consts-to-rdata
mark anondecls as constants in llvm ir
2024-06-05 14:24:00 -04:00
Andrew Kelley
8c04ffba86
Merge pull request #20192 from squeek502/fs-handle-leaks
Fix handle leaks in `Dir.makeOpenPathAccessMaskW` and a `fs` test
2024-06-05 13:45:35 -04:00
Andrew Kelley
3b77f23e76
Merge pull request #20194 from ziglang/musl-v1.2.5
upgrade musl to v1.2.5
2024-06-05 13:44:05 -04:00
Andrew Kelley
ac3faa6cb3 LLVM backend: loongarch64 support 2024-06-05 13:43:35 -04:00
Andrew Kelley
46b2f67905 update musl libc.S to v1.2.5
adds loongarch64 and riscv32
2024-06-04 22:37:28 -07:00
Ryan Liptak
016e87e7ef fs tests: Fix leaking a directory handle in "makepath existing directories" test 2024-06-04 19:02:16 -07:00
Ryan Liptak
5490021ab7 Dir.makeOpenPathAccessMaskW: Fix leaking intermediate directory handles
Fixes a regression introduced in 67455c5e70. The `errdefer` cannot run since its not possible for an error to occur, and we don't want it to run on the last handle, so we move the closing back down to where it was before 67455c5e70.
2024-06-04 18:45:25 -07:00
Andrew Kelley
0098e650fb update musl source files to v1.2.5
adds loongarch64 and riscv32
2024-06-04 16:54:14 -07:00
Andrew Kelley
85a46ee520 update musl headers to v1.2.5
adds loongarch64 and riscv32
2024-06-04 16:54:11 -07:00
Frank Denis
332fbb4b02
crypto.edwards25519: add the ability to check for group membership (#20175)
Most of the functions related to points on the Edwards25519 curve
check that input points are not in a small-order subgroup.

They don't check that points are on the prime-order subgroup,
because this is expensive, and not always necessary.

However, applications may require such a check in order to
ensure that a public key is valid, and that a secret key counterpart
exists.

Many functions in the public API of libsodium related to arithmetic
over Edwards25519 also do that check unconditionally. This is
expensive, but a good way to catch bugs in protocols and
implementations.

So, add a `rejectUnexpectedSubgroup()` function to achieve this.

The documentation on the edwards25519->curve25519 conversion
function was also updated, in order to explain how to match
libsodium's behavior if necessary.

We use an addition chain to multiply the point by the order of
the prime group.

An alternative we may implement later is Pornin's point halving
technique: https://eprint.iacr.org/2022/1164.pdf
2024-06-04 10:11:05 +02:00