Skip to content

Commit c5604e3

Browse files
committed
fix: patch x87 FPU guard for android-x86 build
The -msse2 -mfpmath=sse approach didn't work because quickjs-ng guards on __i386__ && !_MSC_VER without checking __SSE2_MATH__. Patch cutils.h after clone to add && !defined(__ANDROID__) to the preprocessor guard.
1 parent f0bd58e commit c5604e3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ jobs:
251251
- name: Clone QuickJS
252252
run: git clone --depth 1 ${{ env.QUICKJS_REPO }} quickjs
253253

254+
- name: Patch x87 FPU guard for Android x86
255+
run: |
256+
sed -i 's/#if defined(__i386__) && !defined(_MSC_VER)/#if defined(__i386__) \&\& !defined(_MSC_VER) \&\& !defined(__ANDROID__)/' quickjs/cutils.h
257+
254258
- name: Setup NDK
255259
uses: nttld/setup-ndk@v1
256260
id: setup-ndk
@@ -267,8 +271,7 @@ jobs:
267271
-DANDROID_ABI=x86 \
268272
-DANDROID_PLATFORM=android-21 \
269273
-DBUILD_SHARED_LIBS=ON \
270-
-DCMAKE_BUILD_TYPE=Release \
271-
-DCMAKE_C_FLAGS="-msse2 -mfpmath=sse"
274+
-DCMAKE_BUILD_TYPE=Release
272275
cmake --build build -j$(nproc)
273276
274277
- name: Build shim

0 commit comments

Comments
 (0)