pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
rust184: tweak this so that it builds natively on NetBSD/macppc 10.0.
Module Name: pkgsrc-wip
Committed By: Havard Eidnes <he%NetBSD.org@localhost>
Pushed By: he
Date: Thu Feb 13 09:25:14 2025 +0100
Changeset: 9e56f3ee8cd01273cef4da3e5f3a09b1a30573dd
Modified Files:
rust184/Makefile
rust184/distinfo
rust184/options.mk
Added Files:
rust184/patches/patch-vendor_lzma-sys-0.1.20_config.h
Log Message:
rust184: tweak this so that it builds natively on NetBSD/macppc 10.0.
This is foremost to deal with an assert triggered in liblzma:
assertion "memcmp(mf_ptr(mf) - 1, mf_ptr(mf) - matches[i].dist - 2, matches[i].len) == 0" failed: file "xz-5.2/src/liblzma/lz/lz_encoder_mf.c", line 40, function "lzma_mf_find"
which of course appears at the very end of the build during the
rust-installer use.
This error is seen with both the in-tree gcc and with pkgsrc gcc12,
but forcing the use of pkgsrc gcc14 on NetBSD/powerpc fixes this problem.
That, however, gives rise to another patch being needed to the
configuration of the lzma-sys-0.1.20 crate, and a corresponding
checksum tweak, to deal with
cargo:warning=xz-5.2/src/common/mythread.h: In function 'mythread_condtime_set':
cargo:warning=xz-5.2/src/common/mythread.h:312:9: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
cargo:warning= 312 | gettimeofday(&now, NULL);
cargo:warning= | ^~~~~~~~~~~~
and we just add NetBSD to the "__sun" handling in config.h,
and tell the code that NetBSD has clock_gettime() available.
I am uncertain why this was triggered by using gcc14, and not
seen with the earlier versions.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9e56f3ee8cd01273cef4da3e5f3a09b1a30573dd
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
rust184/Makefile | 4 ++++
rust184/distinfo | 1 +
rust184/options.mk | 8 +++++++
.../patches/patch-vendor_lzma-sys-0.1.20_config.h | 25 ++++++++++++++++++++++
4 files changed, 38 insertions(+)
diffs:
diff --git a/rust184/Makefile b/rust184/Makefile
index cf60130ce6..68b6a5a521 100644
--- a/rust184/Makefile
+++ b/rust184/Makefile
@@ -469,6 +469,10 @@ CKSUM_CRATES+= vendor/line-index-0.1.2
CKSUMS+= c4613b718951cf0b880a3a7829e102a9ec7196591437e3bc0cfd857c717bfb61
CKSUMS+= 5183e802793932fb980b4e321656c65d1b6231de3febd1ac94dfa73de31245f0
+CKSUM_CRATES+= vendor/lzma-sys-0.1.20
+CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9
+CKSUMS+= 2a68e3e635dce81c7dba25b3d3abfaa894ee729e1604f2d000ae3e201f7739a4
+
SUBST_CLASSES+= cksum
SUBST_STAGE.cksum= pre-configure
.for crate in ${CKSUM_CRATES}
diff --git a/rust184/distinfo b/rust184/distinfo
index 21b6e92a2d..a060705f74 100644
--- a/rust184/distinfo
+++ b/rust184/distinfo
@@ -140,6 +140,7 @@ SHA1 (patch-vendor_bytecount-0.6.8_src_lib.rs) = df3641afebac2b06dc9d266524e295c
SHA1 (patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs) = d4d9288cb199af9bc7e321fbd2b42860aed954ec
SHA1 (patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs) = 97505b88875aa80fa2b5589b6090237c3786e143
SHA1 (patch-vendor_line-index-0.1.2_src_lib.rs) = 30aa5c82630ea0e8969abb527c11640712efba1e
+SHA1 (patch-vendor_lzma-sys-0.1.20_config.h) = 4849052ddb2f04f539fd7060fc1b43cc3acf99c4
SHA1 (patch-vendor_memchr-2.7.4_src_arch_aarch64_memchr.rs) = 3e17e9f068afe5e812d10bf57fd3f6d4c21baf0b
SHA1 (patch-vendor_memchr-2.7.4_src_arch_aarch64_mod.rs) = 24bbd69c8b571e5652d5306989b6598b58ec1966
SHA1 (patch-vendor_memchr-2.7.4_src_memchr.rs) = 4c2f4fa4911f38acd3b36c311abd14d3c9751672
diff --git a/rust184/options.mk b/rust184/options.mk
index 27bc0a3f16..eb52f22cab 100644
--- a/rust184/options.mk
+++ b/rust184/options.mk
@@ -40,6 +40,14 @@ GCC_REQD+= 12
. endif
.endif
+# Fix for problem seen during rust-installer run w/rust 1.84.1 on macppc,
+# "of course" experienced near the end of the build process:
+# assertion "memcmp(mf_ptr(mf) - 1, mf_ptr(mf) - matches[i].dist - 2, matches[i].len) == 0" failed: file "xz-5.2/src/liblzma/lz/lz_encoder_mf.c", line 40, function "lzma_mf_find"
+# The above is seen with both in-tree gcc (10.5.0) and gcc12 from pkgsrc.
+.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc}
+GCC_REQD+= 14
+.endif
+
#
# Use the internal copy of LLVM or the external one?
#
diff --git a/rust184/patches/patch-vendor_lzma-sys-0.1.20_config.h b/rust184/patches/patch-vendor_lzma-sys-0.1.20_config.h
new file mode 100644
index 0000000000..6eaa429abe
--- /dev/null
+++ b/rust184/patches/patch-vendor_lzma-sys-0.1.20_config.h
@@ -0,0 +1,25 @@
+$NetBSD$
+
+clock_gettime() is available also on NetBSD.
+
+This takes care of this build error:
+
+ cargo:warning=xz-5.2/src/common/mythread.h: In function 'mythread_condtime_set':
+ cargo:warning=xz-5.2/src/common/mythread.h:312:9: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
+ cargo:warning= 312 | gettimeofday(&now, NULL);
+ cargo:warning= | ^~~~~~~~~~~~
+
+which popped up when switching powerpc to using gcc14, but strangely
+was not triggered by gcc12 or in-tree gcc.
+
+--- vendor/lzma-sys-0.1.20/config.h.orig 2025-02-11 23:15:56.129312069 +0000
++++ vendor/lzma-sys-0.1.20/config.h
+@@ -39,7 +39,7 @@
+ #define MYTHREAD_POSIX 1
+ #endif
+
+-#if defined(__sun)
++#if defined(__sun) || defined(__NetBSD__)
+ #define HAVE_CLOCK_GETTIME 1
+ #define HAVE_DECL_CLOCK_MONOTONIC 1
+ #endif
Home |
Main Index |
Thread Index |
Old Index