From 488f378d6e8d4787100f974072a1a16642a1ddb4 Mon Sep 17 00:00:00 2001 From: tiemuhuaguo Date: Tue, 5 Dec 2023 15:17:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E9=80=9A=E8=BF=87wconan=E8=B7=A8?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=BC=96=E8=AF=91=E3=80=822=E3=80=81?= =?UTF-8?q?=E9=81=BF=E5=85=8DWindows=E7=AC=A6=E5=8F=B7=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mars/comm/socket/socket_address.h | 4 - mars/comm/verinfo.h | 8 +- mars/comm/windows/zlib/adler32.c | 189 ---------------- mars/mars_utils.py | 56 ++++- .../include/openssl/__DECC_INCLUDE_EPILOGUE.H | 22 ++ .../include/openssl/__DECC_INCLUDE_PROLOGUE.H | 26 +++ .../include/openssl/opensslconf-android.h | 4 +- mars/openssl/include/openssl/opensslconf.h | 13 +- mars/openssl/include/openssl/opensslconf.h.in | 160 ++++++++++++++ .../include/openssl/opensslconf_android-arm.h | 4 +- .../openssl/opensslconf_android-arm64.h | 4 +- .../include/openssl/opensslconf_android-x86.h | 203 ++++++++++++++++++ .../openssl/opensslconf_android-x86_64.h | 4 +- mars/zstd/build/cmake/lib/CMakeLists.txt | 12 +- 14 files changed, 480 insertions(+), 229 deletions(-) delete mode 100644 mars/comm/windows/zlib/adler32.c create mode 100644 mars/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H create mode 100644 mars/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H mode change 100755 => 100644 mars/openssl/include/openssl/opensslconf-android.h create mode 100644 mars/openssl/include/openssl/opensslconf.h.in create mode 100644 mars/openssl/include/openssl/opensslconf_android-x86.h diff --git a/mars/comm/socket/socket_address.h b/mars/comm/socket/socket_address.h index 39e068b4..79c09d99 100644 --- a/mars/comm/socket/socket_address.h +++ b/mars/comm/socket/socket_address.h @@ -25,10 +25,6 @@ #include "comm/socket/local_ipstack.h" #include "unix_socket.h" -#ifdef _WIN32 -#include "winsock2.h" // for socket_storage -#endif - class socket_address { public: explicit socket_address(const char* _ip, uint16_t _port); diff --git a/mars/comm/verinfo.h b/mars/comm/verinfo.h index d8eaa7bb..1a6710e7 100644 --- a/mars/comm/verinfo.h +++ b/mars/comm/verinfo.h @@ -2,10 +2,10 @@ #ifndef Mars_verinfo_h #define Mars_verinfo_h -#define MARS_REVISION "${mars_rev}" -#define MARS_PATH "${mars_branch}" +#define MARS_REVISION "ed9bb06f4" +#define MARS_PATH "tiemuhuaguo/23.11/cross_platform" #define MARS_URL "" -#define MARS_BUILD_TIME "20230216" -#define MARS_TAG "1.0.0-SNAPSHOT" +#define MARS_BUILD_TIME "2023-12-05 11:43:37" +#define MARS_TAG "" #endif diff --git a/mars/comm/windows/zlib/adler32.c b/mars/comm/windows/zlib/adler32.c deleted file mode 100644 index 4f3daab3..00000000 --- a/mars/comm/windows/zlib/adler32.c +++ /dev/null @@ -1,189 +0,0 @@ -/* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2011 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include "zutil.h" - -#define local static - -local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); - -#define BASE 65521 /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf, i) \ - { \ - adler += (buf)[i]; \ - sum2 += adler; \ - } -#define DO2(buf, i) \ - DO1(buf, i); \ - DO1(buf, i + 1); -#define DO4(buf, i) \ - DO2(buf, i); \ - DO2(buf, i + 2); -#define DO8(buf, i) \ - DO4(buf, i); \ - DO4(buf, i + 4); -#define DO16(buf) \ - DO8(buf, 0); \ - DO8(buf, 8); - -/* use NO_DIVIDE if your processor does not do division in hardware -- - try it both ways to see which is faster */ -#ifdef NO_DIVIDE -/* note that this assumes BASE is 65521, where 65536 % 65521 == 15 - (thank you to John Reiser for pointing this out) */ -#define CHOP(a) \ - do { \ - unsigned long tmp = a >> 16; \ - a &= 0xffffUL; \ - a += (tmp << 4) - tmp; \ - } while (0) -#define MOD28(a) \ - do { \ - CHOP(a); \ - if (a >= BASE) \ - a -= BASE; \ - } while (0) -#define MOD(a) \ - do { \ - CHOP(a); \ - MOD28(a); \ - } while (0) -#define MOD63(a) \ - do { /* this assumes a is not negative */ \ - z_off64_t tmp = a >> 32; \ - a &= 0xffffffffL; \ - a += (tmp << 8) - (tmp << 5) + tmp; \ - tmp = a >> 16; \ - a &= 0xffffL; \ - a += (tmp << 4) - tmp; \ - tmp = a >> 16; \ - a &= 0xffffL; \ - a += (tmp << 4) - tmp; \ - if (a >= BASE) \ - a -= BASE; \ - } while (0) -#else -#define MOD(a) a %= BASE -#define MOD28(a) a %= BASE -#define MOD63(a) a %= BASE -#endif - -/* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) uLong adler; -const Bytef* buf; -uInt len; -{ - unsigned long sum2; - unsigned n; - - /* split Adler-32 into component sums */ - sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) - adler -= BASE; - sum2 += adler; - if (sum2 >= BASE) - sum2 -= BASE; - return adler | (sum2 << 16); - } - - /* initial Adler-32 value (deferred check for len == 1 speed) */ - if (buf == Z_NULL) - return 1L; - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) - adler -= BASE; - MOD28(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -/* ========================================================================= */ -local uLong adler32_combine_(adler1, adler2, len2) uLong adler1; -uLong adler2; -z_off64_t len2; -{ - unsigned long sum1; - unsigned long sum2; - unsigned rem; - - /* for negative len, return invalid adler32 as a clue for debugging */ - if (len2 < 0) - return 0xffffffffUL; - - /* the derivation of this formula is left as an exercise for the reader */ - MOD63(len2); /* assumes len2 >= 0 */ - rem = (unsigned)len2; - sum1 = adler1 & 0xffff; - sum2 = rem * sum1; - MOD(sum2); - sum1 += (adler2 & 0xffff) + BASE - 1; - sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; - if (sum1 >= BASE) - sum1 -= BASE; - if (sum1 >= BASE) - sum1 -= BASE; - if (sum2 >= (BASE << 1)) - sum2 -= (BASE << 1); - if (sum2 >= BASE) - sum2 -= BASE; - return sum1 | (sum2 << 16); -} - -/* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) uLong adler1; -uLong adler2; -z_off_t len2; -{ return adler32_combine_(adler1, adler2, len2); } - -uLong ZEXPORT adler32_combine64(adler1, adler2, len2) uLong adler1; -uLong adler2; -z_off64_t len2; -{ return adler32_combine_(adler1, adler2, len2); } diff --git a/mars/mars_utils.py b/mars/mars_utils.py index 5ef15524..dac0bbae 100644 --- a/mars/mars_utils.py +++ b/mars/mars_utils.py @@ -3,7 +3,9 @@ import shutil import time import subprocess +import hashlib from typing import List +from typing import Dict COMM_COPY_HEADER_FILES = { "mars/comm/verinfo.h": "comm", @@ -20,6 +22,7 @@ "mars/comm/has_member.h": "comm", "mars/comm/objc/scope_autoreleasepool.h": "comm", "mars/comm/objc/ThreadOperationQueue.h": "comm", + "mars/comm/socket/unix_socket.h": "comm/socket", "mars/comm/xlogger/preprocessor.h": "xlog", "mars/comm/xlogger/xloggerbase.h": "xlog", @@ -29,6 +32,7 @@ "mars/boot/base_manager.h": "boot", "mars/stn/stn.h": "stn", + "mars/stn/config.h": "stn", "mars/stn/stn_logic.h": "stn", "mars/stn/stn_manager.h": "stn", "mars/stn/task_profile.h": "stn", @@ -174,6 +178,15 @@ def remove_cmake_files(path): os.remove(f) +def remove_if_exist(path: str): + if not os.path.exists(path): + return + if os.path.isdir(path): + shutil.rmtree(path) + else: + os.remove(path) + + def clean_except(path, except_list): for fpath, dirs, fs in os.walk(path): in_except = False @@ -227,20 +240,48 @@ def copy_windows_pdb(cmake_out, sub_folder, config, dst_folder): print("%s not exists" % pdb) +def is_different_file(file1: str, file2: str) -> bool: + assert os.path.exists(file1) + if not os.path.exists(file2): + return True + md51: str = hashlib.md5(open(file1, 'rb').read()).hexdigest() + md52: str = hashlib.md5(open(file2, 'rb').read()).hexdigest() + return md51 != md52 + + def copy_file(src, dst): - if not os.path.isfile(src): - print('Warning: %s not exist cwd %s' % (src, os.getcwd())) - return + assert os.path.isfile(src), src if dst.rfind("/") != -1 and not os.path.exists(dst[:dst.rfind("/")]): os.makedirs(dst[:dst.rfind("/")]) + if dst.rfind("\\") != -1 and not os.path.exists(dst[:dst.rfind("\\")]): + os.makedirs(dst[:dst.rfind("\\")]) - shutil.copy(src, dst) + if is_different_file(src, dst): + shutil.copy(src, dst) -def copy_file_mapping(header_file_mappings, header_files_src_base, header_files_dst_end): +def copy_file_mapping(header_file_mappings: Dict[str, str], header_files_src_base: str, header_files_dst_end: str): for (src, dst) in header_file_mappings.items(): - copy_file(header_files_src_base + src, header_files_dst_end + "/" + dst + '/' + src[src.rfind("/"):]) + copy_file(os.path.join(header_files_src_base, src), + os.path.join(header_files_dst_end, dst, src[src.rfind("/") + 1:])) + + +# dst为复制后文件夹的路径,而非文件夹的父目录的路径。 +# 若复制前dst非空,本函数不会清空dst文件夹中的内容。 +def copy_folder(src: str, dst: str): + assert os.path.exists(src), src + assert os.path.isdir(src), src + if not os.path.exists(dst): + os.makedirs(dst) + + for name in os.listdir(src): + absolute_src_file: str = os.path.join(src, name) + absolute_dst_file: str = os.path.join(dst, name) + if os.path.isdir(absolute_src_file): + copy_folder(absolute_src_file, absolute_dst_file) + else: + copy_file(absolute_src_file, absolute_dst_file) def make_static_framework(src_lib, dst_framework, header_file_mappings, header_files_src_base='./'): @@ -252,7 +293,8 @@ def make_static_framework(src_lib, dst_framework, header_file_mappings, header_f framework_path = dst_framework + '/Headers' for (src, dst) in header_file_mappings.items(): - copy_file(header_files_src_base + src, framework_path + "/" + dst + '/' + src[src.rfind("/"):]) + copy_file(os.path.join(header_files_src_base, src), + os.path.join(framework_path, dst, src[src.rfind("/") + 1:])) return True diff --git a/mars/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H b/mars/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H new file mode 100644 index 00000000..ad0a5f56 --- /dev/null +++ b/mars/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H @@ -0,0 +1,22 @@ +/* + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C/C++ on VMS, and is included automatically + * after each header file from this directory + */ + +/* + * The C++ compiler doesn't understand these pragmas, even though it + * understands the corresponding command line qualifier. + */ +#ifndef __cplusplus +/* restore state. Must correspond to the save in __decc_include_prologue.h */ +# pragma names restore +#endif diff --git a/mars/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H b/mars/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H new file mode 100644 index 00000000..5f5513e8 --- /dev/null +++ b/mars/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H @@ -0,0 +1,26 @@ +/* + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C/C++ on VMS, and is included automatically + * after each header file from this directory + */ + +/* + * The C++ compiler doesn't understand these pragmas, even though it + * understands the corresponding command line qualifier. + */ +#ifndef __cplusplus +/* save state */ +# pragma names save +/* have the compiler shorten symbols larger than 31 chars to 23 chars + * followed by a 8 hex char CRC + */ +# pragma names as_is,shortened +#endif diff --git a/mars/openssl/include/openssl/opensslconf-android.h b/mars/openssl/include/openssl/opensslconf-android.h old mode 100755 new mode 100644 index c2ba15cf..94b15660 --- a/mars/openssl/include/openssl/opensslconf-android.h +++ b/mars/openssl/include/openssl/opensslconf-android.h @@ -12,9 +12,9 @@ #elif defined(__aarch64__) #include #elif defined(__i386__) -#include +#include #elif defined(__x86_64__) -#include +#include #else # error Unable to determine arch not included in OpenSSL build #endif diff --git a/mars/openssl/include/openssl/opensslconf.h b/mars/openssl/include/openssl/opensslconf.h index 3f1ad20a..5c086fd8 100644 --- a/mars/openssl/include/openssl/opensslconf.h +++ b/mars/openssl/include/openssl/opensslconf.h @@ -10,17 +10,8 @@ #include #elif defined(__ANDROID__) #include -#elif defined(WIN32) -// see https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-160 -#if defined(_WIN64) -#include -#else -#include -#endif - -#elif defined(__linux__) -#include - +#elif defined(__WIN32__) +#include #else #error unsupported platform #endif diff --git a/mars/openssl/include/openssl/opensslconf.h.in b/mars/openssl/include/openssl/opensslconf.h.in new file mode 100644 index 00000000..06270922 --- /dev/null +++ b/mars/openssl/include/openssl/opensslconf.h.in @@ -0,0 +1,160 @@ +/* + * {- join("\n * ", @autowarntext) -} + * + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_ALGORITHM_DEFINES +# error OPENSSL_ALGORITHM_DEFINES no longer supported +#endif + +/* + * OpenSSL was configured with the following options: + */ + +{- if (@{$config{openssl_sys_defines}}) { + foreach (@{$config{openssl_sys_defines}}) { + $OUT .= "#ifndef $_\n"; + $OUT .= "# define $_ 1\n"; + $OUT .= "#endif\n"; + } + } + foreach (@{$config{openssl_api_defines}}) { + (my $macro, my $value) = $_ =~ /^(.*?)=(.*?)$/; + $OUT .= "#define $macro $value\n"; + } + if (@{$config{openssl_algorithm_defines}}) { + foreach (@{$config{openssl_algorithm_defines}}) { + $OUT .= "#ifndef $_\n"; + $OUT .= "# define $_\n"; + $OUT .= "#endif\n"; + } + } + if (@{$config{openssl_thread_defines}}) { + foreach (@{$config{openssl_thread_defines}}) { + $OUT .= "#ifndef $_\n"; + $OUT .= "# define $_\n"; + $OUT .= "#endif\n"; + } + } + if (@{$config{openssl_other_defines}}) { + foreach (@{$config{openssl_other_defines}}) { + $OUT .= "#ifndef $_\n"; + $OUT .= "# define $_\n"; + $OUT .= "#endif\n"; + } + } + ""; +-} + +/* + * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers + * don't like that. This will hopefully silence them. + */ +#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; + +/* + * Applications should use -DOPENSSL_API_COMPAT= to suppress the + * declarations of functions deprecated in or before . Otherwise, they + * still won't see them if the library has been built to disable deprecated + * functions. + */ +#ifndef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +#endif + +#ifndef OPENSSL_FILE +# ifdef OPENSSL_NO_FILENAMES +# define OPENSSL_FILE "" +# define OPENSSL_LINE 0 +# else +# define OPENSSL_FILE __FILE__ +# define OPENSSL_LINE __LINE__ +# endif +#endif + +#ifndef OPENSSL_MIN_API +# define OPENSSL_MIN_API 0 +#endif + +#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API +# undef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT OPENSSL_MIN_API +#endif + +/* + * Do not deprecate things to be deprecated in version 1.2.0 before the + * OpenSSL version number matches. + */ +#if OPENSSL_VERSION_NUMBER < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) f; +#elif OPENSSL_API_COMPAT < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_2_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10100000L +# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_1_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10000000L +# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_0_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x00908000L +# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_0_9_8(f) +#endif + +/* Generate 80386 code? */ +{- $config{processor} eq "386" ? "#define" : "#undef" -} I386_ONLY + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD {- $target{unistd} -} + +{- $config{export_var_as_fn} ? "#define" : "#undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION + +/* + * The following are cipher-specific, but are part of the public API. + */ +#if !defined(OPENSSL_SYS_UEFI) +{- $config{bn_ll} ? "# define" : "# undef" -} BN_LLONG +/* Only one for the following should be defined */ +{- $config{b64l} ? "# define" : "# undef" -} SIXTY_FOUR_BIT_LONG +{- $config{b64} ? "# define" : "# undef" -} SIXTY_FOUR_BIT +{- $config{b32} ? "# define" : "# undef" -} THIRTY_TWO_BIT +#endif + +#define RC4_INT {- $config{rc4_int} -} + +#ifdef __cplusplus +} +#endif diff --git a/mars/openssl/include/openssl/opensslconf_android-arm.h b/mars/openssl/include/openssl/opensslconf_android-arm.h index 57f53bfa..2b8850ca 100644 --- a/mars/openssl/include/openssl/opensslconf_android-arm.h +++ b/mars/openssl/include/openssl/opensslconf_android-arm.h @@ -96,8 +96,8 @@ extern "C" { #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS # define OPENSSL_NO_WEAK_SSL_CIPHERS #endif -#ifndef OPENSSL_NO_DYNAMIC_ENGINE -# define OPENSSL_NO_DYNAMIC_ENGINE +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE #endif diff --git a/mars/openssl/include/openssl/opensslconf_android-arm64.h b/mars/openssl/include/openssl/opensslconf_android-arm64.h index 775a4a04..09c404b5 100644 --- a/mars/openssl/include/openssl/opensslconf_android-arm64.h +++ b/mars/openssl/include/openssl/opensslconf_android-arm64.h @@ -96,8 +96,8 @@ extern "C" { #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS # define OPENSSL_NO_WEAK_SSL_CIPHERS #endif -#ifndef OPENSSL_NO_DYNAMIC_ENGINE -# define OPENSSL_NO_DYNAMIC_ENGINE +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE #endif diff --git a/mars/openssl/include/openssl/opensslconf_android-x86.h b/mars/openssl/include/openssl/opensslconf_android-x86.h new file mode 100644 index 00000000..211b6ae6 --- /dev/null +++ b/mars/openssl/include/openssl/opensslconf_android-x86.h @@ -0,0 +1,203 @@ +/* + * WARNING: do not edit! + * Generated by Makefile from include/openssl/opensslconf.h.in + * + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_ALGORITHM_DEFINES +# error OPENSSL_ALGORITHM_DEFINES no longer supported +#endif + +/* + * OpenSSL was configured with the following options: + */ + +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_RAND_SEED_OS +# define OPENSSL_RAND_SEED_OS +#endif +#ifndef OPENSSL_NO_AFALGENG +# define OPENSSL_NO_AFALGENG +#endif +#ifndef OPENSSL_NO_ASAN +# define OPENSSL_NO_ASAN +#endif +#ifndef OPENSSL_NO_CRYPTO_MDEBUG +# define OPENSSL_NO_CRYPTO_MDEBUG +#endif +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +#endif +#ifndef OPENSSL_NO_DEVCRYPTOENG +# define OPENSSL_NO_DEVCRYPTOENG +#endif +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_EGD +# define OPENSSL_NO_EGD +#endif +#ifndef OPENSSL_NO_EXTERNAL_TESTS +# define OPENSSL_NO_EXTERNAL_TESTS +#endif +#ifndef OPENSSL_NO_FUZZ_AFL +# define OPENSSL_NO_FUZZ_AFL +#endif +#ifndef OPENSSL_NO_FUZZ_LIBFUZZER +# define OPENSSL_NO_FUZZ_LIBFUZZER +#endif +#ifndef OPENSSL_NO_HEARTBEATS +# define OPENSSL_NO_HEARTBEATS +#endif +#ifndef OPENSSL_NO_MSAN +# define OPENSSL_NO_MSAN +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +#endif +#ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +#endif +#ifndef OPENSSL_NO_TESTS +# define OPENSSL_NO_TESTS +#endif +#ifndef OPENSSL_NO_UBSAN +# define OPENSSL_NO_UBSAN +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + + +/* + * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers + * don't like that. This will hopefully silence them. + */ +#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; + +/* + * Applications should use -DOPENSSL_API_COMPAT= to suppress the + * declarations of functions deprecated in or before . Otherwise, they + * still won't see them if the library has been built to disable deprecated + * functions. + */ +#ifndef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +#endif + +#ifndef OPENSSL_FILE +# ifdef OPENSSL_NO_FILENAMES +# define OPENSSL_FILE "" +# define OPENSSL_LINE 0 +# else +# define OPENSSL_FILE __FILE__ +# define OPENSSL_LINE __LINE__ +# endif +#endif + +#ifndef OPENSSL_MIN_API +# define OPENSSL_MIN_API 0 +#endif + +#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API +# undef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT OPENSSL_MIN_API +#endif + +/* + * Do not deprecate things to be deprecated in version 1.2.0 before the + * OpenSSL version number matches. + */ +#if OPENSSL_VERSION_NUMBER < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) f; +#elif OPENSSL_API_COMPAT < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_2_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10100000L +# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_1_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10000000L +# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_0_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x00908000L +# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_0_9_8(f) +#endif + +/* Generate 80386 code? */ +#undef I386_ONLY + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +/* + * The following are cipher-specific, but are part of the public API. + */ +#if !defined(OPENSSL_SYS_UEFI) +# define BN_LLONG +/* Only one for the following should be defined */ +# undef SIXTY_FOUR_BIT_LONG +# undef SIXTY_FOUR_BIT +# define THIRTY_TWO_BIT +#endif + +#define RC4_INT unsigned int + +#ifdef __cplusplus +} +#endif diff --git a/mars/openssl/include/openssl/opensslconf_android-x86_64.h b/mars/openssl/include/openssl/opensslconf_android-x86_64.h index 05baf4fc..353d25fe 100644 --- a/mars/openssl/include/openssl/opensslconf_android-x86_64.h +++ b/mars/openssl/include/openssl/opensslconf_android-x86_64.h @@ -96,8 +96,8 @@ extern "C" { #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS # define OPENSSL_NO_WEAK_SSL_CIPHERS #endif -#ifndef OPENSSL_NO_DYNAMIC_ENGINE -# define OPENSSL_NO_DYNAMIC_ENGINE +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE #endif diff --git a/mars/zstd/build/cmake/lib/CMakeLists.txt b/mars/zstd/build/cmake/lib/CMakeLists.txt index f3d95eee..b0003365 100644 --- a/mars/zstd/build/cmake/lib/CMakeLists.txt +++ b/mars/zstd/build/cmake/lib/CMakeLists.txt @@ -92,11 +92,11 @@ if (ZSTD_BUILD_SHARED) endif() endif () if (ZSTD_BUILD_STATIC) - add_library(libzstd_static STATIC ${Sources} ${Headers}) + add_library(zstd STATIC ${Sources} ${Headers}) if (ZSTD_MULTITHREAD_SUPPORT) - set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") + set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") if (UNIX) - target_link_libraries(libzstd_static ${THREADS_LIBS}) + target_link_libraries(zstd ${THREADS_LIBS}) endif () endif () endif () @@ -107,7 +107,7 @@ if (MSVC) set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS") endif () if (ZSTD_BUILD_STATIC) - set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS") + set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS") endif () endif () @@ -130,7 +130,7 @@ endif () if (ZSTD_BUILD_STATIC) set_target_properties( - libzstd_static + zstd PROPERTIES OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME}) endif () @@ -164,7 +164,7 @@ if (ZSTD_BUILD_SHARED) ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() if (ZSTD_BUILD_STATIC) - install(TARGETS libzstd_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(TARGETS zstd ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif () # uninstall target From 80a3a11e2b08f64feaa246a350f8f3b3e8635579 Mon Sep 17 00:00:00 2001 From: tiemuhuaguo Date: Wed, 6 Dec 2023 18:13:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mars/mars_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mars/mars_utils.py b/mars/mars_utils.py index dac0bbae..3e642097 100644 --- a/mars/mars_utils.py +++ b/mars/mars_utils.py @@ -249,6 +249,7 @@ def is_different_file(file1: str, file2: str) -> bool: return md51 != md52 +# dst是文件的路径,不是文件所在的文件夹的路径 def copy_file(src, dst): assert os.path.isfile(src), src