fix libelf for android ndk r26b (#3169)

* fix libelf

* improve ndk

* fix stdc headers

* fix int64

* fix int64
pull/3172/head
ruki 10 months ago committed by GitHub
parent 2390806b0f
commit 874d2c3cf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 14
      .github/workflows/android.yml
  2. 4
      packages/l/libelf/xmake.lua

@ -12,12 +12,13 @@ jobs:
matrix:
os: [ubuntu-latest]
arch: [armeabi-v7a, arm64-v8a]
ndk: ["r22", "r26b"]
ndk_sdkver: ["29", "21"]
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Android-${{ matrix.arch }}-${{ matrix.ndk_sdkver }}
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Android-${{ matrix.arch }}-${{ matrix.ndk }}-${{ matrix.ndk_sdkver }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v1
@ -29,10 +30,15 @@ jobs:
- name: Prepare
run: |
wget -q https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip
unzip -q -o ./android-ndk-r22-linux-x86_64.zip
if test ${{ matrix.ndk }} = "r26b"; then
wget -q https://dl.google.com/android/repository/android-ndk-r26b-linux.zip
unzip -q -o ./android-ndk-r26b-linux.zip
else
wget -q https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip
unzip -q -o ./android-ndk-r22-linux-x86_64.zip
fi
- name: Tests
run: |
xmake l ./scripts/test.lua -D -p android --ndk=`pwd`/android-ndk-r22 --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }}
xmake l ./scripts/test.lua -D -p android --ndk=`pwd`/android-ndk-${{ matrix.ndk }} --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }}

@ -25,15 +25,15 @@ package("libelf")
io.replace("./configure", "#define off_t long", "")
io.replace("lib/private.h", "HAVE_MEMMOVE", "1")
io.replace("lib/private.h", "HAVE_MEMCPY", "1")
io.replace("lib/private.h", "STDC_HEADERS", "1")
table.insert(cxflags, "-D__LIBELF64=1")
table.insert(cxflags, "-D__LIBELF64_LINUX=1")
table.insert(cxflags, "-D__libelf_u64_t=uint64_t")
table.insert(cxflags, "-D__libelf_i64_t=int64_t")
package:add("defines", "__LIBELF64=1")
package:add("defines", "__LIBELF64_LINUX=1")
package:add("defines", "__libelf_u64_t=uint64_t")
package:add("defines", "__libelf_i64_t=int64_t")
end
io.replace("./configure", "main(){return(0);}", "int main(){return(0);}", {plain = true})
import("package.tools.autoconf").install(package, configs, {cxflags = cxflags})
end)

Loading…
Cancel
Save