Jakub Konka
bae3dbffdf
elf: clear dynamic relocs before repopulating
2024-10-09 12:27:30 -07:00
Jakub Konka
bc7e0342b5
elf: do not re-populate synthetic sections when updating
2024-10-09 12:27:30 -07:00
Jakub Konka
7fead5d6dd
elf: track atoms within AtomList with array hash map
2024-10-09 12:27:30 -07:00
Andrew Kelley
31d70cb1e1
link.Elf: avoid needless file system reads in flush()
...
flush() must not do anything more than necessary. Determining the type
of input files must be done only once, before flush. Fortunately, we
don't even need any file system accesses to do this since that
information is statically known in most cases, and in the rest of the
cases can be determined by file extension alone.
This commit also updates the nearby code to conform to the convention
for error handling where there is exactly one error code to represent
the fact that error messages have already been emitted. This had the
side effect of improving the error message for a linker script parse
error.
"positionals" is not a linker concept; it is a command line interface
concept. Zig's linker implementation should not mention "positionals".
This commit deletes that array list in favor of directly making function
calls, eliminating that heap allocation during flush().
2024-10-08 18:02:59 -07:00
Andrew Kelley
2c41c453b6
link.Elf: avoid converting rpath data in flush()
...
The goal is to minimize as much as possible how much logic is inside
flush(). So let's start by moving out obvious stuff. This data can be
preformatted before flush().
2024-10-08 18:02:59 -07:00
Pavel Verigo
4b89a4c7cb
stage2-wasm: airRem + airMod for floats
2024-10-08 20:58:15 +02:00
mlugg
95857d6b21
Sema: add missing runtime value validation to global mutable variables
...
Resolves : #20365
2024-10-07 07:42:17 +01:00
mlugg
36243567e6
Sema: add missing runtime value validation to @memcpy and @memset
2024-10-07 07:27:50 +01:00
Alex Rønne Petersen
7a2fde973d
link.Elf: Fix page size calculation for more architectures.
...
Sourced from binutils/bfd.
2024-10-07 07:04:05 +02:00
Alex Rønne Petersen
790fc8cd98
Merge pull request #21499 from alexrp/loongarch-gnusf
...
Add `loongarch64-linux-gnusf` target support
2024-10-07 01:24:00 +02:00
Alex Rønne Petersen
ece265b1c2
Merge pull request #21605 from alexrp/ohos-stuff
...
`std.Target`: Introduce `Abi.ohoseabi` to distinguish the soft float case.
2024-10-06 16:26:24 +02:00
Alex Rønne Petersen
be5378b038
Merge pull request #21587 from alexrp/hexagon-porting
...
Some initial `hexagon-linux` port work
2024-10-06 13:35:56 +02:00
Alex Rønne Petersen
25ee7b0ea8
compiler: Don't require PIC for aarch64-linux-ohos.
...
While Clang defaults to PIC for this target, it's not actually required.
2024-10-05 15:19:14 +02:00
Alex Rønne Petersen
09efa95f48
compiler: Don't link to nonexistent libc libraries for ohos.
2024-10-05 15:14:16 +02:00
Alex Rønne Petersen
84e192c88b
std.Target: Introduce Abi.ohoseabi to distinguish the soft float case.
...
For the same reason as #21504 .
2024-10-05 15:13:37 +02:00
Alex Rønne Petersen
d23db9427b
Merge pull request #21574 from alexrp/llvm-sub-arch
...
`llvm`: Implement sub-architecture translation in `targetTriple()`.
2024-10-05 13:49:05 +02:00
David Rubin
043b1adb8d
remove @fence ( #21585 )
...
closes #11650
2024-10-04 22:21:27 +00:00
Felix Queißner
7c74edec8d
Adds new cpu architectures propeller1 and propeller2. ( #21563 )
...
* Adds new cpu architectures propeller1 and propeller2.
These cpu architectures allow targeting the Parallax Propeller 1 and Propeller 2, which are both very special microcontrollers with 512 registers and 8 cpu cores.
Resolves #21559
* Adds std.elf.EM.PROPELLER and std.elf.EM.PROPELLER2
* Fixes missing switch prongs in src/codegen/llvm.zig
* Fixes order in std.Target.Arch
---------
Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
2024-10-04 13:53:28 -07:00
Alex Rønne Petersen
eb363bf845
Merge pull request #21572 from alexrp/tests-llvm-targets
...
`test`: Rewrite the target triple list for `llvm_targets`.
2024-10-04 19:37:12 +02:00
Alex Rønne Petersen
b23a5b56c2
Merge pull request #21578 from alexrp/s390x-porting
...
Get module tests passing for `s390x-linux` and add it to CI
2024-10-04 14:40:32 +02:00
Alex Rønne Petersen
9b273f6b9a
Merge pull request #21570 from alexrp/windows-itanium
...
Initial port work for `*-windows-itanium` support.
2024-10-03 21:53:22 +02:00
Jakub Konka
69ce7f0e08
Merge pull request #21573 from alexrp/elf-header
...
Some additions to `std.elf` addressing #19830 , plus some zld improvements
2024-10-03 15:19:58 +02:00
Alex Rønne Petersen
45644b7e15
link.Elf: Fix default page size for hexagon.
2024-10-03 09:55:45 +02:00
Alex Rønne Petersen
f31173d379
llvm: Disable f16 lowering for hexagon.
...
In theory, this should work for v68+. In practice, it runs into an LLVM
assertion when using a `freeze` instruction on `f16` values, similar to the
issue we had for LoongArch.
2024-10-03 09:53:59 +02:00
Alex Rønne Petersen
b4ddff396d
llvm: Fix C ABI integer promotion for s390x.
2024-10-03 06:19:23 +02:00
Alex Rønne Petersen
3f322c49bc
std.Target: Remove Os.Tag.shadermodel.
...
This was a leftover from the Cpu.Arch.dxil removal.
2024-10-03 05:01:24 +02:00
Alex Rønne Petersen
0be22b1e41
glibc: Update abilists parsing to the new format version.
2024-10-03 04:39:39 +02:00
Alex Rønne Petersen
f99097e68f
Merge pull request #20805 from xdBronch/lang-flag
...
handle -x language flag without spaces
2024-10-03 03:58:16 +02:00
Alex Rønne Petersen
85bf1e2b1f
llvm: Implement sub-architecture translation in targetTriple().
2024-10-03 02:39:12 +02:00
Alex Rønne Petersen
710a3b37e2
link.MachO: Add exhaustive handling for all Apple target triples.
2024-10-03 00:57:36 +02:00
Alex Rønne Petersen
125c043abc
link.Elf: Set EI_OSABI value correctly depending on target arch/OS.
2024-10-03 00:57:34 +02:00
Alex Rønne Petersen
e0ac776749
Merge pull request #21504 from alexrp/android-softfp
...
`std.Target`: Introduce `Abi.androideabi` to distinguish the soft float case.
2024-10-03 00:15:35 +02:00
Alex Rønne Petersen
038e002b1c
Merge pull request #21527 from alexrp/elf-emulations
...
`link.Elf`: Make `getLDMOption()` exhaustive with regards to LLD's `parseEmulation()`.
2024-10-02 23:22:44 +02:00
xdBronch
6319805ad1
handle -x language flag without spaces
2024-10-02 23:19:26 +02:00
Alex Rønne Petersen
537a873b17
Initial port work for *-windows-itanium support.
...
https://llvm.org/docs/HowToBuildWindowsItaniumPrograms.html
This is a weird middle ground between `*-windows-gnu` and `*-windows-msvc`. It
uses the C++ ABI of the former while using the system libraries of the latter.
2024-09-28 21:43:52 +02:00
Jakub Konka
777e722b06
macho: increase pre-allocated vmsize for __TEXT_ZIG segment
2024-09-28 11:59:51 -07:00
Andrew Kelley
2e14cbe9cd
Sema: better utility function semantics
...
better names, return error instead of panicking, better diagnostics, use
the standard APIs for resolving values
2024-09-26 20:53:26 -07:00
Andrew Kelley
5b1a9fbb45
update crash report to the new panic interface
2024-09-26 20:25:09 -07:00
Andrew Kelley
37d1da5bed
I think it's better to put the imports at the top
2024-09-26 20:24:46 -07:00
Andrew Kelley
db8c074476
fix still calling std.builtin.panic sometimes
2024-09-26 16:46:02 -07:00
Andrew Kelley
1b491e640d
fixes and make sema report errors when std.builtin wrong
...
instead of panicking
2024-09-26 16:06:05 -07:00
Andrew Kelley
c9c080a187
embrace panic helpers
...
Introduces `std.builtin.Panic` which is a complete interface for
panicking. Provide `std.debug.FormattedPanic` and
`std.debug.SimplePanic` and let the user choose, or make their own.
2024-09-26 16:06:05 -07:00
Alex Rønne Petersen
67f5d4f78c
link.Elf: Make getLDMOption() exhaustive with regards to LLD's parseEmulation().
2024-09-26 21:49:58 +02:00
Andrew Kelley
e8887829ca
compile error instead of crash when root panic fn wrong
2024-09-26 12:35:14 -07:00
Andrew Kelley
61b20105e4
fix crash report not using mutexes correctly
2024-09-26 12:35:14 -07:00
Andrew Kelley
70746d580c
better codegen for @panic with comptime-known operand
2024-09-26 12:35:14 -07:00
Andrew Kelley
b66cc5af41
reimplement integer overflow safety panic function calls
...
in the llvm backend.
2024-09-26 12:35:14 -07:00
Andrew Kelley
f2c8940aa6
reintroduce the std.builtin safety panic helpers
...
motivated by performance
2024-09-26 12:35:14 -07:00
Andrew Kelley
9ccf8d3332
fixes for this branch
...
I had to bring back some of the old API so that I could compile the new
compiler with an old compiler.
2024-09-26 12:35:14 -07:00
Andrew Kelley
4f8d244e7e
remove formatted panics
...
implements #17969
2024-09-26 12:35:14 -07:00