From c74c03819aecba36ae814f41b40fb2489c13f101 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 9 Mar 2023 20:49:08 +0100 Subject: [PATCH] [libtasn1] Fix android clang (#30093) --- ports/libtasn1/clang-fortify.patch | 64 ++++++++++++++++++++++++++++++ ports/libtasn1/portfile.cmake | 6 +-- ports/libtasn1/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/l-/libtasn1.json | 5 +++ 5 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 ports/libtasn1/clang-fortify.patch diff --git a/ports/libtasn1/clang-fortify.patch b/ports/libtasn1/clang-fortify.patch new file mode 100644 index 0000000000..0631b6bc08 --- /dev/null +++ b/ports/libtasn1/clang-fortify.patch @@ -0,0 +1,64 @@ +diff --git a/lib/gl/cdefs.h b/lib/gl/cdefs.h +index 7b8ed5b..63574f9 100644 +--- a/lib/gl/cdefs.h ++++ b/lib/gl/cdefs.h +@@ -140,6 +140,7 @@ + #endif + + ++#ifndef __GNULIB_CDEFS + /* Fortify support. */ + #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + #define __bos0(ptr) __builtin_object_size (ptr, 0) +@@ -201,6 +202,8 @@ + ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \ + : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \ + ++#endif ++ + #if __GNUC_PREREQ (4,3) + # define __warnattr(msg) __attribute__((__warning__ (msg))) + # define __errordecl(name, msg) \ +diff --git a/lib/gl/libc-config.h b/lib/gl/libc-config.h +index a56665b..876e1a1 100644 +--- a/lib/gl/libc-config.h ++++ b/lib/gl/libc-config.h +@@ -137,8 +137,10 @@ + # undef __attribute_returns_twice__ + # undef __attribute_used__ + # undef __attribute_warn_unused_result__ ++# ifndef __GNULIB_CDEFS + # undef __bos + # undef __bos0 ++# endif + # undef __errordecl + # undef __extension__ + # undef __extern_always_inline +@@ -147,21 +149,27 @@ + # undef __fortified_attr_access + # undef __fortify_function + # undef __glibc_c99_flexarr_available ++# ifndef __GNULIB_CDEFS + # undef __glibc_fortify + # undef __glibc_fortify_n ++# endif + # undef __glibc_has_attribute + # undef __glibc_has_builtin + # undef __glibc_has_extension + # undef __glibc_likely + # undef __glibc_macro_warning + # undef __glibc_macro_warning1 ++# ifndef __GNULIB_CDEFS + # undef __glibc_objsize + # undef __glibc_objsize0 + # undef __glibc_safe_len_cond + # undef __glibc_safe_or_unknown_len ++# endif + # undef __glibc_unlikely ++# ifndef __GNULIB_CDEFS + # undef __glibc_unsafe_len + # undef __glibc_unsigned_or_positive ++# endif + # undef __inline + # undef __ptr_t + # undef __restrict diff --git a/ports/libtasn1/portfile.cmake b/ports/libtasn1/portfile.cmake index 7208162e70..915e569bd5 100644 --- a/ports/libtasn1/portfile.cmake +++ b/ports/libtasn1/portfile.cmake @@ -1,7 +1,6 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} - vcpkg_download_distfile(ARCHIVE URLS "https://ftp.gnu.org/gnu/libtasn1/libtasn1-${VERSION}.tar.gz" + "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libtasn1/libtasn1-${VERSION}.tar.gz" FILENAME "libtasn1-${VERSION}.tar.gz" SHA512 287f5eddfb5e21762d9f14d11997e56b953b980b2b03a97ed4cd6d37909bda1ed7d2cdff9da5d270a21d863ab7e54be6b85c05f1075ac5d8f0198997cf335ef4 ) @@ -11,6 +10,7 @@ vcpkg_extract_source_archive(SOURCE_PATH SOURCE_BASE "v${VERSION}" PATCHES msvc_fixes.patch + clang-fortify.patch # ported from https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=522aea1093a598246346b3e1c426505c344fe19a ) vcpkg_find_acquire_program(BISON) @@ -31,7 +31,7 @@ if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") list(APPEND EXTRA_OPTS "CFLAGS=\$CFLAGS -DASN1_STATIC") endif() -set(ENV{GTKDOCIZE} true) +set(ENV{GTKDOCIZE} true) # true, the program vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG diff --git a/ports/libtasn1/vcpkg.json b/ports/libtasn1/vcpkg.json index 5be63dca43..88f0abb264 100644 --- a/ports/libtasn1/vcpkg.json +++ b/ports/libtasn1/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libtasn1", "version": "4.19.0", + "port-version": 1, "description": "A secure communications library implementing the SSL, TLS and DTLS protocols", "homepage": "https://www.gnutls.org/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index c8443cf45d..181a5be04d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4470,7 +4470,7 @@ }, "libtasn1": { "baseline": "4.19.0", - "port-version": 0 + "port-version": 1 }, "libtcod": { "baseline": "1.23.1", diff --git a/versions/l-/libtasn1.json b/versions/l-/libtasn1.json index 708a2956b5..2c27d015e4 100644 --- a/versions/l-/libtasn1.json +++ b/versions/l-/libtasn1.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d8d108b8c34710e58f52569772f13a406893c6ee", + "version": "4.19.0", + "port-version": 1 + }, { "git-tree": "a1922bb6cb0484a7aff7e4907285fc7f6d98fe4e", "version": "4.19.0",