aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-11-08spirv: assembler hacky constant placeholdersRobin Voetter
2024-11-08spirv: make default generic address space for vulkan FunctionRobin Voetter
We are not using Private variables. This needs to be cleaned up a bit more, this will happen with the general address space improvements.
2024-11-08spirv: track global OpVariables properly in assemblerRobin Voetter
Also cleans up the assembler a bit in general.
2024-11-08spirv: properly resolve type inputs in assemblyRobin Voetter
For now the frontend still allows type inputs in assembly. We might as well resolve them properly in the SPIR-V backend.
2024-11-08spirv: forbid pointer arithmeticRobin Voetter
2024-11-08llvm: Disable lowering to f16 on sparc.Alex Rønne Petersen
2024-11-05musl: Don't explicitly pass -fno-unwind-tables -fno-asynchronous-unwind-tables.Alex Rønne Petersen
These are already handled by build_crt_file().
2024-11-05libunwind: Pass -fPIC -funwind-tables via module options instead of CFLAGS.Alex Rønne Petersen
2024-11-05libcxx: Pass -fPIC via module options instead of CFLAGS.Alex Rønne Petersen
2024-11-05musl: Pass -fomit-frame-pointer via CrtFileOptions.Alex Rønne Petersen
2024-11-05musl: Pass -f(function,data)-sections via CrtFileOptions instead of CFLAGS.Alex Rønne Petersen
2024-11-05glibc, musl, wasi-libc: Don't explicitly pass -fno-stack-protector.Alex Rønne Petersen
This is already handled by build_crt_file().
2024-11-05tsan: Handle more Apple targets when picking library name.Alex Rønne Petersen
2024-11-05tsan: Synchronize CFLAGS with upstream.Alex Rønne Petersen
In particular: * -fms-extensions for MinGW * -fno-builtin * -fno-emulated-tls for Android 29+ * -fno-exceptions * -fomit-frame-pointer * -fvisibility=hidden
2024-11-05llvm: Also apply the nobuiltin attribute for the no_builtin module option.Alex Rønne Petersen
From `zig build-exe --help`: -fno-builtin Disable implicit builtin knowledge of functions It seems entirely reasonable and even expected that this option should imply both no-builtins on functions (which disables transformation of recognized code patterns to libcalls) and nobuiltin on call sites (which disables transformation of libcalls to intrinsics). We now match Clang's behavior for -fno-builtin. In both cases, we're painting with a fairly broad brush by applying this to an entire module, but it's better than nothing. #21833 proposes a more fine-grained way to apply nobuiltin.
2024-11-05Compilation: Fix unwind table logic for compiler-rt.Alex Rønne Petersen
This looks to be a refactoring leftover.
2024-11-05Compilation: Also set essential module options when including compiler-rt.o.Alex Rønne Petersen
Closes #21831.
2024-11-05Compilation: Move no_builtin to Package.Module.Alex Rønne Petersen
This option, by its very nature, needs to be attached to a module. If it isn't, the code in a module could break at random when compiled into an application that doesn't have this option set. After this change, skip_linker_dependencies no longer implies no_builtin in the LLVM backend.
2024-11-05compiler: Update clangMightShellOutForAssembly() for Clang 19.Alex Rønne Petersen
Clang only uses the system assembler for nvptx and xcore nowadays.
2024-11-05Merge pull request #21907 from alexrp/valgrind-stuffAlex Rønne Petersen
Add client request support for all architectures supported by Valgrind
2024-11-04llvm: Use no-builtins attribute instead of nobuiltin.Alex Rønne Petersen
The former prevents recognizing code patterns and turning them into libcalls, which is what we want for compiler-rt. The latter is meant to be used on call sites to prevent them from being turned into intrinsics. Context: https://github.com/ziglang/zig/issues/21833
2024-11-04llvm: Add client request support for all archs supported by Valgrind.Alex Rønne Petersen
2024-11-04link.Coff: Pass -lldmingw to LLD earlier and regardless of -lc.Alex Rønne Petersen
The -lldmingw option affects a lot of logic throughout LLD. We need to pass it for *-windows-gnu even when we're not actually linking MinGW since we're still using the MinGW ABI with all that that entails. (One particular problem we would run into is missing handling of stdcall-decorated symbols for 32-bit x86.) Also, various other LLD options are sensitive to this option, so it's best to pass it as early as possible. Closes #11817.
2024-11-03Merge pull request #21843 from alexrp/callconv-followupAlex Rønne Petersen
Some follow-up work for #21697
2024-11-03Merge pull request #21599 from alexrp/thumb-portingAlex Rønne Petersen
2024-11-03llvm: Update the list of address spaces for LLVM 19.Alex Rønne Petersen
Mainly affects amdgcn.
2024-11-03glibc: Don't build CRT objects that won't be used.Alex Rønne Petersen
2024-11-03Compilation: Use the regular module mechanism for setting PIC on CRT objects.Alex Rønne Petersen
addCCArgs() will then pass the appropriate flag to Clang.
2024-11-03Compilation: Pass -fno-PIC to clang if PIC is disabled.Alex Rønne Petersen
Let's not implicitly rely on whatever Clang's default is.
2024-11-03std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().Alex Rønne Petersen
The old isARM() function was a portability trap. With the name it had, it seemed like the obviously correct function to use, but it didn't include Thumb. In the vast majority of cases where someone wants to ask "is the target Arm?", Thumb *should* be included. There are exactly 3 cases in the codebase where we do actually need to exclude Thumb, although one of those is in Aro and mirrors a check in Clang that is itself likely a bug. These rare cases can just add an extra isThumb() check.
2024-11-02llvm: Remove extraneous commas for branch hint metadata in textual IR output.Alex Rønne Petersen
2024-11-02Sema: Disallow calling functions with certain special calling conventions.Alex Rønne Petersen
2024-11-02link.Dwarf: Some minor corrections to calling conventions to ~match Clang.Alex Rønne Petersen
This can't be completely 1:1 due to the fact that we model CCs more precisely, but this is about as close as we can get.
2024-11-02cbe: Support some more calling conventions.Alex Rønne Petersen
2024-11-02compiler: Handle arm_aapcs16_vfp alongside arm_aapcs_vfp in some places.Alex Rønne Petersen
2024-11-02std.os.windows: Deprecate WINAPI in favor of CallingConvention.winapi.Alex Rønne Petersen
2024-11-02llvm: Fix lowering of gnuilp32 ABI to be gnu_ilp32.Alex Rønne Petersen
LLVM doesn't even recognize the gnuilp32 spelling as an alternative.
2024-11-02glibc: Emit _IO_stdin_used reference in .rodata.Alex Rønne Petersen
This fixes an X86_64_32 relocation linker error when targeting gnux32.
2024-11-02musl: Update sources from musl 1.2.5.Alex Rønne Petersen
Adds mipsn32 and x32 sources. Also remove some useless .in files.
2024-11-02std.Target: Add muslabin32 and muslabi64 tags to Abi.Alex Rønne Petersen
Once we upgrade to LLVM 20, these should be lowered verbatim rather than to simply musl. Similarly, the special case in llvmMachineAbi() should go away.
2024-11-02std.zig.target: Update musl path helpers to support alternative ABIs.Alex Rønne Petersen
This is needed for muslx32 and muslabin32 support.
2024-11-02musl: Fix needsCrtiCrtn() for m68k.Alex Rønne Petersen
2024-11-02musl: Update the list of architectures with time32 compat helpers.Alex Rønne Petersen
2024-11-02Merge pull request #21729 from alexrp/target-cpu-baselineAlex Rønne Petersen
`std.Target.Cpu.Model`: Further refinements to `generic()` and `baseline()`
2024-11-02std.Target: Remove armv7k/armv7s.Alex Rønne Petersen
Like d1d95294fd657f771657ea671a6984b860347fb0, this is more Apple nonsense where they abused the arch component of the triple to encode what's really an ABI. Handling this correctly in Zig's target triple model would take quite a bit of work. Fortunately, the last Armv7-based Apple Watch was released in 2017 and these targets are now considered legacy. By the time Zig hits 1.0, they will be a distant memory. So just remove them.
2024-11-02Merge pull request #21860 from alexrp/llvm-triple-stuffAlex Rønne Petersen
More support for OS/libc version ranges in `std.Target` and improvements to LLVM target triple construction
2024-11-01link.File.Wasm.Archive: simplifyAndrew Kelley
Don't use the reader interface Avoid unnecessary heap allocations At first I started working on incorporating the Archive fields into the Wasm data model, however, I realized a better strategy: simply omit Archive data from the serialized linker state. Those files can be trivially reparsed on next compiler process start. If they haven't changed, great. Otherwise if they have, the prelink phase needs to be restarted anyway.
2024-11-01std.Target: Add support for specifying Android API level.Alex Rønne Petersen
2024-11-01llvm: Set OS min version and libc version in ~all cases.Alex Rønne Petersen
Except Windows, because that just doesn't really fit into LLVM's target triple format currently.
2024-11-01llvm: Set vendor type in LLVM target triple for more OSs.Alex Rønne Petersen
Annoyingly, LLVM and Clang have various checks throughout that depend on these vendor types being set.