Compare commits
72 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afd8c2db98 |
||
|
|
57f3a79ce3 |
||
|
|
99107eeb74 |
||
|
|
dc01a78c50 |
||
|
|
373fd58fba | ||
|
|
1ffefc4662 |
||
|
|
b5b6b37ec0 | ||
|
|
38f18f6459 |
||
|
|
b9abbed4a8 |
||
|
|
393d1df948 |
||
|
|
61f511df21 |
||
|
|
0c4d9963b5 |
||
|
|
28b9e0c24c |
||
|
|
55a3e42937 |
||
|
|
638b1b872e | ||
|
|
a298b2a8fb |
||
|
|
5466b3ff26 |
||
|
|
3f9c4abd5e |
||
|
|
098a032507 |
||
|
|
9dbb6c1d28 |
||
|
|
e2e82e488a |
||
|
|
0ec1977ad7 |
||
|
|
f60ca2269e |
||
|
|
21b8f7dff6 |
||
|
|
0c6022a563 |
||
|
|
c7d17d37d7 |
||
|
|
0a50d1817b |
||
|
|
284dc4f1a3 |
||
|
|
d0f0b383da |
||
|
|
901fbb9f17 |
||
|
|
fecba593ad |
||
|
|
3220db0cdf |
||
|
|
3f349af1df |
||
|
|
8cc224672e |
||
|
|
a70f739094 |
||
|
|
e48280957a |
||
|
|
2bbfea5a46 |
||
|
|
6150a6d460 |
||
|
|
72e170e8d6 | ||
|
|
ceb0aad27a |
||
|
|
f0f8c54d66 |
||
|
|
5087b7f0b0 |
||
|
|
c61f4bb7e8 |
||
|
|
c8cfc2b53d |
||
|
|
b72f379bfd |
||
|
|
cf62d59e74 | ||
|
|
8a08922842 | ||
|
|
8736cbd905 |
||
|
|
7a78a337a5 |
||
|
|
932de196c3 |
||
|
|
7048d61867 |
||
|
|
d8a8ae5c93 |
||
|
8c4bf36257 |
|||
|
39e7a7ca51 |
|||
|
13becf1d7b |
|||
|
|
36f7a7c316 |
||
|
|
92cf9baa1f | ||
|
|
cb82d9f39e | ||
|
|
e8322f0e45 | ||
|
|
de9733eb6e | ||
|
|
d67f2fe59a | ||
|
|
2c550d93b0 |
||
|
|
3138357a37 |
||
|
|
6ef693cad9 |
||
|
|
473aee6a77 |
||
|
|
8215cfe5c5 | ||
|
|
66f987acf6 |
||
|
|
5fe3677a9b |
||
|
|
cc12bd6575 | ||
|
|
cdca87f270 |
||
|
|
76a3195070 |
||
|
|
c7ab229781 |
10 changed files with 685 additions and 1012045 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
/zig-0.8.0.tar.gz
|
/*-build
|
||||||
/zig-0.8.1.tar.gz
|
/zig-*.tar.xz
|
||||||
|
/zig-*.tar.xz.minisig
|
||||||
|
|
|
||||||
33
0001-remove-native-lib-directories-from-rpath.patch
Normal file
33
0001-remove-native-lib-directories-from-rpath.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
From a865b3569ace118cc1c1cd8d5d130ec316b0307d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jan200101 <sentrycraft123@gmail.com>
|
||||||
|
Date: Tue, 14 Apr 2026 19:04:40 +0200
|
||||||
|
Subject: [PATCH 1/2] remove native lib directories from rpath
|
||||||
|
|
||||||
|
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||||
|
---
|
||||||
|
src/main.zig | 9 +++++++++
|
||||||
|
1 file changed, 9 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main.zig b/src/main.zig
|
||||||
|
index 0395a21a5f..86b6d9f86b 100644
|
||||||
|
--- a/src/main.zig
|
||||||
|
+++ b/src/main.zig
|
||||||
|
@@ -4102,6 +4102,15 @@ fn createModule(
|
||||||
|
|
||||||
|
try create_module.lib_directories.ensureUnusedCapacity(arena, paths.lib_dirs.items.len);
|
||||||
|
for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(io, &create_module.lib_directories, path, true);
|
||||||
|
+
|
||||||
|
+ for (paths.lib_dirs.items) |native_lib_dir| {
|
||||||
|
+ for (0.., create_module.rpath_list.items) |i, rpath_dir| {
|
||||||
|
+ if (std.mem.eql(u8, native_lib_dir, rpath_dir)) {
|
||||||
|
+ _ = create_module.rpath_list.orderedRemove(i);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (create_module.libc_paths_file) |paths_file| {
|
||||||
|
--
|
||||||
|
2.53.0
|
||||||
|
|
||||||
|
|
@ -1,137 +0,0 @@
|
||||||
From 9fda724c7fc3ad84b6efb2027e03b4407016230d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan200101 <sentrycraft123@gmail.com>
|
|
||||||
Date: Sat, 12 Jun 2021 11:23:04 +0200
|
|
||||||
Subject: [PATCH 1/3] specify the output lib, exe and include paths with flags
|
|
||||||
|
|
||||||
(cherry picked from commit 5a4249fa25ab789a8c060e5ba71ca8b0358e9c8d)
|
|
||||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
|
||||||
---
|
|
||||||
lib/std/build.zig | 34 ++++++++++++++++++++++++++++----
|
|
||||||
lib/std/special/build_runner.zig | 24 ++++++++++++++++++++--
|
|
||||||
2 files changed, 52 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/std/build.zig b/lib/std/build.zig
|
|
||||||
index 9b7ebb1f4..208e83e71 100644
|
|
||||||
--- a/lib/std/build.zig
|
|
||||||
+++ b/lib/std/build.zig
|
|
||||||
@@ -124,6 +124,12 @@ pub const Builder = struct {
|
|
||||||
description: []const u8,
|
|
||||||
};
|
|
||||||
|
|
||||||
+ pub const DirList = struct {
|
|
||||||
+ lib_dir: ?[]const u8 = null,
|
|
||||||
+ exe_dir: ?[]const u8 = null,
|
|
||||||
+ include_dir: ?[]const u8 = null,
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
pub fn create(
|
|
||||||
allocator: *Allocator,
|
|
||||||
zig_exe: []const u8,
|
|
||||||
@@ -192,7 +198,7 @@ pub const Builder = struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This function is intended to be called by std/special/build_runner.zig, not a build.zig file.
|
|
||||||
- pub fn resolveInstallPrefix(self: *Builder, install_prefix: ?[]const u8) void {
|
|
||||||
+ pub fn resolveInstallPrefix(self: *Builder, install_prefix: ?[]const u8, dir_list: DirList) void {
|
|
||||||
if (self.dest_dir) |dest_dir| {
|
|
||||||
self.install_prefix = install_prefix orelse "/usr";
|
|
||||||
self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, self.install_prefix }) catch unreachable;
|
|
||||||
@@ -201,9 +207,29 @@ pub const Builder = struct {
|
|
||||||
(fs.path.join(self.allocator, &[_][]const u8{ self.build_root, "zig-out" }) catch unreachable);
|
|
||||||
self.install_path = self.install_prefix;
|
|
||||||
}
|
|
||||||
- self.lib_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "lib" }) catch unreachable;
|
|
||||||
- self.exe_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "bin" }) catch unreachable;
|
|
||||||
- self.h_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "include" }) catch unreachable;
|
|
||||||
+
|
|
||||||
+ var lib_list = [_][]const u8{ self.install_path, "lib" };
|
|
||||||
+ var exe_list = [_][]const u8{ self.install_path, "bin" };
|
|
||||||
+ var h_list = [_][]const u8{ self.install_path, "include" };
|
|
||||||
+
|
|
||||||
+ if (dir_list.lib_dir) |dir| {
|
|
||||||
+ if (std.fs.path.isAbsolute(dir)) lib_list[0] = self.dest_dir orelse "";
|
|
||||||
+ lib_list[1] = dir;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (dir_list.exe_dir) |dir| {
|
|
||||||
+ if (std.fs.path.isAbsolute(dir)) exe_list[0] = self.dest_dir orelse "";
|
|
||||||
+ exe_list[1] = dir;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (dir_list.include_dir) |dir| {
|
|
||||||
+ if (std.fs.path.isAbsolute(dir)) h_list[0] = self.dest_dir orelse "";
|
|
||||||
+ h_list[1] = dir;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ self.lib_dir = fs.path.join(self.allocator, &lib_list) catch unreachable;
|
|
||||||
+ self.exe_dir = fs.path.join(self.allocator, &exe_list) catch unreachable;
|
|
||||||
+ self.h_dir = fs.path.join(self.allocator, &h_list) catch unreachable;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn addExecutable(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep {
|
|
||||||
diff --git a/lib/std/special/build_runner.zig b/lib/std/special/build_runner.zig
|
|
||||||
index d1154add0..d3f066a19 100644
|
|
||||||
--- a/lib/std/special/build_runner.zig
|
|
||||||
+++ b/lib/std/special/build_runner.zig
|
|
||||||
@@ -61,6 +61,8 @@ pub fn main() !void {
|
|
||||||
const stdout_stream = io.getStdOut().writer();
|
|
||||||
|
|
||||||
var install_prefix: ?[]const u8 = null;
|
|
||||||
+ var dir_list = Builder.DirList{};
|
|
||||||
+
|
|
||||||
while (nextArg(args, &arg_idx)) |arg| {
|
|
||||||
if (mem.startsWith(u8, arg, "-D")) {
|
|
||||||
const option_contents = arg[2..];
|
|
||||||
@@ -87,6 +89,21 @@ pub fn main() !void {
|
|
||||||
warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
return usageAndErr(builder, false, stderr_stream);
|
|
||||||
};
|
|
||||||
+ } else if (mem.eql(u8, arg, "--lib-dir")) {
|
|
||||||
+ dir_list.lib_dir = nextArg(args, &arg_idx) orelse {
|
|
||||||
+ warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
+ return usageAndErr(builder, false, stderr_stream);
|
|
||||||
+ };
|
|
||||||
+ } else if (mem.eql(u8, arg, "--exe-dir")) {
|
|
||||||
+ dir_list.exe_dir = nextArg(args, &arg_idx) orelse {
|
|
||||||
+ warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
+ return usageAndErr(builder, false, stderr_stream);
|
|
||||||
+ };
|
|
||||||
+ } else if (mem.eql(u8, arg, "--include-dir")) {
|
|
||||||
+ dir_list.include_dir = nextArg(args, &arg_idx) orelse {
|
|
||||||
+ warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
+ return usageAndErr(builder, false, stderr_stream);
|
|
||||||
+ };
|
|
||||||
} else if (mem.eql(u8, arg, "--sysroot")) {
|
|
||||||
const sysroot = nextArg(args, &arg_idx) orelse {
|
|
||||||
warn("Expected argument after --sysroot\n\n", .{});
|
|
||||||
@@ -147,7 +164,7 @@ pub fn main() !void {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- builder.resolveInstallPrefix(install_prefix);
|
|
||||||
+ builder.resolveInstallPrefix(install_prefix, dir_list);
|
|
||||||
try runBuild(builder);
|
|
||||||
|
|
||||||
if (builder.validateUserInputDidItFail())
|
|
||||||
@@ -175,7 +192,7 @@ fn runBuild(builder: *Builder) anyerror!void {
|
|
||||||
fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void {
|
|
||||||
// run the build script to collect the options
|
|
||||||
if (!already_ran_build) {
|
|
||||||
- builder.resolveInstallPrefix(null);
|
|
||||||
+ builder.resolveInstallPrefix(null, .{});
|
|
||||||
try runBuild(builder);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -201,6 +218,9 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void
|
|
||||||
\\ -h, --help Print this help and exit
|
|
||||||
\\ --verbose Print commands before executing them
|
|
||||||
\\ -p, --prefix [path] Override default install prefix
|
|
||||||
+ \\ --lib-dir [path] Override default library directory path
|
|
||||||
+ \\ --exe-dir [path] Override default executable directory path
|
|
||||||
+ \\ --include-dir [path] Override default include directory path
|
|
||||||
\\ --sysroot [path] Set the system root directory (usually /)
|
|
||||||
\\ --search-prefix [path] Add a path to look for binaries, libraries, headers
|
|
||||||
\\ --libc [file] Provide a file which specifies libc paths
|
|
||||||
--
|
|
||||||
2.31.1
|
|
||||||
|
|
||||||
254
0002-Remove-unsupported-LLVM-targets-for-EPEL.patch
Normal file
254
0002-Remove-unsupported-LLVM-targets-for-EPEL.patch
Normal file
|
|
@ -0,0 +1,254 @@
|
||||||
|
From 803935baf6a4730426afbb746adfd00c0ffc0f39 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jan200101 <sentrycraft123@gmail.com>
|
||||||
|
Date: Tue, 14 Apr 2026 19:20:26 +0200
|
||||||
|
Subject: [PATCH 2/2] Remove unsupported LLVM targets for RHEL
|
||||||
|
|
||||||
|
LLVM for RHEL is only build with a subset of targets
|
||||||
|
this blocks zig at the configuration stage.
|
||||||
|
This commit simply swaps them out with the one from
|
||||||
|
https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec
|
||||||
|
|
||||||
|
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||||
|
---
|
||||||
|
cmake/Findllvm.cmake | 2 +-
|
||||||
|
src/codegen/llvm.zig | 97 ++++++++++----------------------------------
|
||||||
|
src/target.zig | 43 +++++++++++---------
|
||||||
|
3 files changed, 45 insertions(+), 97 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
|
||||||
|
index 0c08d4f0ac..ed4da12044 100644
|
||||||
|
--- a/cmake/Findllvm.cmake
|
||||||
|
+++ b/cmake/Findllvm.cmake
|
||||||
|
@@ -83,7 +83,7 @@ if(ZIG_USE_LLVM_CONFIG)
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
|
||||||
|
|
||||||
|
- set(ZIG_LLVM_REQUIRED_TARGETS "AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;LoongArch;Mips;MSP430;NVPTX;PowerPC;RISCV;SPIRV;Sparc;SystemZ;VE;WebAssembly;X86;XCore")
|
||||||
|
+ set(ZIG_LLVM_REQUIRED_TARGETS "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly;RISCV")
|
||||||
|
|
||||||
|
set(ZIG_LLVM_REQUIRED_TARGETS_ENABLED TRUE)
|
||||||
|
foreach(TARGET_NAME IN LISTS ZIG_LLVM_REQUIRED_TARGETS)
|
||||||
|
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
|
||||||
|
index 1ba3b272da..1ac1f6adc8 100644
|
||||||
|
--- a/src/codegen/llvm.zig
|
||||||
|
+++ b/src/codegen/llvm.zig
|
||||||
|
@@ -4736,20 +4736,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||||
|
bindings.LLVMInitializeAMDGPUAsmPrinter();
|
||||||
|
bindings.LLVMInitializeAMDGPUAsmParser();
|
||||||
|
},
|
||||||
|
- .thumb, .thumbeb, .arm, .armeb => {
|
||||||
|
- bindings.LLVMInitializeARMTarget();
|
||||||
|
- bindings.LLVMInitializeARMTargetInfo();
|
||||||
|
- bindings.LLVMInitializeARMTargetMC();
|
||||||
|
- bindings.LLVMInitializeARMAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeARMAsmParser();
|
||||||
|
- },
|
||||||
|
- .avr => {
|
||||||
|
- bindings.LLVMInitializeAVRTarget();
|
||||||
|
- bindings.LLVMInitializeAVRTargetInfo();
|
||||||
|
- bindings.LLVMInitializeAVRTargetMC();
|
||||||
|
- bindings.LLVMInitializeAVRAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeAVRAsmParser();
|
||||||
|
- },
|
||||||
|
.bpfel, .bpfeb => {
|
||||||
|
bindings.LLVMInitializeBPFTarget();
|
||||||
|
bindings.LLVMInitializeBPFTargetInfo();
|
||||||
|
@@ -4757,34 +4743,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||||
|
bindings.LLVMInitializeBPFAsmPrinter();
|
||||||
|
bindings.LLVMInitializeBPFAsmParser();
|
||||||
|
},
|
||||||
|
- .hexagon => {
|
||||||
|
- bindings.LLVMInitializeHexagonTarget();
|
||||||
|
- bindings.LLVMInitializeHexagonTargetInfo();
|
||||||
|
- bindings.LLVMInitializeHexagonTargetMC();
|
||||||
|
- bindings.LLVMInitializeHexagonAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeHexagonAsmParser();
|
||||||
|
- },
|
||||||
|
- .lanai => {
|
||||||
|
- bindings.LLVMInitializeLanaiTarget();
|
||||||
|
- bindings.LLVMInitializeLanaiTargetInfo();
|
||||||
|
- bindings.LLVMInitializeLanaiTargetMC();
|
||||||
|
- bindings.LLVMInitializeLanaiAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeLanaiAsmParser();
|
||||||
|
- },
|
||||||
|
- .mips, .mipsel, .mips64, .mips64el => {
|
||||||
|
- bindings.LLVMInitializeMipsTarget();
|
||||||
|
- bindings.LLVMInitializeMipsTargetInfo();
|
||||||
|
- bindings.LLVMInitializeMipsTargetMC();
|
||||||
|
- bindings.LLVMInitializeMipsAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeMipsAsmParser();
|
||||||
|
- },
|
||||||
|
- .msp430 => {
|
||||||
|
- bindings.LLVMInitializeMSP430Target();
|
||||||
|
- bindings.LLVMInitializeMSP430TargetInfo();
|
||||||
|
- bindings.LLVMInitializeMSP430TargetMC();
|
||||||
|
- bindings.LLVMInitializeMSP430AsmPrinter();
|
||||||
|
- bindings.LLVMInitializeMSP430AsmParser();
|
||||||
|
- },
|
||||||
|
.nvptx, .nvptx64 => {
|
||||||
|
bindings.LLVMInitializeNVPTXTarget();
|
||||||
|
bindings.LLVMInitializeNVPTXTargetInfo();
|
||||||
|
@@ -4806,13 +4764,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||||
|
bindings.LLVMInitializeRISCVAsmPrinter();
|
||||||
|
bindings.LLVMInitializeRISCVAsmParser();
|
||||||
|
},
|
||||||
|
- .sparc, .sparc64 => {
|
||||||
|
- bindings.LLVMInitializeSparcTarget();
|
||||||
|
- bindings.LLVMInitializeSparcTargetInfo();
|
||||||
|
- bindings.LLVMInitializeSparcTargetMC();
|
||||||
|
- bindings.LLVMInitializeSparcAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeSparcAsmParser();
|
||||||
|
- },
|
||||||
|
.s390x => {
|
||||||
|
bindings.LLVMInitializeSystemZTarget();
|
||||||
|
bindings.LLVMInitializeSystemZTargetInfo();
|
||||||
|
@@ -4843,13 +4794,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||||
|
bindings.LLVMInitializeXtensaAsmParser();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
- .xcore => {
|
||||||
|
- bindings.LLVMInitializeXCoreTarget();
|
||||||
|
- bindings.LLVMInitializeXCoreTargetInfo();
|
||||||
|
- bindings.LLVMInitializeXCoreTargetMC();
|
||||||
|
- bindings.LLVMInitializeXCoreAsmPrinter();
|
||||||
|
- // There is no LLVMInitializeXCoreAsmParser function.
|
||||||
|
- },
|
||||||
|
.m68k => {
|
||||||
|
if (build_options.llvm_has_m68k) {
|
||||||
|
bindings.LLVMInitializeM68kTarget();
|
||||||
|
@@ -4868,13 +4812,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||||
|
bindings.LLVMInitializeCSKYAsmParser();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
- .ve => {
|
||||||
|
- bindings.LLVMInitializeVETarget();
|
||||||
|
- bindings.LLVMInitializeVETargetInfo();
|
||||||
|
- bindings.LLVMInitializeVETargetMC();
|
||||||
|
- bindings.LLVMInitializeVEAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeVEAsmParser();
|
||||||
|
- },
|
||||||
|
.arc => {
|
||||||
|
if (build_options.llvm_has_arc) {
|
||||||
|
bindings.LLVMInitializeARCTarget();
|
||||||
|
@@ -4884,21 +4821,29 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||||
|
// There is no LLVMInitializeARCAsmParser function.
|
||||||
|
}
|
||||||
|
},
|
||||||
|
- .loongarch32, .loongarch64 => {
|
||||||
|
- bindings.LLVMInitializeLoongArchTarget();
|
||||||
|
- bindings.LLVMInitializeLoongArchTargetInfo();
|
||||||
|
- bindings.LLVMInitializeLoongArchTargetMC();
|
||||||
|
- bindings.LLVMInitializeLoongArchAsmPrinter();
|
||||||
|
- bindings.LLVMInitializeLoongArchAsmParser();
|
||||||
|
- },
|
||||||
|
+
|
||||||
|
+ // Disabled LLVM targets
|
||||||
|
+ .thumb,
|
||||||
|
+ .thumbeb,
|
||||||
|
+ .arm,
|
||||||
|
+ .armeb,
|
||||||
|
+ .avr,
|
||||||
|
+ .hexagon,
|
||||||
|
+ .lanai,
|
||||||
|
+ .mips,
|
||||||
|
+ .mipsel,
|
||||||
|
+ .mips64,
|
||||||
|
+ .mips64el,
|
||||||
|
+ .msp430,
|
||||||
|
+ .sparc,
|
||||||
|
+ .sparc64,
|
||||||
|
+ .xcore,
|
||||||
|
+ .ve,
|
||||||
|
+ .loongarch32,
|
||||||
|
+ .loongarch64,
|
||||||
|
.spirv32,
|
||||||
|
.spirv64,
|
||||||
|
- => {
|
||||||
|
- bindings.LLVMInitializeSPIRVTarget();
|
||||||
|
- bindings.LLVMInitializeSPIRVTargetInfo();
|
||||||
|
- bindings.LLVMInitializeSPIRVTargetMC();
|
||||||
|
- bindings.LLVMInitializeSPIRVAsmPrinter();
|
||||||
|
- },
|
||||||
|
+ => unreachable,
|
||||||
|
|
||||||
|
// LLVM does does not have a backend for these.
|
||||||
|
.alpha,
|
||||||
|
diff --git a/src/target.zig b/src/target.zig
|
||||||
|
index 3d04c06f5e..9e19836815 100644
|
||||||
|
--- a/src/target.zig
|
||||||
|
+++ b/src/target.zig
|
||||||
|
@@ -185,23 +185,12 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat)
|
||||||
|
}
|
||||||
|
|
||||||
|
return switch (target.cpu.arch) {
|
||||||
|
- .arm,
|
||||||
|
- .armeb,
|
||||||
|
.aarch64,
|
||||||
|
.aarch64_be,
|
||||||
|
.arc,
|
||||||
|
- .avr,
|
||||||
|
.bpfel,
|
||||||
|
.bpfeb,
|
||||||
|
- .hexagon,
|
||||||
|
- .loongarch32,
|
||||||
|
- .loongarch64,
|
||||||
|
.m68k,
|
||||||
|
- .mips,
|
||||||
|
- .mipsel,
|
||||||
|
- .mips64,
|
||||||
|
- .mips64el,
|
||||||
|
- .msp430,
|
||||||
|
.powerpc,
|
||||||
|
.powerpcle,
|
||||||
|
.powerpc64,
|
||||||
|
@@ -211,24 +200,38 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat)
|
||||||
|
.riscv32be,
|
||||||
|
.riscv64,
|
||||||
|
.riscv64be,
|
||||||
|
- .sparc,
|
||||||
|
- .sparc64,
|
||||||
|
- .spirv32,
|
||||||
|
- .spirv64,
|
||||||
|
.s390x,
|
||||||
|
- .thumb,
|
||||||
|
- .thumbeb,
|
||||||
|
.x86,
|
||||||
|
.x86_64,
|
||||||
|
- .xcore,
|
||||||
|
.nvptx,
|
||||||
|
.nvptx64,
|
||||||
|
- .lanai,
|
||||||
|
.wasm32,
|
||||||
|
.wasm64,
|
||||||
|
- .ve,
|
||||||
|
=> true,
|
||||||
|
|
||||||
|
+ // Disabled LLVM targets
|
||||||
|
+ .thumb,
|
||||||
|
+ .thumbeb,
|
||||||
|
+ .arm,
|
||||||
|
+ .armeb,
|
||||||
|
+ .avr,
|
||||||
|
+ .hexagon,
|
||||||
|
+ .lanai,
|
||||||
|
+ .mips,
|
||||||
|
+ .mipsel,
|
||||||
|
+ .mips64,
|
||||||
|
+ .mips64el,
|
||||||
|
+ .msp430,
|
||||||
|
+ .sparc,
|
||||||
|
+ .sparc64,
|
||||||
|
+ .xcore,
|
||||||
|
+ .ve,
|
||||||
|
+ .loongarch32,
|
||||||
|
+ .loongarch64,
|
||||||
|
+ .spirv32,
|
||||||
|
+ .spirv64,
|
||||||
|
+ => false,
|
||||||
|
+
|
||||||
|
// LLVM backend exists but can produce neither assembly nor object files.
|
||||||
|
.csky,
|
||||||
|
.xtensa,
|
||||||
|
--
|
||||||
|
2.53.0
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
From 2128aaf02ac91cf07c449062c0cbffb3ab1fbe42 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Kelley <andrew@ziglang.org>
|
|
||||||
Date: Mon, 14 Jun 2021 11:56:58 -0700
|
|
||||||
Subject: [PATCH 2/3] zig build: rename --lib-dir, --include-dir, --exe-dir
|
|
||||||
|
|
||||||
To --prefix-lib-dir, --prefix-include-dir, --prefix-exe-dir,
|
|
||||||
respectively.
|
|
||||||
|
|
||||||
(cherry picked from commit 7d5538c32b7acfb6878be4178af2f71977d0cf9d)
|
|
||||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
|
||||||
---
|
|
||||||
lib/std/special/build_runner.zig | 20 +++++++++++---------
|
|
||||||
1 file changed, 11 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/std/special/build_runner.zig b/lib/std/special/build_runner.zig
|
|
||||||
index d3f066a19..366a0a2dc 100644
|
|
||||||
--- a/lib/std/special/build_runner.zig
|
|
||||||
+++ b/lib/std/special/build_runner.zig
|
|
||||||
@@ -89,17 +89,17 @@ pub fn main() !void {
|
|
||||||
warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
return usageAndErr(builder, false, stderr_stream);
|
|
||||||
};
|
|
||||||
- } else if (mem.eql(u8, arg, "--lib-dir")) {
|
|
||||||
+ } else if (mem.eql(u8, arg, "--prefix-lib-dir")) {
|
|
||||||
dir_list.lib_dir = nextArg(args, &arg_idx) orelse {
|
|
||||||
warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
return usageAndErr(builder, false, stderr_stream);
|
|
||||||
};
|
|
||||||
- } else if (mem.eql(u8, arg, "--exe-dir")) {
|
|
||||||
+ } else if (mem.eql(u8, arg, "--prefix-exe-dir")) {
|
|
||||||
dir_list.exe_dir = nextArg(args, &arg_idx) orelse {
|
|
||||||
warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
return usageAndErr(builder, false, stderr_stream);
|
|
||||||
};
|
|
||||||
- } else if (mem.eql(u8, arg, "--include-dir")) {
|
|
||||||
+ } else if (mem.eql(u8, arg, "--prefix-include-dir")) {
|
|
||||||
dir_list.include_dir = nextArg(args, &arg_idx) orelse {
|
|
||||||
warn("Expected argument after {s}\n\n", .{arg});
|
|
||||||
return usageAndErr(builder, false, stderr_stream);
|
|
||||||
@@ -215,15 +215,17 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void
|
|
||||||
try out_stream.writeAll(
|
|
||||||
\\
|
|
||||||
\\General Options:
|
|
||||||
- \\ -h, --help Print this help and exit
|
|
||||||
- \\ --verbose Print commands before executing them
|
|
||||||
- \\ -p, --prefix [path] Override default install prefix
|
|
||||||
- \\ --lib-dir [path] Override default library directory path
|
|
||||||
- \\ --exe-dir [path] Override default executable directory path
|
|
||||||
- \\ --include-dir [path] Override default include directory path
|
|
||||||
+ \\ -p, --prefix [path] Override default install prefix
|
|
||||||
+ \\ --prefix-lib-dir [path] Override default library directory path
|
|
||||||
+ \\ --prefix-exe-dir [path] Override default executable directory path
|
|
||||||
+ \\ --prefix-include-dir [path] Override default include directory path
|
|
||||||
+ \\
|
|
||||||
\\ --sysroot [path] Set the system root directory (usually /)
|
|
||||||
\\ --search-prefix [path] Add a path to look for binaries, libraries, headers
|
|
||||||
\\ --libc [file] Provide a file which specifies libc paths
|
|
||||||
+ \\
|
|
||||||
+ \\ -h, --help Print this help and exit
|
|
||||||
+ \\ --verbose Print commands before executing them
|
|
||||||
\\ --color [auto|off|on] Enable or disable colored error messages
|
|
||||||
\\
|
|
||||||
\\Project-Specific Options:
|
|
||||||
--
|
|
||||||
2.31.1
|
|
||||||
|
|
||||||
1011717
0003-LLVM-13-rebase.patch
1011717
0003-LLVM-13-rebase.patch
File diff suppressed because it is too large
Load diff
154
changelog
Normal file
154
changelog
Normal file
|
|
@ -0,0 +1,154 @@
|
||||||
|
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Apr 15 2026 Jan200101 <sentrycraft123@gmail.com> - 0.16.0-1
|
||||||
|
- Update to 0.16.0
|
||||||
|
|
||||||
|
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.2-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Jan 04 2026 Jan200101 <sentrycraft123@gmail.com> - 0.15.2-2
|
||||||
|
- Rebuilt for EPEL
|
||||||
|
|
||||||
|
* Sun Oct 12 2025 Jan200101 <sentrycraft123@gmail.com> - 0.15.2-1
|
||||||
|
- Update to 0.15.2
|
||||||
|
|
||||||
|
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jun 09 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.1-1
|
||||||
|
- Update to 0.14.1
|
||||||
|
|
||||||
|
* Tue May 27 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-4
|
||||||
|
- add patch to add library directories
|
||||||
|
|
||||||
|
* Fri May 09 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-3
|
||||||
|
- add gcc to runtime dependencies
|
||||||
|
|
||||||
|
* Thu Apr 24 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-2
|
||||||
|
- fix and re-enable documentation
|
||||||
|
|
||||||
|
* Thu Mar 06 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-1
|
||||||
|
- Update to 0.14.0
|
||||||
|
|
||||||
|
* Mon Jan 27 2025 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-8
|
||||||
|
- specify to build against local zig stdlib directory to ensure we are building against the newest stdlib
|
||||||
|
- use release fast instead of release safe to fix aarch64 builds from running out of memory
|
||||||
|
- enable position independent executable for the zig build
|
||||||
|
|
||||||
|
* Mon Jan 27 2025 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-7
|
||||||
|
- build stage 3 using zig build system
|
||||||
|
- add user provided options to the end of the build and install options
|
||||||
|
|
||||||
|
* Thu Jan 23 2025 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-6
|
||||||
|
- rebuild against fixed llvm
|
||||||
|
|
||||||
|
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Dec 29 2024 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-4
|
||||||
|
- correct macro variables
|
||||||
|
- set llvm_compat for F41
|
||||||
|
- update callaway licenses to follow SPDX
|
||||||
|
|
||||||
|
* Wed Sep 04 2024 Miroslav Suchý <msuchy@redhat.com> - 0.13.0-3
|
||||||
|
- convert license to SPDX
|
||||||
|
|
||||||
|
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jun 11 2024 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-1
|
||||||
|
- Update to 0.13.0
|
||||||
|
|
||||||
|
* Sat Jun 08 2024 Jan200101 <sentrycraft123@gmail.com> - 0.12.1-1
|
||||||
|
- Update to 0.12.1
|
||||||
|
|
||||||
|
* Sat May 25 2024 Jan200101 <sentrycraft123@gmail.com> - 0.12.0-1
|
||||||
|
- Update to 0.12.0
|
||||||
|
|
||||||
|
* Wed Feb 21 2024 Jan Drögehoff <sentrycraft123@gmail.com> - 0.11.0-2
|
||||||
|
- Rebuilt for bootstrapping
|
||||||
|
|
||||||
|
* Sat Jan 27 2024 Aleksei Bavshin <alebastr@fedoraproject.org> - 0.11.0-1
|
||||||
|
- Update to 0.11.0
|
||||||
|
|
||||||
|
* Sat Jan 27 2024 Aleksei Bavshin <alebastr@fedoraproject.org> - 0.9.1-6
|
||||||
|
- Fix build with `--without macro`
|
||||||
|
- Skip %%check and test dependencies when tests are disabled
|
||||||
|
- Drop %%_zig_version macro
|
||||||
|
|
||||||
|
* Sat Jan 27 2024 Benson Muite <benson_muite@emailplus.org> - 0.9.1-6
|
||||||
|
- Verify source signature
|
||||||
|
|
||||||
|
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Feb 18 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.1-1
|
||||||
|
- Update to 0.9.1
|
||||||
|
|
||||||
|
* Thu Jan 27 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.0-3
|
||||||
|
- Jan: add rpath patch
|
||||||
|
- Aleksei Bavshin: rpm macros: set default build flags
|
||||||
|
|
||||||
|
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Dec 20 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.0-1
|
||||||
|
- Update to 0.9.0
|
||||||
|
|
||||||
|
* Wed Nov 17 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-5
|
||||||
|
- Enable documentation on Fedora 35
|
||||||
|
|
||||||
|
* Tue Nov 09 2021 Tom Stellard <tstellar@redhat.com> - 0.8.1-4
|
||||||
|
- Rebuild for llvm-13.0.0
|
||||||
|
|
||||||
|
* Sat Oct 30 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-3
|
||||||
|
- Update LLVM13 Patch
|
||||||
|
|
||||||
|
* Thu Oct 07 2021 Tom Stellard <tstellar@redhat.com> - 0.8.1-2
|
||||||
|
- Rebuild for llvm-13.0.0
|
||||||
|
|
||||||
|
* Sun Sep 12 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-1
|
||||||
|
- Update to Zig 0.8.1, add LLVM 13 patch
|
||||||
|
|
||||||
|
* Wed Aug 18 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-8
|
||||||
|
- Rebuilt for lld soname bump
|
||||||
|
|
||||||
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jul 19 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-6
|
||||||
|
- add native libc detection patch
|
||||||
|
|
||||||
|
* Sun Jul 04 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-5
|
||||||
|
- correct newline in macro that caused DESTDIR to be ignored
|
||||||
|
|
||||||
|
* Mon Jun 28 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-4
|
||||||
|
- correct macro once again to allow for proper packaging
|
||||||
|
|
||||||
|
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-3
|
||||||
|
- improve macro for using the zig binary
|
||||||
|
|
||||||
|
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-2
|
||||||
|
- Update patches, correct rpm macro
|
||||||
|
|
||||||
|
* Sat Jun 05 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-1
|
||||||
|
- Update to Zig 0.8.0
|
||||||
|
|
||||||
|
* Sun Dec 13 23:18:24 CET 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.7.1-1
|
||||||
|
- Update to Zig 0.7.1
|
||||||
|
|
||||||
|
* Wed Nov 11 17:18:27 CET 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.7.0-1
|
||||||
|
- Update to Zig 0.7.0
|
||||||
|
|
||||||
|
* Tue Aug 18 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.6.0-1
|
||||||
|
- Initial zig spec
|
||||||
83
macros.zig
83
macros.zig
|
|
@ -1,21 +1,72 @@
|
||||||
%zig_arches x86_64 aarch64 riscv64 %{mips64}
|
%zig_arches x86_64 aarch64 riscv64 %{mips64}
|
||||||
|
|
||||||
%_zig_version @@ZIG_VERSION@@
|
%__zig %{_bindir}/zig
|
||||||
%zig /usr/bin/zig
|
|
||||||
|
|
||||||
%zig_build %zig \\\
|
%_zig_cache_dir %{_vpath_builddir}/zig-cache
|
||||||
build \\\
|
%_zig_package_dir %{_zig_cache_dir}/p
|
||||||
--verbose \\\
|
|
||||||
--cache-dir zig-cache
|
|
||||||
|
|
||||||
%zig_install \
|
# expected features for each arch when targeting baseline
|
||||||
DESTDIR="%{buildroot}" %zig_build \\\
|
# found in https://github.com/ziglang/zig/tree/master/lib/std/Target
|
||||||
install \\\
|
#
|
||||||
--prefix "%{_prefix}" \\\
|
# aarch64:
|
||||||
--prefix-lib-dir "%{_libdir}" \\\
|
# enable_select_opt, ete, fuse_adrp_add, fuse_aes, neon, use_postra_scheduler,
|
||||||
--prefix-exe-dir "%{_bindir}" \\\
|
#
|
||||||
--prefix-include-dir "%{_includedir}"
|
# x86_64:
|
||||||
|
# cmov, cx8, fxsr, idivq_to_divl, macrofusion, mmx, nopl, slow_3ops_lea, slow_incdec, sse2, vzeroupper, x87
|
||||||
|
#
|
||||||
|
# riscv64:
|
||||||
|
# a, c, d, i, m
|
||||||
|
#
|
||||||
|
# mips64:
|
||||||
|
# mips64r2
|
||||||
|
#
|
||||||
|
%_zig_cpu baseline
|
||||||
|
%_zig_target native
|
||||||
|
%_zig_release_mode safe
|
||||||
|
|
||||||
%zig_test \
|
# seperated build options
|
||||||
%zig_build \\\
|
%_zig_general_options --verbose --release=%{_zig_release_mode} --build-id=sha1 --summary all
|
||||||
test
|
%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu}
|
||||||
|
# 0.16.0 introduced packaging changes which install packages into this relative directory
|
||||||
|
# Will be ovewritable in 0.17.0
|
||||||
|
# https://codeberg.org/ziglang/zig/pulls/31950
|
||||||
|
%_zig_system_integration --system "zig-pkg"
|
||||||
|
%_zig_advanced_options -fallow-so-scripts --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}"
|
||||||
|
|
||||||
|
%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options}
|
||||||
|
%_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %{?zig_install_options}
|
||||||
|
%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} %{?zig_fetch_options}
|
||||||
|
%_zig_test_options %{?zig_test_options}
|
||||||
|
|
||||||
|
|
||||||
|
%zig_prep %{shrink: \
|
||||||
|
mkdir -p \
|
||||||
|
%{_zig_cache_dir} \
|
||||||
|
%{_zig_package_dir} \
|
||||||
|
"zig-pkg" \
|
||||||
|
}
|
||||||
|
|
||||||
|
%zig_build %{shrink: \
|
||||||
|
%__zig \
|
||||||
|
build \
|
||||||
|
%{?_zig_build_options} \
|
||||||
|
}
|
||||||
|
|
||||||
|
%zig_install %{shrink: \
|
||||||
|
DESTDIR="%{buildroot}" \
|
||||||
|
%zig_build \
|
||||||
|
install \
|
||||||
|
%{?_zig_install_options} \
|
||||||
|
}
|
||||||
|
|
||||||
|
%zig_fetch %{shrink: \
|
||||||
|
%__zig \
|
||||||
|
fetch \
|
||||||
|
%{?_zig_fetch_options} \
|
||||||
|
}
|
||||||
|
|
||||||
|
%zig_test %{shrink: \
|
||||||
|
%zig_build \
|
||||||
|
test \
|
||||||
|
%{?%_zig_test_options} \
|
||||||
|
}
|
||||||
|
|
|
||||||
3
sources
3
sources
|
|
@ -1 +1,2 @@
|
||||||
SHA512 (zig-0.8.1.tar.gz) = 36bea566eee3dc5c00f2713cbc6616258dbadd3ee994749339f124f8b70c691cfe7fdce6a00194f879679ea417dadb3bcc244f8b79153957a426fea2d52caaf5
|
SHA512 (zig-0.16.0.tar.xz) = 1404a939c6f233d5f328a4833543d7a2b2d9f0f5081babe6e3ad43daed25bbb0844b28c01c900f64b5bb63ac62b5586457c05380b10494dfefb56f49b58d4a0a
|
||||||
|
SHA512 (zig-0.16.0.tar.xz.minisig) = 44a2d57061cbe8bd4e9ad587c247883e2e9abefa148ab375617665fe51500a106f488ceaaeaf038c0ff5ce1a70f4eb3b519a44f3211769ea1ebae5ad49b2f1b9
|
||||||
|
|
|
||||||
278
zig.spec
278
zig.spec
|
|
@ -1,53 +1,119 @@
|
||||||
# https://ziglang.org/download/0.8.1/release-notes.html#Support-Table
|
# architecture and toolchain
|
||||||
# 32 bit builds currently run out of memory https://github.com/ziglang/zig/issues/6485
|
|
||||||
%global zig_arches x86_64 aarch64 riscv64 %{mips64}
|
|
||||||
|
|
||||||
%if %{fedora} >= 35
|
%if 0%{?rhel}
|
||||||
%bcond_without llvm13
|
# Zig depends on a C compiler (gcc) during bootstrapping.
|
||||||
|
# Older versions of gcc fail to compile the transpiled source, so limit to x86_64.
|
||||||
# documentation and tests do not build due to an unsupported glibc version
|
%global zig_arches x86_64
|
||||||
%bcond_with test
|
|
||||||
%bcond_with docs
|
|
||||||
|
|
||||||
%global llvm_version 13.0.0
|
|
||||||
%else
|
%else
|
||||||
%bcond_with llvm13
|
# Supported architectures: https://ziglang.org/download/VERSION/release-notes.html#Support-Table
|
||||||
|
%global zig_arches x86_64 aarch64 riscv64 %{mips64}
|
||||||
%bcond_without test
|
|
||||||
%bcond_without docs
|
|
||||||
|
|
||||||
%global llvm_version 12.0.0
|
|
||||||
%endif
|
%endif
|
||||||
%bcond_without macro
|
|
||||||
|
|
||||||
|
# GCC < 16.0 miscompiles on RISC-V; use Clang instead on older Fedora versions
|
||||||
|
%ifarch riscv64
|
||||||
|
%if 0%{?fedora} < 44
|
||||||
|
%bcond toolchain_clang 1
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with toolchain_clang}
|
||||||
|
%global toolchain clang
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# minisign public key for source verification (from https://ziglang.org/download/)
|
||||||
|
%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
|
||||||
|
|
||||||
|
|
||||||
|
# dependency versions and cache
|
||||||
|
|
||||||
|
# Compatible LLVM/Clang version definitions
|
||||||
|
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
|
||||||
|
%global llvm_compat 21
|
||||||
|
%endif
|
||||||
|
%global llvm_version 21.1.8
|
||||||
|
|
||||||
|
%global zig_cache_dir %{_vpath_builddir}/zig-cache
|
||||||
|
|
||||||
|
|
||||||
|
# build conditionals
|
||||||
|
|
||||||
|
%bcond bootstrap 0
|
||||||
|
%bcond docs %{without bootstrap}
|
||||||
|
%bcond macro %{without bootstrap}
|
||||||
|
%bcond test 1
|
||||||
|
|
||||||
|
|
||||||
|
# build and install options
|
||||||
|
|
||||||
|
%global zig_build_options %{shrink: \
|
||||||
|
--verbose \
|
||||||
|
--release=fast \
|
||||||
|
--summary all \
|
||||||
|
\
|
||||||
|
-Dtarget=native \
|
||||||
|
-Dcpu=baseline \
|
||||||
|
--zig-lib-dir lib \
|
||||||
|
--build-id=sha1 \
|
||||||
|
\
|
||||||
|
--cache-dir "%{zig_cache_dir}" \
|
||||||
|
--global-cache-dir "%{zig_cache_dir}" \
|
||||||
|
\
|
||||||
|
-Dversion-string="%{?dev_version}%{!?dev_version:%{version}}" \
|
||||||
|
-Dstatic-llvm=false \
|
||||||
|
-Denable-llvm=true \
|
||||||
|
-Dno-langref=true \
|
||||||
|
-Dstd-docs=false \
|
||||||
|
-Dpie \
|
||||||
|
-Dconfig_h="%{__cmake_builddir}/config.h" \
|
||||||
|
}
|
||||||
|
|
||||||
|
%global zig_install_options %{shrink: \
|
||||||
|
%zig_build_options \
|
||||||
|
--prefix "%{_prefix}" \
|
||||||
|
}
|
||||||
|
|
||||||
Name: zig
|
Name: zig
|
||||||
Version: 0.8.1
|
Version: 0.16.0
|
||||||
Release: 1%{?dist}
|
Release: %autorelease
|
||||||
Summary: Programming language for maintaining robust, optimal, and reusable software
|
Summary: Programming language for maintaining robust, optimal, and reusable software
|
||||||
|
|
||||||
License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1
|
# The minisign file references a specific archive name so we store for ease of use
|
||||||
|
%global archive_name %{name}-%{version}.tar.xz
|
||||||
|
|
||||||
|
License: MIT AND NCSA AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND Inner-Net-2.0 AND ISC AND LicenseRef-Fedora-Public-Domain AND GFDL-1.1-or-later AND ZPL-2.1
|
||||||
URL: https://ziglang.org
|
URL: https://ziglang.org
|
||||||
Source0: https://github.com/ziglang/zig/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source0: %{url}/download/%{version}/%{archive_name}
|
||||||
Source1: macros.%{name}
|
Source1: %{url}/download/%{version}/%{archive_name}.minisig
|
||||||
|
Source2: macros.%{name}
|
||||||
|
|
||||||
# https://github.com/ziglang/zig/pull/9020
|
# Remove native lib directories from rpath
|
||||||
Patch0: 0001-specify-the-output-lib-exe-and-include-paths-with-fl.patch
|
# this is unlikely to be upstreamed in its current state because upstream
|
||||||
Patch1: 0002-zig-build-rename-lib-dir-include-dir-exe-dir.patch
|
# wants to work around the shortcomings of NixOS
|
||||||
|
Patch0: 0001-remove-native-lib-directories-from-rpath.patch
|
||||||
|
|
||||||
Patch100: 0003-LLVM-13-rebase.patch
|
# LLVM on RHEL/EPEL only provides fewer targets so we patch the required targets down
|
||||||
|
# Targets come from https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec
|
||||||
|
Patch1: 0002-Remove-unsupported-LLVM-targets-for-EPEL.patch
|
||||||
|
|
||||||
|
%if %{without toolchain_clang}
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
|
%else
|
||||||
|
BuildRequires: clang
|
||||||
|
%endif
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: llvm-devel
|
BuildRequires: llvm%{?llvm_compat}-devel
|
||||||
BuildRequires: clang-devel
|
BuildRequires: clang%{?llvm_compat}-devel
|
||||||
BuildRequires: lld-devel
|
BuildRequires: lld%{?llvm_compat}-devel
|
||||||
|
BuildRequires: zlib-devel
|
||||||
|
BuildRequires: libxml2-devel
|
||||||
# for man page generation
|
# for man page generation
|
||||||
BuildRequires: help2man
|
BuildRequires: help2man
|
||||||
|
# for signature verification
|
||||||
|
BuildRequires: minisign
|
||||||
|
|
||||||
%if %{with macro}
|
%if %{without bootstrap}
|
||||||
BuildRequires: sed
|
BuildRequires: (zig >= 0.16 with zig < 0.17)
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
|
|
@ -60,22 +126,22 @@ Requires: %{name}-libs = %{version}
|
||||||
|
|
||||||
# These packages are bundled as source
|
# These packages are bundled as source
|
||||||
|
|
||||||
# NCSA
|
# Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
|
||||||
Provides: bundled(compiler-rt) = %{llvm_version}
|
Provides: bundled(compiler-rt) = %{llvm_version}
|
||||||
# LGPLv2+, LGPLv2+ with exceptions, GPLv2+, GPLv2+ with exceptions, BSD, Inner-Net, ISC, Public Domain and GFDL
|
# LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only
|
||||||
Provides: bundled(glibc) = 2.33
|
Provides: bundled(glibc) = 2.43
|
||||||
# NCSA
|
# Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
|
||||||
Provides: bundled(libcxx) = %{llvm_version}
|
Provides: bundled(libcxx) = %{llvm_version}
|
||||||
# NCSA
|
# Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
|
||||||
Provides: bundled(libcxxabi) = %{llvm_version}
|
Provides: bundled(libcxxabi) = %{llvm_version}
|
||||||
# NCSA
|
# NCSA
|
||||||
Provides: bundled(libunwind) = %{llvm_version}
|
Provides: bundled(libunwind) = %{llvm_version}
|
||||||
# BSD, LGPG, ZPL
|
# BSD, LGPG, ZPL
|
||||||
Provides: bundled(mingw) = 9.0.0
|
Provides: bundled(mingw) = 3839e21b08807479a31d5a9764666f82ae2f0356
|
||||||
# MIT
|
# MIT
|
||||||
Provides: bundled(musl) = 1.2.2
|
Provides: bundled(musl) = 1.2.5
|
||||||
# CC0, BSD, MIT, Apache2, Apache2 with exceptions
|
# Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause
|
||||||
Provides: bundled(wasi-libc) = 82fc2c4f449e56319112f6f2583195c7f4e714b1
|
Provides: bundled(wasi-libc) = d03829489904d38c624f6de9983190f1e5e7c9c5
|
||||||
|
|
||||||
ExclusiveArch: %{zig_arches}
|
ExclusiveArch: %{zig_arches}
|
||||||
|
|
||||||
|
|
@ -83,13 +149,13 @@ ExclusiveArch: %{zig_arches}
|
||||||
Zig is an open-source programming language designed for robustness, optimality,
|
Zig is an open-source programming language designed for robustness, optimality,
|
||||||
and clarity. This package provides the zig compiler and the associated runtime.
|
and clarity. This package provides the zig compiler and the associated runtime.
|
||||||
|
|
||||||
# the standard library contains only plain text
|
# The Zig stdlib only contains uncompiled code
|
||||||
%package libs
|
%package libs
|
||||||
Summary: zig standard library
|
Summary: %{name} Standard Library
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description libs
|
%description libs
|
||||||
Standard Zig library
|
%{name} Standard Library
|
||||||
|
|
||||||
%if %{with docs}
|
%if %{with docs}
|
||||||
%package doc
|
%package doc
|
||||||
|
|
@ -107,62 +173,96 @@ Summary: Common RPM macros for %{name}
|
||||||
Requires: rpm
|
Requires: rpm
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description rpm-macros
|
%description rpm-macros
|
||||||
This package contains common RPM macros for %{name}.
|
This package contains common RPM macros for %{name}.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}"
|
||||||
|
|
||||||
%patch0 -p1
|
%autosetup -N
|
||||||
%patch1 -p1
|
%patch 0 -p1
|
||||||
%if %{with llvm13}
|
%if 0%{?rhel}
|
||||||
%patch100 -p1
|
%patch 1 -p1
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{without bootstrap}
|
||||||
|
# Ensure that the pre-build stage1 binary is not used
|
||||||
|
rm -f stage1/zig1.wasm
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
# Fedora supports using ccache systemwide
|
||||||
|
# Zig generates a large C file for bootstrapping which does not
|
||||||
|
# behave well with ccache so we explicitly disable it.
|
||||||
|
export CCACHE_DISABLE=1
|
||||||
|
|
||||||
|
# zig doesn't know how to dynamically link llvm on its own so we need cmake to generate a header ahead of time
|
||||||
|
# if we provide the header we need to also build zigcpp
|
||||||
|
|
||||||
|
# C_FLAGS: wasm2c output generates a lot of noise with -Wunused.
|
||||||
|
# EXTRA_BUILD_ARGS: explicitly specify a build-id
|
||||||
%cmake \
|
%cmake \
|
||||||
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
|
||||||
-DZIG_PREFER_CLANG_CPP_DYLIB=true \
|
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \
|
||||||
-DZIG_VERSION:STRING="%{version}"
|
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \
|
||||||
%cmake_build
|
\
|
||||||
|
-DZIG_EXTRA_BUILD_ARGS:STRING="--verbose;--build-id=sha1" \
|
||||||
|
-DZIG_SHARED_LLVM:BOOL=true \
|
||||||
|
-DZIG_PIE:BOOL=true \
|
||||||
|
\
|
||||||
|
-DZIG_TARGET_MCPU:STRING=baseline \
|
||||||
|
-DZIG_TARGET_TRIPLE:STRING=native \
|
||||||
|
\
|
||||||
|
-DZIG_VERSION:STRING="%{?dev_version}%{!?dev_version:%{version}}"
|
||||||
|
|
||||||
|
%if %{with bootstrap}
|
||||||
|
%cmake_build --target stage3
|
||||||
|
%else
|
||||||
|
%cmake_build --target zigcpp
|
||||||
|
zig build %{zig_build_options}
|
||||||
|
|
||||||
# Zig has no official manpage
|
# Zig has no official manpage
|
||||||
# https://github.com/ziglang/zig/issues/715
|
# https://github.com/ziglang/zig/issues/715
|
||||||
help2man --no-discard-stderr "%{__cmake_builddir}/zig" --version-option=version --output=%{name}.1
|
help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=version --output=zig.1
|
||||||
|
%endif
|
||||||
|
|
||||||
ln -s lib "%{__cmake_builddir}/"
|
|
||||||
|
|
||||||
%if %{with docs}
|
%if %{with docs}
|
||||||
%{__cmake_builddir}/zig build docs -Dversion-string="%{version}"
|
# Use the newly made stage 3 compiler to generate docs
|
||||||
|
./zig-out/bin/zig build docs %{zig_build_options}
|
||||||
%endif
|
%endif
|
||||||
mkdir -p zig-cache
|
|
||||||
touch zig-cache/langref.html
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{with bootstrap}
|
||||||
%cmake_install
|
%cmake_install
|
||||||
|
%if 0%{?rhel}
|
||||||
|
rm -rf %{buildroot}%{_prefix}/doc
|
||||||
|
%endif
|
||||||
|
%else
|
||||||
|
DESTDIR="%{buildroot}" zig build install %{zig_install_options}
|
||||||
|
|
||||||
mkdir -p %{buildroot}/%{_mandir}/man1
|
install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ zig.1
|
||||||
install -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/
|
%endif
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
|
|
||||||
|
|
||||||
install -p -m644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/
|
%if %{with macro}
|
||||||
sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name}
|
install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
||||||
|
%endif
|
||||||
%check
|
|
||||||
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
# Issues with tests stop them from completing successfully
|
%check
|
||||||
# https://github.com/ziglang/zig/issues/9738
|
# Run reduced set of tests, based on the Zig CI
|
||||||
#%%{__cmake_builddir}/zig build test
|
"%{buildroot}%{_bindir}/zig" test test/behavior.zig -Itest
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{_bindir}/zig
|
%{_bindir}/zig
|
||||||
|
%if %{without bootstrap}
|
||||||
%{_mandir}/man1/%{name}.1.*
|
%{_mandir}/man1/%{name}.1.*
|
||||||
|
%endif
|
||||||
|
|
||||||
%files libs
|
%files libs
|
||||||
%{_prefix}/lib/%{name}
|
%{_prefix}/lib/%{name}
|
||||||
|
|
@ -170,48 +270,14 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d
|
||||||
%if %{with docs}
|
%if %{with docs}
|
||||||
%files doc
|
%files doc
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%doc zig-cache/langref.html
|
%doc zig-out/doc/langref.html
|
||||||
|
%doc zig-out/doc/std
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with macro}
|
%if %{with macro}
|
||||||
%files rpm-macros
|
%files rpm-macros
|
||||||
%{_rpmconfigdir}/macros.d/macros.%{name}
|
%{_rpmmacrodir}/macros.%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Sep 12 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-1
|
%autochangelog
|
||||||
- Update to Zig 0.8.1, add LLVM 13 patch
|
|
||||||
|
|
||||||
* Wed Aug 18 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-8
|
|
||||||
- Rebuilt for lld soname bump
|
|
||||||
|
|
||||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Jul 19 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-6
|
|
||||||
- add native libc detection patch
|
|
||||||
|
|
||||||
* Sun Jul 04 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-5
|
|
||||||
- correct newline in macro that caused DESTDIR to be ignored
|
|
||||||
|
|
||||||
* Mon Jun 28 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-4
|
|
||||||
- correct macro once again to allow for proper packaging
|
|
||||||
|
|
||||||
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-3
|
|
||||||
- improve macro for using the zig binary
|
|
||||||
|
|
||||||
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-2
|
|
||||||
- Update patches, correct rpm macro
|
|
||||||
|
|
||||||
* Sat Jun 05 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-1
|
|
||||||
- Update to Zig 0.8.0
|
|
||||||
|
|
||||||
* Sun Dec 13 23:18:24 CET 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.7.1-1
|
|
||||||
- Update to Zig 0.7.1
|
|
||||||
|
|
||||||
* Wed Nov 11 17:18:27 CET 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.7.0-1
|
|
||||||
- Update to Zig 0.7.0
|
|
||||||
|
|
||||||
* Tue Aug 18 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.6.0-1
|
|
||||||
- Initial zig spec
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue