Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with android NDK r28 beta #41293

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ports/libiconv/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ vcpkg_extract_source_archive(SOURCE_PATH
0003-Add-export.patch
0004-ModuleFileName.patch
clang-fortify.patch # ported from https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=522aea1093a598246346b3e1c426505c344fe19a
rename-gl-mempcpy.diff # for Android NDK r28 with API level < 23
)

vcpkg_list(SET OPTIONS)
Expand Down
43 changes: 43 additions & 0 deletions ports/libiconv/rename-gl-mempcpy.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/srclib/canonicalize-lgpl.c b/srclib/canonicalize-lgpl.c
index a7fa7fe..8199b35 100644
--- a/srclib/canonicalize-lgpl.c
+++ b/srclib/canonicalize-lgpl.c
@@ -71,6 +71,10 @@
# define __getcwd(buf, max) getwd (buf)
# endif
# define __mempcpy mempcpy
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 23
+# undef __mempcpy
+# define __mempcpy rpl_mempcpy
+#endif
# define __pathconf pathconf
# define __rawmemchr rawmemchr
# define __readlink readlink
diff --git a/srclib/mempcpy.c b/srclib/mempcpy.c
index 9aae418..c24f58e 100644
--- a/srclib/mempcpy.c
+++ b/srclib/mempcpy.c
@@ -21,6 +21,9 @@

/* A function definition is only needed if HAVE_MEMPCPY is not defined. */
#if !HAVE_MEMPCPY
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 23
+# define mempcpy rpl_mempcpy
+#endif

/* Copy N bytes of SRC to DEST, return pointer to bytes after the
last written byte. */
diff --git a/srclib/stdlib.in.h b/srclib/stdlib.in.h
index a86643c..92dff31 100644
--- a/srclib/stdlib.in.h
+++ b/srclib/stdlib.in.h
@@ -1553,6 +1553,9 @@ _GL_CXXALIASWARN (wctomb);
# endif
#endif

+#if defined(__ANDROID_API__) && __ANDROID_API__ < 23
+_GL_FUNCDECL_RPL (mempcpy, void *, (void *, const void *, size_t));
+#endif

#endif /* _@GUARD_PREFIX@_STDLIB_H */
#endif /* _@GUARD_PREFIX@_STDLIB_H */
2 changes: 1 addition & 1 deletion ports/libiconv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libiconv",
"version": "1.17",
"port-version": 4,
"port-version": 5,
"description": "GNU Unicode text conversion",
"homepage": "https://www.gnu.org/software/libiconv/",
"license": null
Expand Down
2 changes: 1 addition & 1 deletion scripts/azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parameters:
- name: tripletPattern
displayName: 'Enable triplets which contain this substring'
type: string
default: '-'
default: 'android'

jobs:
- template: windows/azure-pipelines.yml
Expand Down
12 changes: 12 additions & 0 deletions scripts/azure-pipelines/test-modified-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ if ($IsWindows) {
rmdir empty
}

if ($IsLinux -and $Triplet -match 'android' -and $true)
{
$override_ndk = 'r28-beta1'
$override_ndk_sha512 = '32804ae60d9e9b5e86bcd6bbfddcbd626ea49466587023fe2d183cf9fb34e142fb39655ea96c871d03194aba0f8d8ed94171dd9f72f4f64b4b687914f0de8520'
Write-Host "Downloading Android NDK $override_ndk"
& "./vcpkg" x-download android-ndk-$override_ndk-linux.zip "--sha512=$override_ndk_sha512" "--url=https://dl.google.com/android/repository/android-ndk-$override_ndk-linux.zip" @cachingArgs
Write-Host "Unpacking"
& unzip -q android-ndk-$override_ndk-linux.zip
$env:ANDROID_NDK_HOME = Join-Path $Pwd "android-ndk-$override_ndk"
$NoParentHashes = $true
}

& "./vcpkg$executableExtension" x-ci-clean @commonArgs
$lastLastExitCode = $LASTEXITCODE
if ($lastLastExitCode -ne 0)
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4630,7 +4630,7 @@
},
"libiconv": {
"baseline": "1.17",
"port-version": 4
"port-version": 5
},
"libics": {
"baseline": "1.6.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libiconv.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "50c14f093f27eccf755ddff4da37cff1d13d62a8",
"version": "1.17",
"port-version": 5
},
{
"git-tree": "6549f7452c383df31d471692b339f985d0000a88",
"version": "1.17",
Expand Down
Loading