Commit Graph

31108 Commits

Author SHA1 Message Date
Alex Rønne Petersen
a9d1c6acb2
libunwind: Use -Wno-dll-attribute-on-redeclaration for Windows like upstream.
This silences a bunch of noisy warnings when building libunwind.
2024-09-21 01:20:36 +02:00
Alex Rønne Petersen
9bc2185997
libunwind: Update gcc_personality_v0.c to LLVM 19.1.0.
Notably, this fixes libunwind compilation for thumb-windows-gnu.
2024-09-21 01:16:47 +02:00
mochalins
d83a3f1746 doc: Bump LLVM version in README 2024-09-19 23:06:09 -07:00
Andrew Kelley
c6ad4521c7 Merge branch 'llvm19'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 19.x

Related to #16270

Big thanks to Alex Rønne Petersen for doing the bulk of the upgrade work
in this branch.
2024-09-19 22:47:56 -07:00
Andrew Kelley
075ec55552 disable failing test
tracked by #21457
2024-09-19 18:20:22 -07:00
Andrew Kelley
6294e65eeb compiler_rt does not need a build_options module 2024-09-19 18:20:22 -07:00
Andrew Kelley
cefcf39faa compiler_rt: strong linkage when compiling to .c
This works around a problem that started happening with LLD around
version 18.1.8:

```
lld-link: error: duplicate symbol: .weak.__nexf2.default
>>> defined at CMakeFiles/zig2.dir/compiler_rt.c.obj
>>> defined at compiler_rt.lib(compiler_rt.lib.obj)
```
2024-09-19 18:20:22 -07:00
Andrew Kelley
38af1b7ed1 CI: update tarballs to 0.14.0-dev.1622+2ac543388 2024-09-19 18:20:22 -07:00
Andrew Kelley
6c15d69660 Revert "ci: Build with ZIG2_NO_RTLIB on Windows machines."
This reverts commit 7e66b6d0684fb1b3aa76381486e655e4d13bc0a5.

I don't think this is needed, I don't get any errors locally when I
bootstrap windows without this change.
2024-09-19 18:20:22 -07:00
Alex Rønne Petersen
916eaad1ef std.Target: Update CPU models/features for LLVM 19.1.0. 2024-09-19 18:20:22 -07:00
Alex Rønne Petersen
a463c369cd libcxx: Update to LLVM 19.1.0. 2024-09-19 18:20:22 -07:00
Alex Rønne Petersen
6b96c70ba3 clang: Update compiler-provided C headers to Clang 19.1.0. 2024-09-19 18:20:21 -07:00
Andrew Kelley
0d7a9c4806 CI: update tarballs
This time the LLVM builds have assertions enabled.

Also the zig builds support `-rtlib=none` for disabling compiler-rt.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
bc278719d9 test: Disable shared_lib_unwind on x86_64-macos.
https://github.com/ziglang/zig/issues/21337
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
335ed630a0 ci: Build with ZIG2_NO_RTLIB on Windows machines.
Windows does not really have weak symbols. So when we bootstrap with `zig cc`
and link both Zig's compiler-rt and the CBE's `compiler_rt.c` we end up with
duplicate symbol errors at link time.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
3dd6456c0f cmake: Add a ZIG2_NO_RTLIB option for building zig2 without compiler-rt. 2024-09-19 18:20:21 -07:00
Andrew Kelley
c234655e35 CI: update tarballs to LLVM 19.1.0rc4
oops, I forgot to enable LLVM assertions though
2024-09-19 18:20:21 -07:00
Andrew Kelley
a3a8a266ef add missing clang and llvm library listings 2024-09-19 18:20:21 -07:00
Andrew Kelley
619e8a8957 CI: run tests in llvm19 branch 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
894b732630 Partially revert "LLVM: work around @floatFromInt bug"
This partially reverts commit ab4d6bf468.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
8c0902b7ae Revert "tests: skip native CPU std tests on Windows"
This reverts commit 234693bcbb.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
f8719c4197 test: Re-enable store vector with memset for LLVM.
Closes #16177.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
2a24c17be2 test: Re-enable LLVM riscv64 module tests.
Closes #18872.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
9b60aa0adc std.zig.system.darwin.macos: Enable Apple M4 CPU detection. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
a99c883cf0 test: Update wasm/infer-features based on what LLVM produces. 2024-09-19 18:20:21 -07:00
Luuk de Gram
3acf997692 link.Wasm.Feature: Update to mirror std.Target.wasm. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
0082475ddb Compilation: Synchronize some libcxx CXXFLAGS with upstream. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
a4d0a01243 std.Target: Add bridgeos tag to Os. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
bdae7d97b9 test: Disable @bitCast of packed struct containing pointer temporarily.
TODO: Figure out what to do about this.

Context: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179

After changing our emit strategy for packed structs to just write to memory:

test-behavior
└─ run test behavior-x86_64-linux.6.5...6.5-gnu.2.38-x86_64-ReleaseSmall-libc
   └─ zig test ReleaseSmall native failure
error: thread 44346 panic: attempt to unwrap error: ReinterpretDeclRef
/home/alexrp/Source/zig/src/Value.zig:571:42: 0x1f33514 in writeToPackedMemory (zig)
            if (!val.ptrHasIntAddr(mod)) return error.ReinterpretDeclRef;
                                         ^
/home/alexrp/Source/zig/src/Value.zig:548:17: 0x1f32f45 in writeToPackedMemory (zig)
                try field_val.writeToPackedMemory(field_ty, pt, buffer, bit_offset + bits);
                ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:3706:89: 0x1ca2366 in lowerValueToInt (zig)
        val.writeToPackedMemory(ty, pt, std.mem.sliceAsBytes(limbs)[0..bytes], 0) catch unreachable;
                                                                                        ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4083:49: 0x1a33800 in lowerValue (zig)
                        return o.lowerValueToInt(llvm_int_ty, arg_val);
                                                ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4798:42: 0x2ec4e6a in resolveValue (zig)
        const llvm_val = try o.lowerValue(val.toIntern());
                                         ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4789:47: 0x2ec4bd3 in resolveInst (zig)
        const llvm_val = try self.resolveValue((try self.air.value(inst, self.ng.object.pt)).?);
                                              ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:8996:49: 0x2f022e9 in airStore (zig)
        const src_operand = try self.resolveInst(bin_op.rhs);
                                                ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4967:53: 0x29f7260 in genBody (zig)
                .store          => try self.airStore(inst, false),
                                                    ^
/home/alexrp/Source/zig/src/codegen/llvm.zig:1682:19: 0x29f147c in updateFunc (zig)
        fg.genBody(air.getMainBody()) catch |err| switch (err) {
                  ^
/home/alexrp/Source/zig/src/link/Elf.zig:2916:70: 0x2eb0f15 in updateFunc (zig)
    if (self.llvm_object) |llvm_object| return llvm_object.updateFunc(pt, func_index, air, liveness);
                                                                     ^
/home/alexrp/Source/zig/src/link.zig:426:82: 0x29fbef5 in updateFunc (zig)
                return @as(*tag.Type(), @fieldParentPtr("base", base)).updateFunc(pt, func_index, air, liveness);
                                                                                 ^
/home/alexrp/Source/zig/src/Zcu/PerThread.zig:876:22: 0x25f3d9e in linkerUpdateFunc (zig)
        lf.updateFunc(pt, func_index, air, liveness) catch |err| switch (err) {
                     ^
/home/alexrp/Source/zig/src/Compilation.zig:3975:36: 0x21768fe in processOneCodegenJob (zig)
            try pt.linkerUpdateFunc(func.func, func.air);
                                   ^
/home/alexrp/Source/zig/src/Compilation.zig:3928:36: 0x2176541 in queueCodegenJob (zig)
        return processOneCodegenJob(tid, comp, codegen_job);
                                   ^
/home/alexrp/Source/zig/src/Compilation.zig:3682:37: 0x1e9d37f in processOneJob (zig)
            try comp.queueCodegenJob(tid, .{ .func = .{
                                    ^
/home/alexrp/Source/zig/src/Compilation.zig:3638:30: 0x1c1f6c1 in performAllTheWorkInner (zig)
            try processOneJob(@intFromEnum(Zcu.PerThread.Id.main), comp, job, main_progress_node);
                             ^
/home/alexrp/Source/zig/src/Compilation.zig:3508:36: 0x1ab6e10 in performAllTheWork (zig)
    try comp.performAllTheWorkInner(main_progress_node);
                                   ^
/home/alexrp/Source/zig/src/Compilation.zig:2269:31: 0x1ab25b9 in update (zig)
    try comp.performAllTheWork(main_progress_node);
                              ^
/home/alexrp/Source/zig/src/main.zig:4156:32: 0x1b01351 in serve (zig)
                try comp.update(main_progress_node);
                               ^
/home/alexrp/Source/zig/src/main.zig:3453:22: 0x1b20d7c in buildOutputType (zig)
            try serve(
                     ^
/home/alexrp/Source/zig/src/main.zig:267:31: 0x1969c54 in mainArgs (zig)
        return buildOutputType(gpa, arena, args, .zig_test);
                              ^
/home/alexrp/Source/zig/src/main.zig:199:20: 0x19669c5 in main (zig)
    return mainArgs(gpa, arena, args);
                   ^
/home/alexrp/Source/zig/lib/std/start.zig:614:37: 0x19664ee in main (zig)
            const result = root.main() catch |err| {
                                    ^
../sysdeps/nptl/libc_start_call_main.h:58:16: 0x7a453da2814f in __libc_start_call_main (../sysdeps/x86/libc-start.c)
../csu/libc-start.c:360:3: 0x7a453da28208 in __libc_start_main_impl (../sysdeps/x86/libc-start.c)
???:?:?: 0x1966134 in ??? (???)
???:?:?: 0x0 in ??? (???)
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
a27f4072ec llvm: Stop emitting shl/xor ops for constant packed structs.
This is no longer supported in LLVM 19; fall back to the generic code path.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
da8b7fb0c0 std.Target: Update CPU models/features for LLVM 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
662683cafd update_cpu_features: Fix feature_overrides logic and replace an omit_cpus misuse. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
a4af54b4e5 update_cpu_features: Update for LLVM 19.
* Add `ProcessorAlias` support.
* Bump output buffer size.
* Include `i` extension in RISC-V baselines.
* Update evaluation branch quota for RISC-V.
* Retain some CPU features that LLVM removed.
* Flatten more 'meta-features' used for CPU models.
* Remove some superfluous dependencies.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
9f669df1b3 libcxx: Synchronize some CXXFLAGS with upstream. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
1c8f0b8909 libcxx: Update to LLVM 19.
* Moved the tz.cpp patch to experimental/tzdb.cpp.
* Extended the __config_site patch to a few more files.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
d13bc04cb4 libcxxabi: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
70a1805e46 libunwind: Synchronize some CFLAGS/CXXFLAGS with upstream. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
26ddfabba4 libunwind: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
dc14434c0a clang: Update compiler-provided C headers to Clang 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
f69ff5e9b5 clang: Update options data to Clang 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
41e5acd89d zig_clang: Update to Clang 19.
Co-authored-by: David Rubin <daviru007@icloud.com>
2024-09-19 18:20:20 -07:00
Alex Rønne Petersen
973ebeb610 zig_llvm: Update to LLVM 19. 2024-09-19 18:20:20 -07:00
Alex Rønne Petersen
da8f81c78b compiler: Update LLVM/Clang driver files to LLVM/Clang 19. 2024-09-19 18:20:20 -07:00
Alex Rønne Petersen
dd095e506a cmake: Update to LLVM 19.
Co-authored-by: David Rubin <daviru007@icloud.com>
2024-09-19 18:20:20 -07:00
Juan Julián Merelo Guervós
8b82a0e0fc
std.DynamicBitSet: remove wrong and useless comments (#21418) 2024-09-19 17:06:23 -07:00
Linus Groh
72fc164178 std.os.linux: Fix tc_oflag_t for PowerPC
std/os/linux.zig:6504:20: error: expected type 'os.linux.NLDLY__enum_11313', found 'comptime_int'
2024-09-19 16:55:00 -07:00
mlugg
2111f4c38b Sema: mark export on owner nav when exporting function alias
Resolves: #20847
2024-09-18 21:42:47 +01:00
Maciej 'vesim' Kuliński
feaee2ba17 cc: Add support for -Wp, 2024-09-17 23:54:04 -07:00
Matthew Lugg
41330c96ae
Merge pull request #21428 from mlugg/compare-to-undef
Sema: return undefined on comparison of runtime value against undefined
2024-09-17 14:34:10 +01:00
mlugg
4650e5b9fc
Sema: clean up cmpNumeric
There is one minor language change here, which is that comparisons of
the form `comptime_inf < runtime_f32` have their results comptime-known.
This is consistent with comparisons against comptime NaN for instance,
which are always comptime known. A corresponding behavior test is added.

This fixes a bug with int comparison elision which my previous commit
somehow triggered. `Sema.compareIntsOnlyPossibleResult` is much cleaner
now!
2024-09-17 11:00:38 +01:00