* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
@ 2020-09-21 1:49 ` ericonr
2020-09-21 1:55 ` jjsullivan5196
` (49 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 1:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 333 bytes --]
New review comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r491763418
Comment:
Is it still that limited? :/
Also, if the final result for `x86_64` doesn't change, you don't need to revbump, since changes to the template will trigger the build for aarch64 anyway.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
2020-09-21 1:49 ` [PR REVIEW] " ericonr
@ 2020-09-21 1:55 ` jjsullivan5196
2020-09-21 1:56 ` jjsullivan5196
` (48 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 1:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
New review comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r491764478
Comment:
@ericonr I only tested aarch64, but I guess travis will test most stuff. Do you think I should change `archs` and see what happens?
Also, I'll decrease the revbump along with it.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
2020-09-21 1:49 ` [PR REVIEW] " ericonr
2020-09-21 1:55 ` jjsullivan5196
@ 2020-09-21 1:56 ` jjsullivan5196
2020-09-21 2:29 ` ericonr
` (47 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 1:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 386 bytes --]
New review comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r491764478
Comment:
@ericonr I only tested aarch64, but I guess travis will test most stuff. Do you think I should change `archs` and see what happens?
Also, I'll decrease the revbump along with it. The template is no different for non-cross x86_64.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (2 preceding siblings ...)
2020-09-21 1:56 ` jjsullivan5196
@ 2020-09-21 2:29 ` ericonr
2020-09-21 9:38 ` [PR PATCH] [Updated] " jjsullivan5196
` (46 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 2:29 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
New review comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r491769703
Comment:
I think it'd make sense. Ideally also test programs built using it.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR PATCH] [Updated] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (3 preceding siblings ...)
2020-09-21 2:29 ` ericonr
@ 2020-09-21 9:38 ` jjsullivan5196
2020-09-21 9:39 ` [PR REVIEW] " jjsullivan5196
` (45 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 9:38 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
There is an updated pull request by jjsullivan5196 against master on the void-packages repository
https://github.com/jjsullivan5196/void-packages zig-cross
https://github.com/void-linux/void-packages/pull/25004
zig: enable cross-compile support
Closes #24959
A patch file from https://github.com/void-linux/void-packages/pull/25004.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zig-cross-25004.patch --]
[-- Type: text/x-diff, Size: 4252 bytes --]
From b2ab72cfafafd939f70bb4cb639508958270e3ad Mon Sep 17 00:00:00 2001
From: John Sullivan <jsullivan@csumb.edu>
Date: Thu, 17 Sep 2020 14:14:59 -0700
Subject: [PATCH] zig: enable cross-compile support
---
...-to-use-llvm-config-to-find-cross-ta.patch | 39 +++++++++++++++
srcpkgs/zig/template | 50 ++++++++++++++++++-
2 files changed, 87 insertions(+), 2 deletions(-)
create mode 100644 srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
diff --git a/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch b/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
new file mode 100644
index 00000000000..04a4fbd4d19
--- /dev/null
+++ b/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
@@ -0,0 +1,39 @@
+From 314c780371c3bfa3680445cec67f649800c6942b Mon Sep 17 00:00:00 2001
+From: John Sullivan <jsullivan@csumb.edu>
+Date: Sun, 20 Sep 2020 14:55:43 -0700
+Subject: [PATCH] cmake: add option to use llvm-config to find cross-target
+ llvm deps
+
+---
+ CMakeLists.txt | 1 +
+ cmake/Findllvm.cmake | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 27bc6a04f..ee323cce0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -66,6 +66,7 @@ option(ZIG_FORCE_EXTERNAL_LLD "does nothing" OFF)
+ set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for")
+ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries for")
+ set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
++set(ZIG_PREFER_LLVM_CONFIG off CACHE BOOL "(when cross compiling) use llvm-config to find target llvm dependencies if needed")
+
+ find_package(llvm)
+ find_package(clang)
+diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
+index 7d6a4b04d..314367b7b 100644
+--- a/cmake/Findllvm.cmake
++++ b/cmake/Findllvm.cmake
+@@ -7,7 +7,7 @@
+ # LLVM_LIBRARIES
+ # LLVM_LIBDIRS
+
+-if("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
++if(("${ZIG_TARGET_TRIPLE}" STREQUAL "native") OR ZIG_PREFER_LLVM_CONFIG)
+ find_program(LLVM_CONFIG_EXE
+ NAMES llvm-config-10 llvm-config-10.0 llvm-config100 llvm-config10 llvm-config
+ PATHS
+--
+2.28.0
+
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index c3ab8e62a11..2689a7193ef 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -2,7 +2,7 @@
pkgname=zig
version=0.6.0
revision=1
-archs="x86_64*"
+archs="x86_64* i686* aarch64* arm*"
build_style=cmake
makedepends="clang llvm10 lld-devel"
short_desc="Programming language designed for robustness, optimality, and clarity"
@@ -11,9 +11,55 @@ license="MIT"
homepage="https://ziglang.org/"
distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
checksum=5d167dc19354282dd35dd17b38e99e1763713b9be8a4ba9e9e69284e059e7204
+patch_args="-Np1"
nopie=yes
-nocross=yes
+
+if [ "${CROSS_BUILD}" ]; then
+ # TODO _mcpu might be a candidate for cross-profiles
+ #
+ # Set _cross_triple and _mcpu for target triples that are not directly
+ # available in zig's targets (run `zig targets` to get all triples/mcpu
+ # options)
+ case "${XBPS_CROSS_TRIPLET}" in
+ armv7l*)
+ _cross_triple="arm-linux-${XBPS_CROSS_TRIPLET#arm*-linux-*}"
+ _mcpu="generic+v7a"
+ ;;
+ i686*)
+ _cross_triple="i386-linux-${XBPS_CROSS_TRIPLET#i686*-linux-*}"
+ _mcpu="baseline"
+ ;;
+ *)
+ _cross_triple="${XBPS_CROSS_TRIPLET}"
+ _mcpu="baseline"
+ ;;
+ esac
+
+ hostmakedepends="zig llvm10"
+ configure_args+="
+ -DZIG_PREFER_LLVM_CONFIG=on
+ -DZIG_TARGET_TRIPLE=${_cross_triple}
+ -DZIG_TARGET_MCPU=${_mcpu}
+ -DZIG_EXECUTABLE='/usr/bin/zig'"
+fi
+
+pre_configure() {
+ local _llvm_config
+
+ # When cross-compiling, need to re-write the host root provided by llvm-config
+ # to the cross-target root
+ if [ "${CROSS_BUILD}" ]; then
+ _llvm_config="${XBPS_WRAPPERDIR}/llvm-config"
+
+ cat > "${_llvm_config}" <<-EOF
+ #!/bin/sh
+ /usr/bin/llvm-config "\$@" | sed 's,/usr,${XBPS_CROSS_BASE}/usr,g'
+ EOF
+ chmod +x "${_llvm_config}"
+ fi
+}
post_install() {
+ # vmove zig for great justice
vlicense LICENSE
}
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (4 preceding siblings ...)
2020-09-21 9:38 ` [PR PATCH] [Updated] " jjsullivan5196
@ 2020-09-21 9:39 ` jjsullivan5196
2020-09-21 9:57 ` jjsullivan5196
` (44 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 9:39 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
New review comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r491909743
Comment:
Did as much as I could about this, I'll give more details in further comments.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (5 preceding siblings ...)
2020-09-21 9:39 ` [PR REVIEW] " jjsullivan5196
@ 2020-09-21 9:57 ` jjsullivan5196
2020-09-21 10:14 ` [PR PATCH] [Updated] " jjsullivan5196
` (43 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 9:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 636 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696016234
Comment:
I tested cross-compiling for void's supported targets. All of x64, i686, and arm/aarch64 are working. However, I couldn't get cross-builds working for mips or ppc, and I don't have the hardware to see if they'll compile natively. I'm not sure where the problem is at this point, but I recorded the build logs for all of them and have them [attached](https://github.com/void-linux/void-packages/files/5254628/build-logs.tar.gz).
@ericonr All ready for you if you still want to try armv6
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR PATCH] [Updated] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (6 preceding siblings ...)
2020-09-21 9:57 ` jjsullivan5196
@ 2020-09-21 10:14 ` jjsullivan5196
2020-09-21 12:43 ` ericonr
` (42 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 10:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
There is an updated pull request by jjsullivan5196 against master on the void-packages repository
https://github.com/jjsullivan5196/void-packages zig-cross
https://github.com/void-linux/void-packages/pull/25004
zig: enable cross-compile support
Closes #24959
A patch file from https://github.com/void-linux/void-packages/pull/25004.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zig-cross-25004.patch --]
[-- Type: text/x-diff, Size: 4221 bytes --]
From 352f3585ffd2c7352fdae73d2760614c833dbeaf Mon Sep 17 00:00:00 2001
From: John Sullivan <jsullivan@csumb.edu>
Date: Thu, 17 Sep 2020 14:14:59 -0700
Subject: [PATCH] zig: enable cross-compile support
---
...-to-use-llvm-config-to-find-cross-ta.patch | 39 ++++++++++++++
srcpkgs/zig/template | 52 ++++++++++++++++++-
2 files changed, 89 insertions(+), 2 deletions(-)
create mode 100644 srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
diff --git a/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch b/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
new file mode 100644
index 00000000000..04a4fbd4d19
--- /dev/null
+++ b/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
@@ -0,0 +1,39 @@
+From 314c780371c3bfa3680445cec67f649800c6942b Mon Sep 17 00:00:00 2001
+From: John Sullivan <jsullivan@csumb.edu>
+Date: Sun, 20 Sep 2020 14:55:43 -0700
+Subject: [PATCH] cmake: add option to use llvm-config to find cross-target
+ llvm deps
+
+---
+ CMakeLists.txt | 1 +
+ cmake/Findllvm.cmake | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 27bc6a04f..ee323cce0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -66,6 +66,7 @@ option(ZIG_FORCE_EXTERNAL_LLD "does nothing" OFF)
+ set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for")
+ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries for")
+ set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
++set(ZIG_PREFER_LLVM_CONFIG off CACHE BOOL "(when cross compiling) use llvm-config to find target llvm dependencies if needed")
+
+ find_package(llvm)
+ find_package(clang)
+diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
+index 7d6a4b04d..314367b7b 100644
+--- a/cmake/Findllvm.cmake
++++ b/cmake/Findllvm.cmake
+@@ -7,7 +7,7 @@
+ # LLVM_LIBRARIES
+ # LLVM_LIBDIRS
+
+-if("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
++if(("${ZIG_TARGET_TRIPLE}" STREQUAL "native") OR ZIG_PREFER_LLVM_CONFIG)
+ find_program(LLVM_CONFIG_EXE
+ NAMES llvm-config-10 llvm-config-10.0 llvm-config100 llvm-config10 llvm-config
+ PATHS
+--
+2.28.0
+
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index c3ab8e62a11..157b787f6f8 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -2,7 +2,7 @@
pkgname=zig
version=0.6.0
revision=1
-archs="x86_64*"
+archs="x86_64* i686* aarch64* arm*"
build_style=cmake
makedepends="clang llvm10 lld-devel"
short_desc="Programming language designed for robustness, optimality, and clarity"
@@ -11,9 +11,57 @@ license="MIT"
homepage="https://ziglang.org/"
distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
checksum=5d167dc19354282dd35dd17b38e99e1763713b9be8a4ba9e9e69284e059e7204
+patch_args="-Np1"
nopie=yes
-nocross=yes
+
+if [ "${CROSS_BUILD}" ]; then
+ # TODO _mcpu might be a candidate for cross-profiles
+ #
+ # Set _cross_triple and _mcpu for target triples that are not directly
+ # available in zig's targets.
+ #
+ # List targets with: zig targets
+
+ case "${XBPS_CROSS_TRIPLET}" in
+ armv7l*)
+ _cross_triple="arm-linux-${XBPS_CROSS_TRIPLET#arm*-linux-*}"
+ _mcpu="generic+v7a"
+ ;;
+ i686*)
+ _cross_triple="i386-linux-${XBPS_CROSS_TRIPLET#i686*-linux-*}"
+ _mcpu="baseline"
+ ;;
+ *)
+ _cross_triple="${XBPS_CROSS_TRIPLET}"
+ _mcpu="baseline"
+ ;;
+ esac
+
+ hostmakedepends="zig llvm10"
+ configure_args+="
+ -DZIG_PREFER_LLVM_CONFIG=on
+ -DZIG_TARGET_TRIPLE=${_cross_triple}
+ -DZIG_TARGET_MCPU=${_mcpu}
+ -DZIG_EXECUTABLE='/usr/bin/zig'"
+fi
+
+pre_configure() {
+ local _llvm_config
+
+ # When cross-compiling, need to re-write the host root provided by llvm-config
+ # to the cross-target root
+ if [ "${CROSS_BUILD}" ]; then
+ _llvm_config="${XBPS_WRAPPERDIR}/llvm-config"
+
+ cat > "${_llvm_config}" <<-EOF
+ #!/bin/sh
+ /usr/bin/llvm-config "\$@" | sed 's,/usr,${XBPS_CROSS_BASE}/usr,g'
+ EOF
+ chmod +x "${_llvm_config}"
+ fi
+}
post_install() {
+ # vmove zig for great justice
vlicense LICENSE
}
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (7 preceding siblings ...)
2020-09-21 10:14 ` [PR PATCH] [Updated] " jjsullivan5196
@ 2020-09-21 12:43 ` ericonr
2020-09-21 14:28 ` ericonr
` (41 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 12:43 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696088898
Comment:
Tagging interested parties on the platform side: @pullmoll and @q66
And thanks, I will try to build it!
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (8 preceding siblings ...)
2020-09-21 12:43 ` ericonr
@ 2020-09-21 14:28 ` ericonr
2020-09-21 14:29 ` ericonr
` (40 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 14:28 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 230 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696152818
Comment:
I get an illegal instruction error, code 132. Just running `zig` is enough to trigger it.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (9 preceding siblings ...)
2020-09-21 14:28 ` ericonr
@ 2020-09-21 14:29 ` ericonr
2020-09-21 19:07 ` ericonr
` (39 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 14:29 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 240 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696152818
Comment:
I get an illegal instruction error, return code is 132. Just running `zig` is enough to trigger it.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (10 preceding siblings ...)
2020-09-21 14:29 ` ericonr
@ 2020-09-21 19:07 ` ericonr
2020-09-21 19:16 ` ericonr
` (38 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 19:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 241 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696312490
Comment:
The build is populating `/tmp` with artifacts. `zig` should probably be pointed elsewhere for cache.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (11 preceding siblings ...)
2020-09-21 19:07 ` ericonr
@ 2020-09-21 19:16 ` ericonr
2020-09-21 19:21 ` [PR REVIEW] " ericonr
` (37 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 19:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696312490
Comment:
The build is populating `/tmp` with artifacts. `zig` should probably be pointed elsewhere for cache. (either inside builddir or a cache in hostdir, if it makes sense)
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (12 preceding siblings ...)
2020-09-21 19:16 ` ericonr
@ 2020-09-21 19:21 ` ericonr
2020-09-21 19:32 ` ericonr
` (36 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 19:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 169 bytes --]
New review comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r492291908
Comment:
Why is this necessary?
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (13 preceding siblings ...)
2020-09-21 19:21 ` [PR REVIEW] " ericonr
@ 2020-09-21 19:32 ` ericonr
2020-09-21 19:35 ` ericonr
` (35 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 19:32 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 950 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696325491
Comment:
Partial diff, the `v6k` part is potentially sketchy.
```diff
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 157b787f6f..10ea3be846 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -22,13 +22,17 @@ if [ "${CROSS_BUILD}" ]; then
#
# List targets with: zig targets
- case "${XBPS_CROSS_TRIPLET}" in
+ case "${XBPS_TARGET_MACHINE}" in
+ armv6l*)
+ _cross_triple="${XBPS_CROSS_TRIPLET}"
+ _mcpu="generic+v6k"
+ ;;
armv7l*)
- _cross_triple="arm-linux-${XBPS_CROSS_TRIPLET#arm*-linux-*}"
+ _cross_triple="${XBPS_CROSS_TRIPLET/armv7l/arm}"
_mcpu="generic+v7a"
;;
i686*)
- _cross_triple="i386-linux-${XBPS_CROSS_TRIPLET#i686*-linux-*}"
+ _cross_triple="${XBPS_CROSS_TRIPLET/i686/i386}"
_mcpu="baseline"
;;
*)
```
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (14 preceding siblings ...)
2020-09-21 19:32 ` ericonr
@ 2020-09-21 19:35 ` ericonr
2020-09-21 20:31 ` jjsullivan5196
` (34 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 19:35 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696327499
Comment:
Hmm
```
[ericonr@voidzero test]$ zig build-exe hello.zig
Semantic Analysis [667/867] ./hello.zig:4:38: error: no member named 'writer' in struct 'std.fs.file.File'
const stdout = std.io.getStdOut().writer();
^
/usr/lib/zig/std/start.zig:253:40: note: referenced here
const result = root.main() catch |err| {
^
```
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (15 preceding siblings ...)
2020-09-21 19:35 ` ericonr
@ 2020-09-21 20:31 ` jjsullivan5196
2020-09-21 20:34 ` [PR REVIEW] " jjsullivan5196
` (33 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 20:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 290 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696357459
Comment:
@ericonr would this work?
```zig
const debug = @import("std").debug;
pub fn main() void {
debug.warn("Hello, world\n", .{});
}
```
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (16 preceding siblings ...)
2020-09-21 20:31 ` jjsullivan5196
@ 2020-09-21 20:34 ` jjsullivan5196
2020-09-21 20:35 ` jjsullivan5196
` (32 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 20:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 325 bytes --]
New review comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r492330062
Comment:
Some of zigs targets don't exactly match up with gcc triplets. In this case, all of arm32 is under `arm-...` with the different subarchs identified via the mcpu parameter.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (17 preceding siblings ...)
2020-09-21 20:34 ` [PR REVIEW] " jjsullivan5196
@ 2020-09-21 20:35 ` jjsullivan5196
2020-09-21 20:43 ` jjsullivan5196
` (31 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 20:35 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 408 bytes --]
New review comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r492330062
Comment:
Some of zigs targets don't exactly match up with gcc triplets. In this case, all of arm32 is under `arm-...` with the different subarchs identified via the mcpu parameter. So I'm trimming cross triplet to get the abi tag, then setting mcpu appropriately.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (18 preceding siblings ...)
2020-09-21 20:35 ` jjsullivan5196
@ 2020-09-21 20:43 ` jjsullivan5196
2020-09-21 22:16 ` ericonr
` (30 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 20:43 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696357459
Comment:
@ericonr would this work?
```zig
const debug = @import("std").debug;
pub fn main() void {
debug.warn("Hello, world\n", .{});
}
```
Also, I just remembered I have a rpi zero w I can try some of this on. I'll see if it'll work.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (19 preceding siblings ...)
2020-09-21 20:43 ` jjsullivan5196
@ 2020-09-21 22:16 ` ericonr
2020-09-21 22:40 ` [PR REVIEW] " ericonr
` (29 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 22:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 156 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696407653
Comment:
That does work.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (20 preceding siblings ...)
2020-09-21 22:16 ` ericonr
@ 2020-09-21 22:40 ` ericonr
2020-09-21 22:52 ` ericonr
` (28 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 22:40 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 244 bytes --]
New review comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r492385919
Comment:
Fair enough. I think the substitution I'm doing below is a bit neater, if you'd like to use that.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (21 preceding siblings ...)
2020-09-21 22:40 ` [PR REVIEW] " ericonr
@ 2020-09-21 22:52 ` ericonr
2020-09-21 23:10 ` jjsullivan5196
` (27 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-21 22:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696327499
Comment:
Hmm
```
[ericonr@voidzero test]$ zig build-exe hello.zig
Semantic Analysis [667/867] ./hello.zig:4:38: error: no member named 'writer' in struct 'std.fs.file.File'
const stdout = std.io.getStdOut().writer();
^
/usr/lib/zig/std/start.zig:253:40: note: referenced here
const result = root.main() catch |err| {
^
```
---
This was on me, I was using an example from master. Example from 0.6.0 just worked.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (22 preceding siblings ...)
2020-09-21 22:52 ` ericonr
@ 2020-09-21 23:10 ` jjsullivan5196
2020-09-22 2:01 ` [PR PATCH] [Updated] " jjsullivan5196
` (26 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-21 23:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696427090
Comment:
> The build is populating `/tmp` with artifacts. `zig` should probably be pointed elsewhere for cache. (either inside builddir or a cache in hostdir, if it makes sense)
I've seen ccache options in the cmake files, I'll take a look at this.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR PATCH] [Updated] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (23 preceding siblings ...)
2020-09-21 23:10 ` jjsullivan5196
@ 2020-09-22 2:01 ` jjsullivan5196
2020-09-22 2:04 ` jjsullivan5196
` (25 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-22 2:01 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
There is an updated pull request by jjsullivan5196 against master on the void-packages repository
https://github.com/jjsullivan5196/void-packages zig-cross
https://github.com/void-linux/void-packages/pull/25004
zig: enable cross-compile support
Closes #24959
A patch file from https://github.com/void-linux/void-packages/pull/25004.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zig-cross-25004.patch --]
[-- Type: text/x-diff, Size: 4476 bytes --]
From 69eed07c025531e3463b8e99a5d3a9c07a0d9b37 Mon Sep 17 00:00:00 2001
From: John Sullivan <jsullivan@csumb.edu>
Date: Thu, 17 Sep 2020 14:14:59 -0700
Subject: [PATCH] zig: enable cross-compile support
---
...-to-use-llvm-config-to-find-cross-ta.patch | 39 ++++++++++++
srcpkgs/zig/template | 60 ++++++++++++++++++-
2 files changed, 97 insertions(+), 2 deletions(-)
create mode 100644 srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
diff --git a/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch b/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
new file mode 100644
index 00000000000..04a4fbd4d19
--- /dev/null
+++ b/srcpkgs/zig/patches/0001-cmake-add-option-to-use-llvm-config-to-find-cross-ta.patch
@@ -0,0 +1,39 @@
+From 314c780371c3bfa3680445cec67f649800c6942b Mon Sep 17 00:00:00 2001
+From: John Sullivan <jsullivan@csumb.edu>
+Date: Sun, 20 Sep 2020 14:55:43 -0700
+Subject: [PATCH] cmake: add option to use llvm-config to find cross-target
+ llvm deps
+
+---
+ CMakeLists.txt | 1 +
+ cmake/Findllvm.cmake | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 27bc6a04f..ee323cce0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -66,6 +66,7 @@ option(ZIG_FORCE_EXTERNAL_LLD "does nothing" OFF)
+ set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for")
+ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries for")
+ set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
++set(ZIG_PREFER_LLVM_CONFIG off CACHE BOOL "(when cross compiling) use llvm-config to find target llvm dependencies if needed")
+
+ find_package(llvm)
+ find_package(clang)
+diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
+index 7d6a4b04d..314367b7b 100644
+--- a/cmake/Findllvm.cmake
++++ b/cmake/Findllvm.cmake
+@@ -7,7 +7,7 @@
+ # LLVM_LIBRARIES
+ # LLVM_LIBDIRS
+
+-if("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
++if(("${ZIG_TARGET_TRIPLE}" STREQUAL "native") OR ZIG_PREFER_LLVM_CONFIG)
+ find_program(LLVM_CONFIG_EXE
+ NAMES llvm-config-10 llvm-config-10.0 llvm-config100 llvm-config10 llvm-config
+ PATHS
+--
+2.28.0
+
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index c3ab8e62a11..f8343f9a27c 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -2,7 +2,8 @@
pkgname=zig
version=0.6.0
revision=1
-archs="x86_64*"
+archs="x86_64* i686* aarch64* armv6l* armv7l*"
+wrksrc="${pkgname}-${version}"
build_style=cmake
makedepends="clang llvm10 lld-devel"
short_desc="Programming language designed for robustness, optimality, and clarity"
@@ -11,9 +12,64 @@ license="MIT"
homepage="https://ziglang.org/"
distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
checksum=5d167dc19354282dd35dd17b38e99e1763713b9be8a4ba9e9e69284e059e7204
+patch_args="-Np1"
nopie=yes
-nocross=yes
+
+# This is needed to prevent zig from dumping its global cache in /tmp
+export XDG_CACHE_HOME="${XBPS_BUILDDIR}/${wrksrc}/build/.cache"
+
+if [ "${CROSS_BUILD}" ]; then
+ # TODO _mcpu might be a candidate for cross-profiles
+ #
+ # Set _cross_triple and _mcpu for target triples that are not directly
+ # available in zig's targets.
+ #
+ # List targets and mcpu options with: zig targets
+
+ case "${XBPS_TARGET_MACHINE}" in
+ armv6l*)
+ _cross_triple="${XBPS_CROSS_TRIPLET}"
+ _mcpu="generic+v6k"
+ ;;
+ armv7l*)
+ _cross_triple="${XBPS_CROSS_TRIPLET/armv7l/arm}"
+ _mcpu="generic+v7a"
+ ;;
+ i686*)
+ _cross_triple="${XBPS_CROSS_TRIPLET/i686/i386}"
+ _mcpu="baseline"
+ ;;
+ *)
+ _cross_triple="${XBPS_CROSS_TRIPLET}"
+ _mcpu="baseline"
+ ;;
+ esac
+
+ hostmakedepends="zig llvm10"
+ configure_args+="
+ -DZIG_PREFER_LLVM_CONFIG=on
+ -DZIG_TARGET_TRIPLE=${_cross_triple}
+ -DZIG_TARGET_MCPU=${_mcpu}
+ -DZIG_EXECUTABLE='/usr/bin/zig'"
+fi
+
+pre_configure() {
+ local _llvm_config
+
+ # When cross-compiling, need to re-write the host root provided by llvm-config
+ # to the cross-target root
+ if [ "${CROSS_BUILD}" ]; then
+ _llvm_config="${XBPS_WRAPPERDIR}/llvm-config"
+
+ cat > "${_llvm_config}" <<-EOF
+ #!/bin/sh
+ /usr/bin/llvm-config "\$@" | sed 's,/usr,${XBPS_CROSS_BASE}/usr,g'
+ EOF
+ chmod +x "${_llvm_config}"
+ fi
+}
post_install() {
+ # vmove zig for great justice
vlicense LICENSE
}
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (24 preceding siblings ...)
2020-09-22 2:01 ` [PR PATCH] [Updated] " jjsullivan5196
@ 2020-09-22 2:04 ` jjsullivan5196
2020-09-22 2:05 ` [PR REVIEW] " jjsullivan5196
` (24 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-22 2:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696472167
Comment:
I got the latest findings reflected in the template, the enabled archs should build+run properly, and zig won't dump its cache in `/tmp` anymore. I also restricted arm32 to v6 and up, since `_mcpu="generic+v5te"` emitted this error:
```
<inline asm>:1:2: error: instruction requires: armv6k
yield
^
LLVM ERROR: Error parsing inline asm
```
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR REVIEW] zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (25 preceding siblings ...)
2020-09-22 2:04 ` jjsullivan5196
@ 2020-09-22 2:05 ` jjsullivan5196
2020-09-22 2:07 ` ericonr
` (23 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-22 2:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 174 bytes --]
New review comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#discussion_r492439385
Comment:
cleaned this part up
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (26 preceding siblings ...)
2020-09-22 2:05 ` [PR REVIEW] " jjsullivan5196
@ 2020-09-22 2:07 ` ericonr
2020-09-22 2:23 ` jjsullivan5196
` (22 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-22 2:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 186 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696472905
Comment:
That's the error I got with `generic+v6` too.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (27 preceding siblings ...)
2020-09-22 2:07 ` ericonr
@ 2020-09-22 2:23 ` jjsullivan5196
2020-09-28 21:24 ` pullmoll
` (21 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-22 2:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-696427090
Comment:
> The build is populating `/tmp` with artifacts. `zig` should probably be pointed elsewhere for cache. (either inside builddir or a cache in hostdir, if it makes sense)
~I've seen ccache options in the cmake files, I'll take a look at this.~
@ericonr had it right, this is zig's internal cache. Fixed it so it doesn't pollute the masterdir.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (28 preceding siblings ...)
2020-09-22 2:23 ` jjsullivan5196
@ 2020-09-28 21:24 ` pullmoll
2020-09-30 5:25 ` jjsullivan5196
` (20 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: pullmoll @ 2020-09-28 21:24 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 380 bytes --]
New comment by pullmoll on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-700289518
Comment:
In `qt5-webengine` we replace `yield` with `nop` and this seems to be sufficient. Of course `yield` would force a task switch for SMP, while a `nop` does not. But then I think there are no `armv5tel` multi-cores and few, if any, `armv6l`?
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (29 preceding siblings ...)
2020-09-28 21:24 ` pullmoll
@ 2020-09-30 5:25 ` jjsullivan5196
2020-09-30 6:26 ` ericonr
` (19 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-09-30 5:25 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-701163571
Comment:
@pullmoll may be simple enough to write a patch to do it then, I'll take a look soon
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (30 preceding siblings ...)
2020-09-30 5:25 ` jjsullivan5196
@ 2020-09-30 6:26 ` ericonr
2020-10-02 16:36 ` Piraty
` (18 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2020-09-30 6:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 243 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-701184620
Comment:
@jjsullivan5196 probably best to just do a sed substitution, like the `qt5-webengine` template does c:
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (31 preceding siblings ...)
2020-09-30 6:26 ` ericonr
@ 2020-10-02 16:36 ` Piraty
2020-10-02 16:39 ` Piraty
` (17 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: Piraty @ 2020-10-02 16:36 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 441 bytes --]
New comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702834965
Comment:
upstream refuses to support cross-building their "stage1 zig" (see: https://github.com/ziglang/zig/pull/4494#issuecomment-587172905).
I propose to add the complete list of supported architectures to`archs=` and let everyone in need of zig on a non x86 platform build it manualy (I guess < 5 users).
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (32 preceding siblings ...)
2020-10-02 16:36 ` Piraty
@ 2020-10-02 16:39 ` Piraty
2020-10-02 16:44 ` q66
` (16 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: Piraty @ 2020-10-02 16:39 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
New comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702834965
Comment:
upstream refuses to support cross-building their "stage1 zig" (see: https://github.com/ziglang/zig/pull/4494#issuecomment-587172905).
I propose to add the complete list of supported architectures to`archs=` and let everyone in need of zig on a non x86 platform build it manualy (I guess < 5 users).
[EDIT] On the other hand, if this PR is ready anyway, who not :1st_place_medal:
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (33 preceding siblings ...)
2020-10-02 16:39 ` Piraty
@ 2020-10-02 16:44 ` q66
2020-10-02 16:47 ` Piraty
` (15 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: q66 @ 2020-10-02 16:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702838807
Comment:
if the cross-compiled artifacts here are not stage1, we definitely should not enable it
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (34 preceding siblings ...)
2020-10-02 16:44 ` q66
@ 2020-10-02 16:47 ` Piraty
2020-10-02 16:55 ` jjsullivan5196
` (14 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: Piraty @ 2020-10-02 16:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 696 bytes --]
New comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702834965
Comment:
upstream refuses to support cross-building their "stage1 zig" (see: https://github.com/ziglang/zig/pull/4494#issuecomment-587172905).
I propose to add the complete list of supported architectures to`archs=` and let everyone in need of zig on a non x86 platform build it manualy (I guess < 5 users).
[EDIT] On the other hand, if this PR is ready anyway, who not :1st_place_medal:
[EDIT2] don't mind my noise, i did not see that upstream contributed to the related issue https://github.com/void-linux/void-packages/issues/24959#issuecomment-695100315
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (35 preceding siblings ...)
2020-10-02 16:47 ` Piraty
@ 2020-10-02 16:55 ` jjsullivan5196
2020-10-02 16:56 ` jjsullivan5196
` (13 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-02 16:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702844167
Comment:
@q66 @Piraty gcc always compiles stage1 in this template, stage1 compiles stage2 for a native build, or stage2 on host compiles stage2 for target. See here for more details https://github.com/ziglang/zig-bootstrap
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (36 preceding siblings ...)
2020-10-02 16:55 ` jjsullivan5196
@ 2020-10-02 16:56 ` jjsullivan5196
2020-10-02 22:04 ` jjsullivan5196
` (12 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-02 16:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702844167
Comment:
@q66 @Piraty gcc always compiles stage1 in this template, stage1 compiles stage2 for a native build, or stage2 on host compiles stage2 for cross target. See here for more details https://github.com/ziglang/zig-bootstrap
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (37 preceding siblings ...)
2020-10-02 16:56 ` jjsullivan5196
@ 2020-10-02 22:04 ` jjsullivan5196
2020-10-03 16:15 ` Piraty
` (11 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-02 22:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 295 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702977358
Comment:
To address some confusion: all artifacts of this template are the stage2 compiler, cross-compiled or not. stage1 is never part of the final output.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (38 preceding siblings ...)
2020-10-02 22:04 ` jjsullivan5196
@ 2020-10-03 16:15 ` Piraty
2020-10-03 16:50 ` jjsullivan5196
` (10 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: Piraty @ 2020-10-03 16:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 963 bytes --]
New comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-703127332
Comment:
@ifreund said on irc (not sure how accurate that is though)
> ifreund: stage2 didn't ship with 0.6.0, real work on it started just after that release
> ifreund: 0.7.0 will ship with an incompleted stage2, the goal is to have a complete stage2 for 0.8.0
> ifreund: 0.7.0 should be released in the month after llvm 11 releases fyi
According to [zig-0.6.0 README](https://github.com/ziglang/zig/blob/0.6.0/README.md):
> Note: Stage 2 compiler is not complete. Beta users of Zig should use the Stage 1 compiler for now.
The way i see it, the current template builds stage1 by just calling `cmake ; make`, stage2 is not part of this template yet.
In the future, this template should be renamed to `zig-bootstrap` or similar and be used by the real stage2 zig (which could then maybe have it's own `build_style=zig`)
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (39 preceding siblings ...)
2020-10-03 16:15 ` Piraty
@ 2020-10-03 16:50 ` jjsullivan5196
2020-10-03 16:50 ` jjsullivan5196
` (9 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-03 16:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702844167
Comment:
@q66 @Piraty gcc always compiles stage1 in this template, stage0 compiles stage1 for a native build, or stage1 on host compiles stage1 for cross target. See here for more details https://github.com/ziglang/zig-bootstrap
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (40 preceding siblings ...)
2020-10-03 16:50 ` jjsullivan5196
@ 2020-10-03 16:50 ` jjsullivan5196
2020-10-03 16:51 ` jjsullivan5196
` (8 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-03 16:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 295 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702977358
Comment:
To address some confusion: all artifacts of this template are the stage1 compiler, cross-compiled or not. stage0 is never part of the final output.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (41 preceding siblings ...)
2020-10-03 16:50 ` jjsullivan5196
@ 2020-10-03 16:51 ` jjsullivan5196
2020-10-03 17:01 ` jjsullivan5196
` (7 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-03 16:51 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-703132068
Comment:
@Piraty my bad, I think I was getting the terms mixed up. I edited my previous comments to be accurate
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (42 preceding siblings ...)
2020-10-03 16:51 ` jjsullivan5196
@ 2020-10-03 17:01 ` jjsullivan5196
2020-10-03 17:07 ` jjsullivan5196
` (6 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-03 17:01 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702977358
Comment:
To address some confusion: all artifacts of this template are the stage1 compiler, cross-compiled or not. stage0 is never part of the final output, stage2 is not attempted.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (43 preceding siblings ...)
2020-10-03 17:01 ` jjsullivan5196
@ 2020-10-03 17:07 ` jjsullivan5196
2020-10-03 17:17 ` Piraty
` (5 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2020-10-03 17:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702844167
Comment:
@q66 @Piraty gcc always compiles stage0 in this template, stage0 compiles stage1 for a native build, or stage1 on host compiles stage1 for cross target. See here for more details https://github.com/ziglang/zig-bootstrap
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (44 preceding siblings ...)
2020-10-03 17:07 ` jjsullivan5196
@ 2020-10-03 17:17 ` Piraty
2021-01-21 17:44 ` ericonr
` (4 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: Piraty @ 2020-10-03 17:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
New comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-702834965
Comment:
upstream refuses to support cross-building their "stage1 zig" (see: https://github.com/ziglang/zig/pull/4494#issuecomment-587172905).
I propose to add the complete list of supported architectures to`archs=` and let everyone in need of zig on a non x86 platform build it manualy (I guess < 5 users).
[EDIT] On the other hand, if this PR is ready anyway, who not :1st_place_medal:
[EDIT2] I did not see that upstream contributed to the related issue https://github.com/void-linux/void-packages/issues/24959#issuecomment-695100315 which seems upstream is now open to cross-building stage1?
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (45 preceding siblings ...)
2020-10-03 17:17 ` Piraty
@ 2021-01-21 17:44 ` ericonr
2021-01-22 2:16 ` jjsullivan5196
` (3 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2021-01-21 17:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-764822190
Comment:
Ping
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (46 preceding siblings ...)
2021-01-21 17:44 ` ericonr
@ 2021-01-22 2:16 ` jjsullivan5196
2021-08-03 3:02 ` ericonr
` (2 subsequent siblings)
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2021-01-22 2:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-765066848
Comment:
@ericonr sorry 😅 I dropped the ball on this one due to other interests. However, I did get a patch merged upstream that should make this easier. At the least, I'll get this rebased so it works with the latest stable zig
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (47 preceding siblings ...)
2021-01-22 2:16 ` jjsullivan5196
@ 2021-08-03 3:02 ` ericonr
2021-08-03 4:22 ` jjsullivan5196
2021-08-03 4:22 ` [PR PATCH] [Closed]: " jjsullivan5196
50 siblings, 0 replies; 52+ messages in thread
From: ericonr @ 2021-08-03 3:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 162 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-891479776
Comment:
@jjsullivan5196 ping?
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (48 preceding siblings ...)
2021-08-03 3:02 ` ericonr
@ 2021-08-03 4:22 ` jjsullivan5196
2021-08-03 4:22 ` [PR PATCH] [Closed]: " jjsullivan5196
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2021-08-03 4:22 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
New comment by jjsullivan5196 on void-packages repository
https://github.com/void-linux/void-packages/pull/25004#issuecomment-891511434
Comment:
@ericonr definitely dead! sorry, should have closed earlier. If anyone wants to take this the rest of the way feel free. [This should make things a little easier, not sure where the upstream is at this point.](https://github.com/ziglang/zig/pull/6387)
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PR PATCH] [Closed]: zig: enable cross-compile support
2020-09-21 1:45 [PR PATCH] zig: enable cross-compile support jjsullivan5196
` (49 preceding siblings ...)
2021-08-03 4:22 ` jjsullivan5196
@ 2021-08-03 4:22 ` jjsullivan5196
50 siblings, 0 replies; 52+ messages in thread
From: jjsullivan5196 @ 2021-08-03 4:22 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
There's a closed pull request on the void-packages repository
zig: enable cross-compile support
https://github.com/void-linux/void-packages/pull/25004
Description:
Closes #24959
^ permalink raw reply [flat|nested] 52+ messages in thread