Compare commits
40 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b97859a14d | |||
| f21863840d | |||
| 66658d58a3 | |||
| 15815f1459 | |||
| 313ccb8634 | |||
|
|
50dc71abe9 | ||
| 47d984f034 | |||
|
|
15a6207e77 | ||
|
|
0e97ce964c | ||
|
|
d7f3e5387e | ||
|
|
916a8dfa48 | ||
|
|
3e800f8ae2 | ||
|
|
c87a233603 | ||
|
|
492cfa8a9d | ||
|
|
93a60323ca | ||
|
|
bf7918c042 | ||
|
|
3c0c285f5e | ||
|
|
9188254726 | ||
|
|
e39573411b | ||
|
|
bf208962e0 | ||
|
|
e5512844f1 | ||
|
|
aca4ce3fe6 | ||
|
|
7f741f0567 | ||
|
|
f1ca18b3cd | ||
|
|
7bd1d451f7 | ||
|
|
56c37b6d1e | ||
|
|
e256911be3 | ||
|
|
af76719f06 | ||
|
|
cde208fffa | ||
|
|
80bb2641d0 | ||
|
|
9cb6508e6b | ||
|
|
e51deb7f8a | ||
|
|
d8d47ce95e | ||
|
|
eb8010870f | ||
|
|
2eafc87a19 | ||
| e13dfb3c9f | |||
|
|
1af365e1e3 | ||
|
|
9e5d0a8a54 | ||
|
|
86abd88865 | ||
|
|
fb33ce16b6 |
@@ -1,32 +1,26 @@
|
||||
We invoke LLD so we also commented/remove it out as well.
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 92be8fb..e19d18e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -136,7 +136,7 @@
|
||||
diff -ruN zig-0.13.0.orig/CMakeLists.txt zig-0.13.0/CMakeLists.txt
|
||||
--- zig-0.13.0.orig/CMakeLists.txt 2024-06-08 02:06:52.784489192 +0800
|
||||
+++ zig-0.13.0/CMakeLists.txt 2024-06-08 02:07:26.458213443 +0800
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
find_package(llvm 17)
|
||||
find_package(clang 17)
|
||||
-find_package(lld 17)
|
||||
+# find_package(lld 17)
|
||||
find_package(llvm 20)
|
||||
find_package(clang 20)
|
||||
-find_package(lld 20)
|
||||
+# find_package(lld 20)
|
||||
|
||||
if(ZIG_STATIC_ZLIB)
|
||||
if (MSVC)
|
||||
@@ -183,7 +183,7 @@
|
||||
endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
include_directories(${LLVM_INCLUDE_DIRS})
|
||||
-include_directories(${LLD_INCLUDE_DIRS})
|
||||
+# include_directories(${LLD_INCLUDE_DIRS})
|
||||
include_directories(${CLANG_INCLUDE_DIRS})
|
||||
|
||||
find_package(Threads)
|
||||
@@ -707,7 +707,7 @@
|
||||
|
||||
target_link_libraries(zigcpp LINK_PUBLIC
|
||||
@@ -736,11 +736,11 @@
|
||||
target_include_directories(zigcpp PUBLIC
|
||||
${CLANG_INCLUDE_DIRS}
|
||||
${LLVM_INCLUDE_DIRS}
|
||||
- ${LLD_INCLUDE_DIRS}
|
||||
+# ${LLD_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(zigcpp PUBLIC
|
||||
${CLANG_LIBRARIES}
|
||||
- ${LLD_LIBRARIES}
|
||||
+ # ${LLD_LIBRARIES}
|
||||
+# ${LLD_LIBRARIES}
|
||||
${LLVM_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
|
||||
@@ -1,60 +1,56 @@
|
||||
Based on Aaron Puchert's <aaronpuchert@alice-dsl.net> patch.
|
||||
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
|
||||
index ae1f0242..c0010c77 100644
|
||||
--- a/src/zig_llvm.cpp
|
||||
+++ b/src/zig_llvm.cpp
|
||||
@@ -60,15 +60,18 @@
|
||||
diff -ruN zig-0.15.1.orig/src/zig_llvm.cpp zig-0.15.1/src/zig_llvm.cpp
|
||||
--- zig-0.15.1.orig/src/zig_llvm.cpp 2025-08-27 22:13:38.418809910 +0800
|
||||
+++ zig-0.15.1/src/zig_llvm.cpp 2025-08-27 22:53:09.408882779 +0800
|
||||
@@ -62,7 +62,6 @@
|
||||
#include <llvm/Transforms/Utils/CanonicalizeAliases.h>
|
||||
#include <llvm/Transforms/Utils/NameAnonGlobals.h>
|
||||
|
||||
-#include <lld/Common/Driver.h>
|
||||
-
|
||||
|
||||
#if __GNUC__ >= 9
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@@ -71,6 +70,10 @@
|
||||
#include <new>
|
||||
|
||||
+#include <poll.h>
|
||||
#include <stdlib.h>
|
||||
+#include <spawn.h>
|
||||
+#include <poll.h>
|
||||
+#include <sys/wait.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
@@ -78,6 +81,85 @@ static const bool assertions_on = true;
|
||||
@@ -80,6 +83,85 @@
|
||||
static const bool assertions_on = false;
|
||||
#endif
|
||||
|
||||
+namespace {
|
||||
+ class Pipe {
|
||||
+ public:
|
||||
+ Pipe(llvm::raw_ostream *output) : output(output) {}
|
||||
+ ~Pipe() {
|
||||
+ if (fd[0] != -1) close(fd[0]);
|
||||
+ if (fd[1] != -1) close(fd[1]);
|
||||
+ }
|
||||
+ bool open() { return pipe(fd) == 0; }
|
||||
+ int getRead() const { return fd[0]; }
|
||||
+ int getWrite() const { return fd[1]; }
|
||||
+ void closeWrite() { close(fd[1]); fd[1] = -1; }
|
||||
+ void flush() const {
|
||||
+ constexpr size_t size = 1024;
|
||||
+ char buf[size];
|
||||
+ ssize_t ret;
|
||||
+ do {
|
||||
+ ret = read(getRead(), buf, size);
|
||||
+ if (ret > 0 && output)
|
||||
+ output->write(buf, ret);
|
||||
+ } while (ret == size || (ret == -1 && errno == EINTR));
|
||||
+ }
|
||||
+ private:
|
||||
+ int fd[2] = {-1, -1};
|
||||
+ llvm::raw_ostream *output;
|
||||
+ };
|
||||
+} // anonymous namespace
|
||||
+ class Pipe {
|
||||
+ public:
|
||||
+ Pipe(llvm::raw_ostream *output) : output(output) {}
|
||||
+ ~Pipe() {
|
||||
+ if (fd[0] != -1) close(fd[0]);
|
||||
+ if (fd[1] != -1) close(fd[1]);
|
||||
+ }
|
||||
+ bool open() { return pipe(fd) == 0; }
|
||||
+ int getRead() const { return fd[0]; }
|
||||
+ int getWrite() const { return fd[1]; }
|
||||
+ void closeWrite() { close(fd[1]); fd[1] = -1; }
|
||||
+ void flush() const {
|
||||
+ constexpr size_t size = 1024;
|
||||
+ char buf[size];
|
||||
+ ssize_t ret;
|
||||
+ do {
|
||||
+ ret = read(getRead(), buf, size);
|
||||
+ if (ret > 0 && output)
|
||||
+ output->write(buf, ret);
|
||||
+ } while (ret == size || (ret == -1 && errno == EINTR));
|
||||
+ }
|
||||
+ private:
|
||||
+ int fd[2] = {-1, -1};
|
||||
+ llvm::raw_ostream *output;
|
||||
+ };
|
||||
+}
|
||||
+
|
||||
+static bool InvokeLld(const char *variant, llvm::ArrayRef<const char *> args,
|
||||
+ llvm::raw_ostream &stdoutOS,
|
||||
@@ -109,26 +105,25 @@ index ae1f0242..c0010c77 100644
|
||||
+
|
||||
LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple,
|
||||
const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc,
|
||||
LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
|
||||
@@ -558,18 +640,15 @@ namespace lld {
|
||||
}
|
||||
LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMFloatABI float_abi,
|
||||
@@ -560,17 +642,17 @@
|
||||
|
||||
bool ZigLLDLinkCOFF(int argc, const char **argv, bool can_exit_early, bool disable_output) {
|
||||
- std::vector<const char *> args(argv, argv + argc);
|
||||
std::vector<const char *> args(argv, argv + argc);
|
||||
- return lld::coff::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
|
||||
+ return InvokeLld("lld-link-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
|
||||
+ return InvokeLld("lld-link-20", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
|
||||
}
|
||||
|
||||
bool ZigLLDLinkELF(int argc, const char **argv, bool can_exit_early, bool disable_output) {
|
||||
- std::vector<const char *> args(argv, argv + argc);
|
||||
std::vector<const char *> args(argv, argv + argc);
|
||||
- return lld::elf::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
|
||||
+ return InvokeLld("ld.lld-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
|
||||
+ return InvokeLld("ld.lld-20", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
|
||||
}
|
||||
|
||||
bool ZigLLDLinkWasm(int argc, const char **argv, bool can_exit_early, bool disable_output) {
|
||||
- std::vector<const char *> args(argv, argv + argc);
|
||||
std::vector<const char *> args(argv, argv + argc);
|
||||
- return lld::wasm::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
|
||||
+ return InvokeLld("wasm-ld-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
|
||||
+ return InvokeLld("wasm-ld-20", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
|
||||
}
|
||||
|
||||
static_assert((Triple::ArchType)ZigLLVM_UnknownArch == Triple::UnknownArch, "");
|
||||
static_assert((FloatABI::ABIType)ZigLLVMFloatABI_Default == FloatABI::ABIType::Default, "");
|
||||
|
||||
@@ -1,52 +1,57 @@
|
||||
Since we patched it to invoke LLD directly, we will have
|
||||
to remove any mentions of LLD here.
|
||||
diff --git a/build.zig b/build.zig
|
||||
index 0e43b82f..14792f48 100644
|
||||
--- a/build.zig
|
||||
+++ b/build.zig
|
||||
@@ -689,12 +689,12 @@ fn addCmakeCfgOptionsToExe(
|
||||
diff -ruN zig-0.15.1.orig/build.zig zig-0.15.1/build.zig
|
||||
--- zig-0.15.1.orig/build.zig 2025-08-27 22:13:38.504308190 +0800
|
||||
+++ zig-0.15.1/build.zig 2025-08-27 23:06:14.149084513 +0800
|
||||
@@ -205,7 +205,6 @@
|
||||
|
||||
const use_llvm = b.option(bool, "use-llvm", "Use the llvm backend");
|
||||
exe.use_llvm = use_llvm;
|
||||
- exe.use_lld = use_llvm;
|
||||
|
||||
if (no_bin) {
|
||||
b.getInstallStep().dependOn(&exe.step);
|
||||
@@ -559,7 +558,6 @@
|
||||
}),
|
||||
.filters = test_filters,
|
||||
.use_llvm = use_llvm,
|
||||
- .use_lld = use_llvm,
|
||||
.zig_lib_dir = b.path("lib"),
|
||||
});
|
||||
if (link_libc) {
|
||||
@@ -787,12 +785,9 @@
|
||||
cfg.cmake_static_library_suffix,
|
||||
}),
|
||||
}) });
|
||||
- assert(cfg.lld_include_dir.len != 0);
|
||||
- exe.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
|
||||
+ // assert(cfg.lld_include_dir.len != 0);
|
||||
+ // exe.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
|
||||
exe.addIncludePath(.{ .cwd_relative = cfg.llvm_include_dir });
|
||||
exe.addLibraryPath(.{ .cwd_relative = cfg.llvm_lib_dir });
|
||||
addCMakeLibraryList(exe, cfg.clang_libraries);
|
||||
- addCMakeLibraryList(exe, cfg.lld_libraries);
|
||||
+ // addCMakeLibraryList(exe, cfg.lld_libraries);
|
||||
addCMakeLibraryList(exe, cfg.llvm_libraries);
|
||||
- mod.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
|
||||
mod.addIncludePath(.{ .cwd_relative = cfg.llvm_include_dir });
|
||||
mod.addLibraryPath(.{ .cwd_relative = cfg.llvm_lib_dir });
|
||||
addCMakeLibraryList(mod, cfg.clang_libraries);
|
||||
- addCMakeLibraryList(mod, cfg.lld_libraries);
|
||||
addCMakeLibraryList(mod, cfg.llvm_libraries);
|
||||
|
||||
if (use_zig_libcxx) {
|
||||
@@ -862,8 +862,8 @@ const CMakeConfig = struct {
|
||||
@@ -980,8 +975,6 @@
|
||||
cmake_static_library_suffix: []const u8,
|
||||
cxx_compiler: []const u8,
|
||||
cxx_compiler_arg1: []const u8,
|
||||
- lld_include_dir: []const u8,
|
||||
- lld_libraries: []const u8,
|
||||
+ // lld_include_dir: []const u8,
|
||||
+ // lld_libraries: []const u8,
|
||||
clang_libraries: []const u8,
|
||||
llvm_lib_dir: []const u8,
|
||||
llvm_include_dir: []const u8,
|
||||
@@ -929,8 +929,8 @@ fn parseConfigH(b: *std.Build, config_h_text: []const u8) ?CMakeConfig {
|
||||
@@ -1047,8 +1040,6 @@
|
||||
.cmake_static_library_suffix = undefined,
|
||||
.cxx_compiler = undefined,
|
||||
.cxx_compiler_arg1 = "",
|
||||
- .lld_include_dir = undefined,
|
||||
- .lld_libraries = undefined,
|
||||
+ // .lld_include_dir = undefined,
|
||||
+ // .lld_libraries = undefined,
|
||||
.clang_libraries = undefined,
|
||||
.llvm_lib_dir = undefined,
|
||||
.llvm_include_dir = undefined,
|
||||
@@ -964,14 +964,14 @@ fn parseConfigH(b: *std.Build, config_h_text: []const u8) ?CMakeConfig {
|
||||
.prefix = "#define ZIG_CXX_COMPILER_ARG1 ",
|
||||
@@ -1083,14 +1074,6 @@
|
||||
.field = "cxx_compiler_arg1",
|
||||
},
|
||||
- .{
|
||||
.{
|
||||
- .prefix = "#define ZIG_LLD_INCLUDE_PATH ",
|
||||
- .field = "lld_include_dir",
|
||||
- },
|
||||
@@ -54,14 +59,7 @@ index 0e43b82f..14792f48 100644
|
||||
- .prefix = "#define ZIG_LLD_LIBRARIES ",
|
||||
- .field = "lld_libraries",
|
||||
- },
|
||||
+ // .{
|
||||
+ // .prefix = "#define ZIG_LLD_INCLUDE_PATH ",
|
||||
+ // .field = "lld_include_dir",
|
||||
+ // },
|
||||
+ // .{
|
||||
+ // .prefix = "#define ZIG_LLD_LIBRARIES ",
|
||||
+ // .field = "lld_libraries",
|
||||
+ // },
|
||||
.{
|
||||
- .{
|
||||
.prefix = "#define ZIG_CLANG_LIBRARIES ",
|
||||
.field = "clang_libraries",
|
||||
},
|
||||
|
||||
10
_constraints
10
_constraints
@@ -7,12 +7,9 @@
|
||||
<constraints>
|
||||
<hardware>
|
||||
<jobs>6</jobs>
|
||||
<physicalmemory>
|
||||
<size unit="G">16</size>
|
||||
</physicalmemory>
|
||||
<disk>
|
||||
<size unit="G">35</size>
|
||||
</disk>
|
||||
<memory>
|
||||
<size unit="G">8</size>
|
||||
</memory>
|
||||
</hardware>
|
||||
<overwrite>
|
||||
<!--
|
||||
@@ -22,7 +19,6 @@
|
||||
<conditions>
|
||||
<arch>ppc</arch>
|
||||
<arch>s390</arch>
|
||||
<arch>riscv64</arch>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
|
||||
@@ -41,3 +41,8 @@
|
||||
%zig_build \\\
|
||||
test
|
||||
|
||||
# Declarative build system, requires RPM 4.20+ to work
|
||||
# https://rpm-software-management.github.io/rpm/manual/buildsystem.html
|
||||
%buildsystem_zig_build() %zig_build %*
|
||||
%buildsystem_zig_install() %zig_install %*
|
||||
%buildsystem_zig_check() %zig_test %*
|
||||
|
||||
29
reproducible.patch
Normal file
29
reproducible.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
diff -ruN zig-0.15.1.orig/lib/compiler/build_runner.zig zig-0.15.1/lib/compiler/build_runner.zig
|
||||
--- zig-0.15.1.orig/lib/compiler/build_runner.zig 2025-08-27 22:13:36.317431953 +0800
|
||||
+++ zig-0.15.1/lib/compiler/build_runner.zig 2025-08-27 22:40:22.550530377 +0800
|
||||
@@ -67,6 +67,14 @@
|
||||
.handle = try std.fs.cwd().makeOpenPath(global_cache_root, .{}),
|
||||
};
|
||||
|
||||
+ // Avoid using native binaries during build to not influence zig-cache hashes
|
||||
+ const host_query: std.Target.Query = .{
|
||||
+ .cpu_model = .baseline,
|
||||
+ .os_tag = builtin.target.os.tag,
|
||||
+ };
|
||||
+
|
||||
+
|
||||
+
|
||||
var graph: std.Build.Graph = .{
|
||||
.arena = arena,
|
||||
.cache = .{
|
||||
@@ -78,8 +86,8 @@
|
||||
.global_cache_root = global_cache_directory,
|
||||
.zig_lib_directory = zig_lib_directory,
|
||||
.host = .{
|
||||
- .query = .{},
|
||||
- .result = try std.zig.system.resolveTargetQuery(.{}),
|
||||
+ .query = host_query,
|
||||
+ .result = try std.zig.system.resolveTargetQuery(host_query),
|
||||
},
|
||||
.time_report = false,
|
||||
};
|
||||
10
skip-localhost-test.patch
Normal file
10
skip-localhost-test.patch
Normal file
@@ -0,0 +1,10 @@
|
||||
--- a/lib/std/net/test.zig 2023-08-20 22:44:38.000000000 +1000
|
||||
+++ b/lib/std/net/test.zig 2023-08-21 17:03:51.996044571 +1000
|
||||
@@ -119,6 +119,7 @@
|
||||
{
|
||||
const localhost_v4 = try net.Address.parseIp("127.0.0.1", 80);
|
||||
const localhost_v6 = try net.Address.parseIp("::2", 80);
|
||||
+ if (true) return error.SkipZigTest;
|
||||
|
||||
const result = try net.getAddressList(testing.allocator, "localhost", 80);
|
||||
defer result.deinit();
|
||||
3
vendor.tar.zst
Normal file
3
vendor.tar.zst
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e31de34238c701f65e50cf6d3c2bacaa5081e5147835670b6d425cf808b7aeb9
|
||||
size 3258706
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a6744ef84b6716f976dad923075b2f54dc4f785f200ae6c8ea07997bd9d9bd9a
|
||||
size 17099152
|
||||
3
zig-0.15.1.tar.xz
Normal file
3
zig-0.15.1.tar.xz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:816c0303ab313f59766ce2097658c9fff7fafd1504f61f80f9507cd11652865f
|
||||
size 21359884
|
||||
58
zig.changes
58
zig.changes
@@ -1,3 +1,61 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 24 10:43:53 UTC 2025 - Mia Herkt <mia@0x0.st>
|
||||
|
||||
- Add RPM 4.20 declarative build system macros
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 16 13:56:45 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||
|
||||
- Remove unused build requires
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 27 14:05:32 UTC 2025 - Soc Virnyl Estela <uncomfyhalomacro@opensuse.org>
|
||||
|
||||
- Update to version 0.15.1:
|
||||
** CHANGELOG TOO LONG **
|
||||
See https://ziglang.org/download/0.15.1/release-notes.html
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 31 03:58:41 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Add reproducible.patch to fix reproducible-builds issues (boo#1100677)
|
||||
https://github.com/ziglang/zig/issues/22663
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jun 23 08:41:29 UTC 2024 - Soc Virnyl Estela <obs@uncomfyhalomacro.pl>
|
||||
|
||||
- Cleanup specfile
|
||||
- Workaround for test
|
||||
* add vendored cache dependencies.
|
||||
- Fix check section for tests
|
||||
- Add -DZIG_USE_LLVM_CONFIG=ON option
|
||||
- Add patch skip-localhost-test.patch
|
||||
- Add liburing-devel for test suites
|
||||
- Set mold as linker. Efficient and fast at utilising computer resources
|
||||
unlike GNU ld.
|
||||
- Enable tests
|
||||
- remove some outdated comments in specfile
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 12 11:45:34 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||
|
||||
- Reduce constraints
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 7 17:56:48 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
|
||||
|
||||
- Update patchsets for llvm18 changes
|
||||
./0000-remove-lld-in-cmakelist.patch
|
||||
./0001-invoke-lld.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 7 17:35:24 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
|
||||
|
||||
- Update to version 0.13.0:
|
||||
** CHANGELOG TOO LONG **
|
||||
See https://ziglang.org/download/0.13.0/release-notes.html
|
||||
* Release focuses more on the LLVM18 support
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat May 4 15:13:58 UTC 2024 - Michael Burge <michael.burge77@gmail.com>
|
||||
|
||||
|
||||
80
zig.spec
80
zig.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package zig
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -22,7 +22,7 @@
|
||||
%bcond_without test
|
||||
|
||||
Name: zig
|
||||
Version: 0.12.0
|
||||
Version: 0.15.1
|
||||
Release: 0
|
||||
Summary: Compiler for the Zig language
|
||||
License: MIT
|
||||
@@ -30,23 +30,38 @@ Group: Development/Languages/Other
|
||||
URL: https://ziglang.org/
|
||||
Source0: https://ziglang.org/download/%{version}/%{name}-%{version}.tar.xz
|
||||
Source1: macros.%{name}
|
||||
Source2: zig-rpmlintrc
|
||||
# The vendored tarball is for tests. This contains the
|
||||
# cached deps. See https://en.opensuse.org/Zig#Packaging
|
||||
Source2: vendor.tar.zst
|
||||
Source3: zig-rpmlintrc
|
||||
Patch0: 0000-remove-lld-in-cmakelist.patch
|
||||
Patch1: 0001-invoke-lld.patch
|
||||
Patch2: 0002-no-lld-libs-and-includes.patch
|
||||
BuildRequires: clang17
|
||||
BuildRequires: clang17-devel
|
||||
# Just copying from Archlinux. Thanks
|
||||
Patch3: https://gitlab.archlinux.org/archlinux/packaging/packages/zig/-/raw/main/skip-localhost-test.patch
|
||||
# to improve reproducible-builds -- https://github.com/ziglang/zig/pull/22673
|
||||
Patch4: reproducible.patch
|
||||
BuildRequires: clang20
|
||||
BuildRequires: clang20-devel
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc
|
||||
BuildRequires: elfutils
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: glibc
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: glibc-devel-32bit
|
||||
BuildRequires: help2man
|
||||
BuildRequires: lld17
|
||||
BuildRequires: llvm17-devel
|
||||
BuildRequires: libelf-devel
|
||||
BuildRequires: liburing-devel
|
||||
BuildRequires: lld20
|
||||
BuildRequires: llvm20-devel
|
||||
BuildRequires: mold
|
||||
BuildRequires: ninja
|
||||
BuildRequires: zlib-devel
|
||||
Requires: lld17
|
||||
BuildRequires: zstd
|
||||
BuildRequires: (gcc13-c++ if gcc13)
|
||||
BuildRequires: (gcc14-c++ if gcc14)
|
||||
BuildRequires: (gcc15-c++ if gcc15)
|
||||
Requires: lld20
|
||||
|
||||
# llvm-config is missing targets for ppc and arm architectures.
|
||||
# ExcludeArch: ppc64 ppc64le %%arm %%ix86
|
||||
@@ -85,23 +100,48 @@ This package contains common RPM macros for %{name}.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
%autosetup -n %{name}-%{version} -p1 -a2
|
||||
|
||||
%build
|
||||
# NOTE: ix86 architectures will still fail to build due to OOM. Once 0.11.x lands,
|
||||
# this won't be an issue anymore since that version does not use much memory
|
||||
# CMAKE on Tumbleweed has the CMAKE_LINKER_TYPE option
|
||||
%if 0%{?suse_version} > 1600
|
||||
|
||||
%cmake \
|
||||
%ifarch aarch64 s390x
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
%endif
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_C_COMPILER="clang-17" \
|
||||
-DCMAKE_CXX_COMPILER="clang++-17" \
|
||||
-DCMAKE_C_COMPILER="clang-20" \
|
||||
-DCMAKE_CXX_COMPILER="clang++-20" \
|
||||
-DCMAKE_LINKER_TYPE=MOLD \
|
||||
-DZIG_SHARED_LLVM=On \
|
||||
-DZIG_USE_LLVM_CONFIG=ON \
|
||||
-DZIG_TARGET_MCPU="baseline" \
|
||||
-DZIG_VERSION:STRING="%{version}"
|
||||
|
||||
%else
|
||||
|
||||
%cmake \
|
||||
%ifarch aarch64 s390x
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
%endif
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_C_COMPILER="clang-20" \
|
||||
-DCMAKE_CXX_COMPILER="clang++-20" \
|
||||
-DZIG_SHARED_LLVM=On \
|
||||
-DZIG_USE_LLVM_CONFIG=ON \
|
||||
-DZIG_TARGET_MCPU="baseline" \
|
||||
-DZIG_VERSION:STRING="%{version}"
|
||||
|
||||
%endif
|
||||
|
||||
# Workaround since CMAKE on Leap does not have
|
||||
# the CMAKE_LINKER_TYPE option
|
||||
%if 0%{?suse_version} > 1600
|
||||
%cmake_build
|
||||
%else
|
||||
mold -run %cmake_build
|
||||
%endif
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
@@ -115,6 +155,18 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmmacrodir}/macros.%{
|
||||
|
||||
mv -v doc/langref.html.in doc/langref.html
|
||||
|
||||
%if 0%{?with test}
|
||||
%check
|
||||
./build/stage3/bin/zig build test -Dconfig_h=build/config.h \
|
||||
-Dcpu=baseline \
|
||||
-Dskip-debug \
|
||||
-Dskip-release-safe \
|
||||
-Dskip-release-small \
|
||||
-Dstatic-llvm=false \
|
||||
-Denable-llvm=true \
|
||||
-Dskip-non-native=true
|
||||
%endif
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%{_bindir}/zig
|
||||
|
||||
Reference in New Issue
Block a user