Jakub Konka
2d017f379f
link-tests: do not hardcode UUID when testing the build with/out DI
2023-02-08 17:26:25 +01:00
Andrew Kelley
16cdd1297e
rename std.Build.LibExeObjStep to std.Build.CompileStep
...
This matches the nomenclature internally: a Compilation is the main type
that represents a single invokation of the compiler.
2023-01-31 15:09:35 -07:00
Andrew Kelley
36e2d992dd
combine std.build and std.build.Builder into std.Build
...
I've been wanting to do this for along time.
2023-01-31 15:09:35 -07:00
Andrew Kelley
73cf7b6429
update build.zig API usage
2023-01-31 15:09:35 -07:00
Jakub Konka
241cabdf3d
link-tests: do not expect __eh_frame section on x86_64-macos
2023-01-21 19:14:44 +01:00
Jakub Konka
983e373409
macho: fix sorting symbols by seniority
2023-01-21 16:53:46 +01:00
Jakub Konka
02db9933a4
macho: properly relocate target symbol address in __eh_frame
2023-01-21 14:11:56 +01:00
Jakub Konka
eb0c959b43
link-tests: update uuid test with new uuid values
...
Changes only pertain arm64 as for x86_64 turns out we are
missing one additional feature which is synthesising unwind info
from only eh frame records, or at least this is what it looks like
when I analysed the output of Apple's ld.
2023-01-20 21:27:57 +01:00
Jakub Konka
e0ccbff87d
link-tests: test unwind info emitter via c++ exceptions
2023-01-20 20:57:40 +01:00
Jakub Konka
9d4a4e9ed1
link-tests: update uuid test with new uuid given dyld ops changes
2023-01-19 00:05:54 +01:00
Jakub Konka
8d29c84d00
link-tests: test uuid on x86_64-macos too
2022-12-27 16:43:35 +01:00
Jakub Konka
6925ef0f1a
zld: exclude strtab padding from uuid calculation
2022-12-27 16:43:35 +01:00
Jakub Konka
8adcc2258f
link-tests: redo macho strict validation test to match libstuff
2022-12-27 16:43:35 +01:00
Jakub Konka
2cb6db2219
link-tests: add macho strict validation test
...
Support more operators when running simple arithmetic tests, and
allow for int literals in the program spec.
2022-12-23 14:02:52 +01:00
Jakub Konka
b20a610f03
link-tests: force cross-comp to exclude host differences
2022-12-17 00:53:47 +01:00
Jakub Konka
9ad24a4aee
macho: add uuid link test
2022-12-16 18:31:48 +01:00
Jakub Konka
72769f6cec
link-tests: add test case for parsing weak imports
2022-11-06 15:21:28 +01:00
Jakub Konka
aaaa7df152
macho: add linker test case for issue 13457
2022-11-06 00:10:12 +01:00
Luuk de Gram
c0fe135ff3
test/link: remove redundant dependOn statements
...
`runAndCompare` will already depend on the `CheckObject` step itself
so it's not needed to also have the test step depend on the
check object step.
2022-10-18 17:20:08 +02:00
jacobly0
bd0dd225e8
Sema: implement linksection on functions
...
* Sema: implement linksection on functions
* Implement function linksection in Sema.
* Don't clobber function linksection/align/addrspace in Sema.
* Fix copy-paste typo in tests.
* Add a bunch of missing test_step.dependOn.
* Fix checkInSymtab match.
Closes #12546
2022-10-18 14:02:10 +03:00
Jakub Konka
54854e2ab8
add removed expected stdout comparison in link test
2022-09-18 09:28:46 +02:00
Jakub Konka
0030e72d53
use EmulatableRunStep for newly added macho link test
...
Reverts 75e9a8c7fabb1f32753960b9114dcee875256351
2022-09-18 09:22:49 +02:00
Andrew Kelley
75e9a8c7fa
skip macho link test execution on non-macOS
...
2c3d87b168bf522f538e78325fdae71c320e6e20 introduced a new test that
passes on macOS but fails on other operating systems. This commit makes
it only run on macOS.
2022-09-17 21:33:19 -07:00
Jakub Konka
2c3d87b168
macho: test empty translation units
2022-09-17 18:43:24 +02:00
Jakub Konka
9b595dd55f
link-test: refactor and reorg
...
Move common tests by target file format (Wasm, MachO) into helper
functions in `link.zig`, and sort alphabetically within for easier
tracking versus file organization on disk.
2022-08-17 23:13:49 +02:00
Jakub Konka
d84282174c
link-test: move tls test to macho/tls
...
This test was always really testing correct behavior of our in-house
MachO linker to begin with.
2022-08-17 09:00:26 +02:00
Luuk de Gram
72c0cebe5c
test/link/macho: use EmulationStep for dead_strip
2022-07-23 17:27:47 +02:00
Luuk de Gram
4776065036
Use EmulatableRunStep for MachO linker tests
2022-07-23 10:03:51 +02:00
Jakub Konka
2c184f9a5f
link-tests: add checkNotPresent and add -dead_strip smoke test
...
`checkNotPresent` is the inverse of `checkNext` - if the phrase is
found in the output, then it fails the test.
2022-07-22 16:58:21 +02:00
Jakub Konka
d80fcc8a0b
macho: rework symbol handling for incremental stage2 builds
2022-07-22 16:58:20 +02:00
Jakub Konka
03feea0fb2
macho: split section into subsections if requested and/or possible
2022-07-22 16:58:20 +02:00
Jakub Konka
5834a608fc
link-tests: do not save global extracted var unless a match
...
Improve testing MachO binaries by verbose printing of the symtab
which includes segment,section names for defined symbols, and
import (dylib) name for imports.
2022-06-28 10:23:25 +02:00
Jakub Konka
075f5bc5ff
link-tests: test -weak-lx and -weak_framework x
2022-06-28 09:22:04 +02:00
Jakub Konka
0dd28920da
macho: implement and handle -needed-* and -needed_* family of flags
...
MachO linker now handles `-needed-l<name>`, `-needed_library=<name>`
and `-needed_framework=<name>`. While on macOS `-l` is equivalent
to `-needed-l`, and `-framework` to `-needed_framework`, it can be
used to the same effect as on Linux if combined with `-dead_strip_dylibs`.
This commit also adds handling for `-needed_library` which is macOS
specific flag only (in addition to `-needed-l`).
Finally, in order to leverage new linker testing harness, this commit
added ability to specify lowering to those flags via `build.zig`:
`linkSystemLibraryNeeded` (and related), and `linkFrameworkNeeded`.
2022-06-27 19:53:38 +02:00
Jakub Konka
efc5c97bff
macho: implement -dead_strip_dylibs linker flag
2022-06-27 19:53:38 +02:00
Jakub Konka
589bf67635
macho: implement -headerpad_max_install_names
2022-06-25 18:04:40 +02:00
Jakub Konka
a6fbdfabb9
link-tests: add -headerpad_size test scenario
2022-06-25 17:59:09 +02:00
Jakub Konka
f91503e577
link-tests: defer parsing of the RPN program until running the action
2022-06-25 17:56:03 +02:00
Jakub Konka
8f00bc9d23
link-tests: put macho search strategy tests into one test case
2022-06-25 10:57:56 +02:00
Jakub Konka
24821dd17f
link-tests: test -search_paths_first and -search_dylibs_first macho flags
2022-06-24 22:07:51 +02:00
Jakub Konka
03ddb42b8b
link-tests: rename check() to checkStart()
...
Do not hardcode the symtab label; instead allow each parser to define
its own.
Check for missing extractor value in the matcher when matching `{}`.
2022-06-23 13:16:03 +02:00
Jakub Konka
ba768614ac
link-tests: frameworks example can test for libobjc autolink in safety modes
2022-06-22 18:51:35 +02:00
Jakub Konka
b35e434cae
link-tests: clean up linker testing harness
2022-06-22 18:34:39 +02:00
Jakub Konka
211de9b63b
link-tests: fix dumping of LOAD_DYLIB: name instead of path field
2022-06-22 10:40:10 +02:00
Jakub Konka
23a63f4ce4
link-tests: rename CheckMachOStep to CheckObjectStep and accept obj format
2022-06-22 10:27:51 +02:00
Jakub Konka
b5601a2da6
link-tests: extract values into variables
...
We can then collect multiple variables (currently assumed always
in global scope) and run a comparison with some very basic
arithmetic on the values.
2022-06-22 00:49:22 +02:00
Jakub Konka
3bb4d65b2f
link-tests: move macho tests to subfolder
...
Handle `-e` option in MachO linker allowing the user to set a custom
entrypoint address.
2022-06-21 23:01:09 +02:00