Commit Graph

358 Commits

Author SHA1 Message Date
Jakub Konka 6ec8b15918 elf: fix emitting static lib when ZigObject is present 2024-09-04 13:34:26 +02:00
Jakub Konka 8c76a61ef5 test/link/elf: test --gc-sections on Zig input with LLVM too 2024-09-04 13:34:26 +02:00
mlugg 0fe3fd01dd std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.

This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
2024-08-28 08:39:59 +01:00
mlugg a3a737e9a6 lib,test,tools,doc: update usages of @export 2024-08-27 00:44:35 +01:00
Alex Rønne Petersen a69f55a7cc std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.
These are fundamentally incapable of producing accurate information for reasons
I've laid out in #20771. Since our only use of these functions is to check that
object files have the correct machine type, and since #21020 made
`std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over
to that and compare the machine type tags instead.

Closes #20771.
2024-08-23 19:56:24 +02:00
Jakub Konka fa79f53f92 test/macho: simplify testing range extension thunks 2024-08-22 00:36:47 +02:00
Jakub Konka ca417e1e32 link/elf: simplify how we test thunks 2024-08-21 23:05:28 +02:00
Jakub Konka 9473d76449 test/elf: enhance testImportingDataDynamic 2024-08-15 21:47:34 +02:00
Jakub Konka 24126f5382 elf: simplify output section tracking for symbols 2024-07-30 10:00:50 +02:00
Jakub Konka c575e3daa4 elf: resolve COMDATs in more parallel-friendly way 2024-07-30 10:00:50 +02:00
Jakub Konka fa09276510 test/link/elf: test COMDAT elimination 2024-07-30 10:00:50 +02:00
Jakub Konka 58defeeaa6 macho: test section$end$ boundary symbol handling 2024-07-28 06:59:21 +02:00
Jakub Konka 34f34dbe32 macho: reinstate duplicate definition checking 2024-07-18 09:13:09 +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 f9fbd6302f macho: test TLS in Zig with x86_64 backend 2024-07-18 09:13:08 +02:00
Krzysztof Wolicki 45c77931c2 Change deprecated b.host to b.graph.host in tests and Zig's build.zig 2024-06-13 10:49:06 -04:00
Pat Tullmann ed795a907d target.zig: Constrain aarch64 to glibc version 2.17 or later
Had constrained the `aarch64_be` target, but not `aarch64`.  This
constraint is necessary because earlier versions of glibc do not support
the aarch64 architecture.

Also, skip unsupported test cases.
2024-06-06 09:36:16 -07:00
Pat Tullmann 8bee879fc2 test/link/glibc_compat: Add C test case for glibc versions
glibc_runtime_check.c is a simple test case that exercises glibc functions
that might smoke out linking problems with Zig's C compiler.  The
build.zig compiles it against a variety of glibc versions.

Also document and test glibc v2.2.5 (from 2002) as the oldest working
glibc target for C binaries.
2024-06-06 09:36:16 -07:00
Jakub Konka 19f41d390f test/link/macho: add symbol stabs smoke test 2024-05-24 22:43:23 +02:00
Jakub Konka d31eb744ce link/macho: fix 32bit build 2024-05-23 12:04:17 +02:00
Jakub Konka 78b441e8de test/link/macho: test merge literals on x86_64 2024-05-23 12:04:17 +02:00
Jakub Konka 03d0a68356 test/link/macho: clean up merge literals tests on aarch64 2024-05-23 12:04:17 +02:00
Jakub Konka 28d08dd8a6 link/macho: test merging literals targeting ObjC 2024-05-23 12:04:17 +02:00
Jakub Konka 8fc0c7dce1 link/macho: apply fixes to deduping logic
* test non-ObjC literal deduping logic
2024-05-23 12:04:17 +02:00
Jakub Konka d78968c1b5 test/link: actually run tests requiring symlinks on non-Win
Fixes regression introduced by https://github.com/ziglang/zig/commit/5d5e89aa8d5a454bce2c93555d3bc7c7ae1aa162

Turns out since landing that PR we haven't run any tests requiring
symlinks or any Apple SDK on a macOS host. Not great.
2024-05-22 14:59:32 +02:00
daurnimator 497f37ce92 test/link/glibc_compat: fix incorrect strlcpy result 2024-04-28 22:03:08 -07:00
Jakub Konka 66253e5b51 link/elf: populate current Zig version in .comment; test 2024-04-20 23:36:42 +02:00
Jakub Konka bc0d84be0b test/link/elf: add merge strings test for -r mode 2024-04-20 23:36:42 +02:00
Jakub Konka 342235e5eb test/link/elf: enhance merge strings tests 2024-04-20 23:36:42 +02:00
Jakub Konka 457d84f45a link/elf: remove link.link.build as unused; add some merge strings tests 2024-04-20 23:36:42 +02:00
Andrew Kelley b30ad74908 remove deprecated LazyPath.path union tag 2024-04-11 14:02:47 -07:00
Carl Åstholm 5d5e89aa8d Promote linker test cases to packages 2024-04-07 16:05:54 -07:00
Andrew Kelley 8c94950c24 fix compilation failures found by CI 2024-03-19 16:18:18 -07:00
Jakub Konka d565c5dfcd macho: fix a sad typo in calculating the address of a TLV pointer 2024-03-15 08:17:10 +01:00
Jakub Konka 7ba2453b8e test/link/elf: do not check for $thunk in thunks tests for now
Andrew and I have discovered that on Linux max peak rss value
is taken to be `max(build_runner, test_suite)` and since the thunks
test emit a huge binary, we will easily exceed the declared maximum
for any of the test suites. This can be worked around for now by not
checking for $thunk symbols in this test since it doesn't really
yield any additional information; however ideally we would implement
per-thread local temp arena that can be freed.
2024-03-13 08:25:38 +01:00
Jakub Konka faa4bdb017 elf+aarch64: fix off-by-one in converging on groups interleaved with thunks 2024-03-12 13:16:11 +01:00
Jakub Konka b1bd3825f8 test/link/macho: remove redundant 'macho-' prefix from case names 2024-03-12 13:16:11 +01:00
Jakub Konka b1eba5a996 elf+aarch64: actually write out thunks, and add a proper link test 2024-03-12 13:16:11 +01:00
Tristan Ross c260b4c753 std.builtin: make global linkage fields lowercase 2024-03-11 07:09:10 -07:00
Jakub Konka 1a6b2e84ac test/link/elf: remove pie hack due to QEMU bug that is now fixed 2024-03-10 10:39:31 +01:00
Jakub Konka b7b63855d0 test/link/elf: enable tests for aarch64 cpu arch 2024-03-09 19:26:26 +01:00
Luuk de Gram 196ba706a0 wasm: gc fixes and re-enable linker tests
Certain symbols were left unmarked, meaning they would not be emit into
the final binary incorrectly. We now mark the synthetic symbols to ensure
they are emit as they are already created under the circumstance they're
needed for. This also re-enables disabled tests that were left disabled
in a previous merge conflict.
Lastly, this adds the shared-memory test to the test harnass as it was
previously forgotten and therefore regressed.
2024-02-29 15:24:08 +01:00
Jakub Konka ddb33baa11 test/link/elf: test static linking C riscv64-musl 2024-02-21 23:08:29 +01:00
Jakub Konka 55dadc3d85 test/link/elf: test static linking C aarch64-musl 2024-02-21 22:40:03 +01:00
Jakub Konka d12c8db642 Merge pull request #18875 from ziglang/macho-zo-dwarf
macho: emit DWARF for ZigObject relocatable
2024-02-09 23:12:04 +01:00
Tristan Ross 2a3e601f77 test.link.macho: fix for non-x86 and arm architectures
This fix is requires to make the build runner even compile when building
Zig on architectures like RISC-V.
2024-02-09 17:49:53 +02:00
Jakub Konka 925273bcc8 macho: align memory size with file size when emitting relocatable 2024-02-09 00:20:11 +01:00
Jakub Konka 7388534590 test/link/macho: more self-hosted tests 2024-02-08 23:51:30 +01:00
Jakub Konka 7fb9df3fab test/link/macho: -fstrip is no longer needed for self-hosted 2024-02-08 22:15:00 +01:00