diff --git a/.patch/mbedtls/0003-openorbis.patch b/.patch/mbedtls/0003-openorbis.patch deleted file mode 100644 index 46cfbd408f..0000000000 --- a/.patch/mbedtls/0003-openorbis.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/library/entropy_poll.c b/library/entropy_poll.c -index 611768c..8950ee4 100644 ---- a/library/entropy_poll.c -+++ b/library/entropy_poll.c -@@ -118,7 +118,7 @@ static int getrandom_wrapper(void *buf, size_t buflen, unsigned int flags) - * - * Documentation: https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7 - */ --#if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(HAVE_GETRANDOM) -+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(HAVE_GETRANDOM) && !defined(__OPENORBIS__) - #include - #include - #if defined(KERN_ARND) diff --git a/.patch/openssl-cmake/0005-wasm-support.patch b/.patch/openssl-cmake/0005-wasm-support.patch new file mode 100644 index 0000000000..31eafac9ad --- /dev/null +++ b/.patch/openssl-cmake/0005-wasm-support.patch @@ -0,0 +1,40 @@ +diff --git a/cmake/ConfigureOpenSSL.cmake b/cmake/ConfigureOpenSSL.cmake +index 3012e05..2ae23ff 100644 +--- a/cmake/ConfigureOpenSSL.cmake ++++ b/cmake/ConfigureOpenSSL.cmake +@@ -108,7 +108,8 @@ function(configure_openssl) + ) + + if(NOT "${CONFIGURE_OPTIONS_OLD}" STREQUAL "") +- if(CONFIGURE_OPTIONS STREQUAL CONFIGURE_OPTIONS_OLD) ++ # TODO(lizzie): Emscripten has issues with rebuilding due to the wrapper it uses ++ if(CMAKE_SYSTEM_NAME MATCHES "Emscripten" OR CONFIGURE_OPTIONS STREQUAL CONFIGURE_OPTIONS_OLD) + message(STATUS "Found previous configure results. Don't perform configuration") + return() + endif() +@@ -134,10 +135,24 @@ function(configure_openssl) + set(VERBOSE_OPTION OUTPUT_QUIET) + endif() + ++ if (CMAKE_SYSTEM_NAME MATCHES "Emscripten") ++ set(EMSCRIPTEN_CMAKE_WRAPPER "emcmake") ++ find_program(EMCC emcc REQUIRED) ++ set(EMSCRIPTEN_LINKER ${EMCC}) ++ list(APPEND CONFIGURE_COMMAND wasm64) ++ else() ++ set(EMSCRIPTEN_CMAKE_WRAPPER "") ++ set(EMSCRIPTEN_LINKER ${CMAKE_LINKER}) ++ endif () ++ + execute_process( +- COMMAND ${CMAKE_COMMAND} -E env ++ COMMAND ${EMSCRIPTEN_CMAKE_WRAPPER} ${CMAKE_COMMAND} -E env + "CFLAGS=${CMAKE_C_FLAGS}" + "CXXFLAGS=${CMAKE_CXX_FLAGS}" ++ "LDFLAGS=${CMAKE_CXX_LINK_FLAGS}" ++ "CC=${CMAKE_C_COMPILER}" ++ "CXX=${CMAKE_CXX_COMPILER}" ++ "LD=${EMSCRIPTEN_LINKER}" + ${CONFIGURE_COMMAND} + WORKING_DIRECTORY ${CONFIGURE_BUILD_DIR} + ${VERBOSE_OPTION} diff --git a/.patch/openssl-cmake/0006-openorbis-prefix.patch b/.patch/openssl-cmake/0006-openorbis-prefix.patch new file mode 100644 index 0000000000..042a334780 --- /dev/null +++ b/.patch/openssl-cmake/0006-openorbis-prefix.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1ca57e1..593fd62 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -148,6 +148,16 @@ if(NOT BUILD_SHARED_LIBS) + list(APPEND OPENSSL_CONFIGURE_OPTIONS no-shared) + endif() + ++list(APPEND OPENSSL_CONFIGURE_OPTIONS ++ no-threads no-thread-pool no-shared no-afalgeng no-async no-capieng no-cmp no-cms no-comp no-ct ++ no-docs no-dgram no-dso no-dynamic-engine no-engine no-filenames no-gost ++ no-http no-legacy no-module no-nextprotoneg no-ocsp no-padlockeng no-quic ++ no-srp no-srtp no-ssl-trace no-static-engine no-tests no-thread-pool no-ts ++ no-ui-console no-uplink no-ssl3-method no-tls1-method no-tls1_1-method ++ no-dtls1-method no-dtls1_2-method no-argon2 no-bf no-blake2 no-cast ++ no-dsa no-idea no-md4 no-mdc2 no-ocb no-rc2 no-rc4 no-rmd160 no-scrypt ++ no-siphash no-siv no-sm2 no-sm3 no-sm4 no-whirlpool no-apps) ++ + list(SORT OPENSSL_CONFIGURE_OPTIONS) + list(REMOVE_DUPLICATES OPENSSL_CONFIGURE_OPTIONS) + list(PREPEND OPENSSL_CONFIGURE_OPTIONS ${OPENSSL_TARGET_PLATFORM}) +diff --git a/cmake/ConfigureOpenSSL.cmake b/cmake/ConfigureOpenSSL.cmake +index 2ae23ff..22a4a27 100644 +--- a/cmake/ConfigureOpenSSL.cmake ++++ b/cmake/ConfigureOpenSSL.cmake +@@ -154,6 +154,7 @@ function(configure_openssl) + "CXX=${CMAKE_CXX_COMPILER}" + "LD=${EMSCRIPTEN_LINKER}" + ${CONFIGURE_COMMAND} ++ "--prefix=${CMAKE_SYSROOT}" + WORKING_DIRECTORY ${CONFIGURE_BUILD_DIR} + ${VERBOSE_OPTION} + COMMAND_ERROR_IS_FATAL ANY diff --git a/externals/ps4sup/stub.cpp b/externals/ps4sup/stub.cpp index ebaef27acc..968a97d28f 100644 --- a/externals/ps4sup/stub.cpp +++ b/externals/ps4sup/stub.cpp @@ -21,6 +21,13 @@ STUB_WEAK(ZSTD_trace_compress_end) STUB_WEAK(ZSTD_trace_decompress_begin) STUB_WEAK(ZSTD_trace_decompress_end) +extern "C" thread_local struct { + char pad[512]; +} _ThreadRuneLocale = {}; +extern "C" struct { + char pad[512]; +} __h_errno = {}; + FILE* __stderrp = stdout; FILE* __stdinp = stdin;