git: 6f5a53ee6b55 - main - sysutils/freebsd-rustdate: Fix build on i386

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Sun, 08 Jun 2025 14:19:52 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6f5a53ee6b551227f41ab78f7e9460bf36bd2f86

commit 6f5a53ee6b551227f41ab78f7e9460bf36bd2f86
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2025-06-03 08:50:54 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2025-06-08 14:19:50 +0000

    sysutils/freebsd-rustdate: Fix build on i386
    
    Import patch from security/openssl35 to fix the build on i386
    
    It fixes the following error:
    note: ld: error: undefined symbol: __atomic_fetch_add_8
          ld: error: undefined symbol: __atomic_fetch_sub_8
          ld: error: undefined symbol: __atomic_load_8
          ld: error: undefined symbol: __atomic_compare_exchange_8
          ld: error: undefined symbol: __atomic_is_lock_free
          ld: error: undefined symbol: __atomic_fetch_or_8
          ld: error: undefined symbol: __atomic_load
          ld: error: undefined symbol: __atomic_store
    
    PR:             287223
    Approved by:    Matthew D. Fuller (maintainer)
---
 .../files/patch-vendor_openssl_crypto_threads__pthread.c  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sysutils/freebsd-rustdate/files/patch-vendor_openssl_crypto_threads__pthread.c b/sysutils/freebsd-rustdate/files/patch-vendor_openssl_crypto_threads__pthread.c
new file mode 100644
index 000000000000..6ae32190c860
--- /dev/null
+++ b/sysutils/freebsd-rustdate/files/patch-vendor_openssl_crypto_threads__pthread.c
@@ -0,0 +1,15 @@
+Taken from /usr/ports/security/openssl34/files/patch-crypto_threads__pthread.c
+
+--- cargo-crates/openssl-src-300.5.0+3.5.0/openssl/crypto/threads_pthread.c.orig	2025-05-09 22:37:37 UTC
++++ cargo-crates/openssl-src-300.5.0+3.5.0/openssl/crypto/threads_pthread.c
+@@ -50,6 +50,10 @@ __tsan_mutex_post_lock((x), 0, 0)
+ # define BROKEN_CLANG_ATOMICS
+ #endif
+ 
++#if defined(__FreeBSD__) && (defined(__i386__) || defined(__powerpc__))
++#define BROKEN_CLANG_ATOMICS
++#endif
++
+ #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
+ 
+ # if defined(OPENSSL_SYS_UNIX)