30216 Commits

Author SHA1 Message Date
Alex Rønne Petersen
af8205e25e
std.Target: Remove nacl OS specifier and le32/le64 arch specifiers.
Native Client is dead.

https://developer.chrome.com/docs/native-client
2024-07-20 05:08:16 +02:00
Alex Rønne Petersen
5a2f6acb44
std.Target: Remove kfreebsd OS specifier.
kFreeBSD is dead.

https://lists.debian.org/debian-devel/2023/07/msg00176.html
2024-07-20 05:08:14 +02:00
Alex Rønne Petersen
9939b116bf
std.Target: Remove the gnuf64 ABI specifier.
This was used for LoongArch64, where:

* `gnuf64` -> `ilp32d` / `lp64d` (full hard float)
* `gnuf32` -> `ilp32f` / `lp64f` (hard float for `f32` only)
* `gnusf` -> `ilp32` / `lp64` (soft float)

But Loongson eventually settled on just `gnu` for the first case since that's
what most people will actually be targeting outside embedded scenarios. The
`gnuf32` and `gnusf` specifiers remain in use.
2024-07-20 04:56:56 +02:00
YANG Xudong
b7e48c6bcd
std: Add loongarch support for elf. (#20678) 2024-07-19 16:32:20 -07:00
Andrew Kelley
0d1db794d5
Merge pull request #20679 from ziglang/std.c-reorg
std.c reorganization
2024-07-19 16:30:21 -07:00
Andrew Kelley
89e4c38fe3 CI: update tarballs to one that has LLVM assertions enabled 2024-07-19 15:43:35 -07:00
kcbanner
647a0c9b82 mem: handle Float and Bool cases in byteSwapAllFields 2024-07-19 14:09:51 -07:00
Andrew Kelley
01337e2093 fix regression of flock being called on wasi targets
* common symbols are now public from std.c even if they live in
  std.posix
* LOCK is now one of the common symbols since it is the same on 100% of
  operating systems.
* flock is now void value on wasi and windows
* std.fs.Dir now uses flock being void as feature detection, avoiding
  trying to call it on wasi and windows
2024-07-19 11:35:22 -07:00
Tau
94cf4d2d81 llvm: add pass-by-reference info to debug types
Without this data, debugger expressions try to pass structs by-value,
which mostly just crashes.
Also: mark enums as enum classes to prevent the enumerators from
shadowing other identifiers.
2024-07-19 17:51:38 +02:00
Tau
177b3359a1 llvm: Do not generate static member definitions
They were not helping LLDB and actively throwing off GDB.
Also: clean up some llvm.Builder and llvm.ir definitions that are no
longer necessary.
2024-07-19 17:51:38 +02:00
Tau
52e4cdb45e Try linking static members' definitions to their declarations.
This does not help anything though: gdb would follow the
DW_AT_specification link only in the opposite direction, which LLVM
cannot emit.
2024-07-19 17:51:38 +02:00
Tau
3bfa63aa61 ModuleDebugInfo: Discard C++ namespaces appearing in PDBs 2024-07-19 17:51:38 +02:00
Tau
9c2d597e69 llvm: Fix debug gen for 0-bit types
Add a regression test for that, since these weirdly never occur in any
of the other tests on x86-64-linux.
2024-07-19 17:51:38 +02:00
Tau
b4eb812305 Don't attach a top-level function to its file, but to the file's struct 2024-07-19 17:51:38 +02:00
Tau
359bbdd574 llvm: encode variables as DW_TAG_imported_declaration
Now we get working global variable lookup in GDB! LLDB still re-mangles,
and it looks like we can't do much about that for now.

Also: translate non-owning type declarations into typedefs.
2024-07-19 17:51:37 +02:00
Tau
876258abe4 llvm: set precise scopes on namespace types and variables
This will allow accessing non-local declarations from debuggers, which,
AFAICT, was impossible before.
Getting scopes right already works for type declarations and functions,
but will need some fiddling for variables:

For those, I tried imitating what Clang does for static member
variables, but LLDB tries to re-mangle those and then fails at lookup,
while GDB outright crashes. Hopefully I can find some other dwarven
incantation to do the right thing.
2024-07-19 17:46:34 +02:00
Techatrix
ebd9efa850 fix fanotify_mark on 32-bit 2024-07-19 01:40:16 -07:00
Jacob Young
40bab4df69 behavior: disable test that triggers an llvm assertion
Tracked by #20680
2024-07-19 04:35:11 -04:00
Andrew Kelley
7157189143 macos doesn't have pipe2 2024-07-19 00:40:00 -07:00
Andrew Kelley
8c4a2dc1df move non-libc stuff out of std.c 2024-07-19 00:30:32 -07:00
Andrew Kelley
e8c4e79499 std.c reorganization
It is now composed of these main sections:
* Declarations that are shared among all operating systems.
* Declarations that have the same name, but different type signatures
  depending on the operating system. Often multiple operating systems
  share the same type signatures however.
* Declarations that are specific to a single operating system.
  - These are imported one per line so you can see where they come from,
    protected by a comptime block to prevent accessing the wrong one.

Closes #19352 by changing the convention to making types `void` and
functions `{}`, so that it becomes possible to update `@hasDecl` sites
to use `@TypeOf(f) != void` or `T != void`. Happily, this ended up
removing some duplicate logic and update some bitrotted feature
detection checks.

A handful of types have been modified to gain namespacing and type
safety. This is a breaking change.

Oh, and the last usage of `usingnamespace` site is eliminated.
2024-07-19 00:30:32 -07:00
Jakub Konka
16604a93b9
Merge pull request #20650 from ziglang/parallel-macho
The tale of parallel MachO: part 1
2024-07-18 22:23:30 +02:00
Andrew Kelley
e4f5dada61
Merge pull request #19641 from The-King-of-Toasters/windows-api-refactor
Windows: Rework kernel32 apis
2024-07-18 11:44:32 -07:00
mlugg
f5a941b3d6
Sema: return module-relative path for @src()
This is one possible approach to fixing an issue with reproducible
builds where the compiler's cwd changes the paths returned by `@src()`.
2024-07-18 18:45:07 +01:00
Pavel Verigo
56d535dd24 stage2-wasm: improve @shlWithOverflow for <= 128 bits
Additionally fixed a bug for shr on signed big ints
2024-07-18 18:01:06 +02:00
Pavel Verigo
dc3176d628 stage2-wasm: enhance add/subWithOverflow
Added behavior tests to verify implementation
2024-07-18 17:54:44 +02:00
Pavel Verigo
d1bd9518f9 stage2-wasm: fix big int comparison
Unexpected to be found only now
2024-07-18 17:18:17 +02:00
Jakub Konka
3bdbf81a3f macho: fix emitting data-in-code entries 2024-07-18 09:13:09 +02:00
Jakub Konka
34f34dbe32 macho: reinstate duplicate definition checking 2024-07-18 09:13:09 +02:00
Jakub Konka
d19aab2e87 macho: bump max rss by a slight margin 2024-07-18 09:13:09 +02:00
Jakub Konka
b339a30680 macho: fix off-by-one when populating strtab 2024-07-18 09:13:09 +02:00
Jakub Konka
e9328e7da8 macho: fix 32bit compilation issues 2024-07-18 09:13:09 +02:00
Jakub Konka
3338813077 macho: use isec for working out getAtomData in ZigObject 2024-07-18 09:13:09 +02:00
Jakub Konka
a9e3088d9c macho: extract testing logic for TLS into a helper 2024-07-18 09:13:08 +02:00
Jakub Konka
103c16c879 macho: clean up atom+symbol creation logic in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
e117e05768 macho: ensure we always name decls like LLVM to avoid confusion 2024-07-18 09:13:08 +02:00
Jakub Konka
91de8dc8ab macho: fix unresolved symbols error reporting 2024-07-18 09:13:08 +02:00
Jakub Konka
521933e1c0 macho: do not randomly append non-incr atoms in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
f9fbd6302f macho: test TLS in Zig with x86_64 backend 2024-07-18 09:13:08 +02:00
Jakub Konka
234aa86802 macho: update non-incremental section sizes for ZigObject sections 2024-07-18 09:13:08 +02:00
Jakub Konka
387a71fa5b macho: re-enable writing out static archive with ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
84189f9d56 macho: skip resizing incremental Zig sections in r mode 2024-07-18 09:13:08 +02:00
Jakub Konka
129fe8668c macho: write non-incremental atoms in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
e5a66184ed macho: pretty print relocation types in logs and errors 2024-07-18 09:13:08 +02:00
Jakub Konka
01fc33c949 macho: emit relocs for non-zig-sections in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
853ca403c4 macho: bring back relocatable mode for ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
cba04ff244 macho: re-enable calculating num of relocs for ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
2579c55d49 macho: adjust global creation in ZigObject to new model 2024-07-18 09:13:08 +02:00
Jakub Konka
4aff0ec394 macho: move relocs re-resolution logic to ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka
b62281a9c8 macho: re-enable relocatable mode 2024-07-18 09:13:08 +02:00