Skip to content

Commit

Permalink
lang/rust: hopefully the last patches for the libcrypto bump
Browse files Browse the repository at this point in the history
  • Loading branch information
botovq committed Feb 16, 2024
1 parent 27f443a commit 0ebf9b7
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ COMMENT-src = Rust source component

V = 1.76.0
DISTNAME = rustc-${V}-src
REVISION = 0

# rustc bootstrap version
BV-aarch64 = 1.76.0-20240206
Expand Down
41 changes: 41 additions & 0 deletions lang/rust/patches/patch-vendor_openssl-sys_src_crypto_rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
https://github.com/sfackler/rust-openssl/pull/2170

Index: vendor/openssl-sys/src/crypto.rs
--- vendor/openssl-sys/src/crypto.rs.orig
+++ vendor/openssl-sys/src/crypto.rs
@@ -57,7 +57,7 @@ pub type CRYPTO_EX_free = unsafe extern "C" fn(
argp: *mut c_void,
);

-#[cfg(ossl110)]
+#[cfg(any(ossl110, libressl390))]
#[inline]
#[track_caller]
pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void {
@@ -68,7 +68,7 @@ pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_voi
)
}

-#[cfg(not(ossl110))]
+#[cfg(not(any(ossl110, libressl390)))]
#[inline]
#[track_caller]
pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_void {
@@ -79,7 +79,7 @@ pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_voi
)
}

-#[cfg(ossl110)]
+#[cfg(any(ossl110, libressl390))]
#[inline]
#[track_caller]
pub unsafe fn OPENSSL_free(addr: *mut c_void) {
@@ -90,7 +90,7 @@ pub unsafe fn OPENSSL_free(addr: *mut c_void) {
)
}

-#[cfg(not(ossl110))]
+#[cfg(not(any(ossl110, libressl390)))]
#[inline]
pub unsafe fn OPENSSL_free(addr: *mut c_void) {
CRYPTO_free(addr)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
https://github.com/sfackler/rust-openssl/pull/2170

Index: vendor/openssl-sys/src/handwritten/crypto.rs
--- vendor/openssl-sys/src/handwritten/crypto.rs.orig
+++ vendor/openssl-sys/src/handwritten/crypto.rs
@@ -57,7 +57,7 @@ extern "C" {
}

cfg_if! {
- if #[cfg(ossl110)] {
+ if #[cfg(any(ossl110, libressl390))] {
extern "C" {
pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void;
pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);

0 comments on commit 0ebf9b7

Please sign in to comment.