openresty / luajit2

OpenResty's Branch of LuaJIT 2
https://luajit.org/luajit.html
Other
1.2k stars 193 forks source link

fails to build for iOS simulator #196

Open wtholliday opened 1 year ago

wtholliday commented 1 year ago

luajit2 seems to fail to build for the iOS simulator

To reproduce:

ISDKP=$(xcrun --sdk iphonesimulator --show-sdk-path)
ICC=$(xcrun --sdk iphonesimulator --find clang)
ISDKF="-arch x86_64 -isysroot $ISDKP -miphoneos-version-min=14.0"
make DEFAULT_CC=clang CROSS="$(dirname $ICC)/" \
     TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS amalg

results:

Building LuaJIT 2.1.0-beta3
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src amalg
/Applications/Xcode.app/Contents/Developer/usr/bin/make all "LJCORE_O=ljamalg.o lj_str_hash.o"
CC        lj_init.o
lj_init.c:38:15: error: use of undeclared identifier 'JIT_F_SSE4_2'
  if (flags & JIT_F_SSE4_2)
              ^
lj_init.c:54:39: error: use of undeclared identifier 'JIT_F_SSE3'
    flags |= ((features[2] >> 0)&1) * JIT_F_SSE3;
                                      ^
lj_init.c:55:40: error: use of undeclared identifier 'JIT_F_SSE4_1'
    flags |= ((features[2] >> 19)&1) * JIT_F_SSE4_1;
                                       ^
lj_init.c:56:40: error: use of undeclared identifier 'JIT_F_SSE4_2'
    flags |= ((features[2] >> 20)&1) * JIT_F_SSE4_2;
                                       ^
lj_init.c:60:42: error: use of undeclared identifier 'JIT_F_BMI2'
      flags |= ((xfeatures[1] >> 8)&1) * JIT_F_BMI2;
                                         ^
5 errors generated.

Note that luajit from luajit.org builds successfully with these commands. Still I could be making a mistake in the build commands.