openresty / openresty/luajit2

fails to build for iOS simulator

Open
#196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.4k
Forks
252
Avg merge
7d 11h
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided xcrun and make commands, using the amalg target. Start with the reported errors in src/lj_init.c and trace the missing JIT_F_SSE4_2, JIT_F_SSE3, JIT_F_SSE4_1, and JIT_F_BMI2 definitions. Done means the iOS simulator build completes successfully with these commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ios
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.