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

iOS arm64 Fails Compiling due to reliance on 'system' (depricated) #129

Closed
jet082 opened this issue Sep 2, 2019 · 3 comments
Closed

iOS arm64 Fails Compiling due to reliance on 'system' (depricated) #129

jet082 opened this issue Sep 2, 2019 · 3 comments

Comments

@jet082
Copy link

jet082 commented Sep 2, 2019

As it says in the title.

The error is as follows:

cc -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk -O2 -Wall -fPIC -O3 -w -g -fPIC -I/usr/local/opt/icu4c/include  -c -o lstrlib.o lstrlib.c
loslib.c:39:22: error: 'system' is unavailable: not available on iOS
  lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/usr/include/stdlib.h:190:6: note: 'system' has been explicitly marked unavailable here
int      system(const char *) __DARWIN_ALIAS_C(system);
         ^
1 error generated.

This is related to this bug: alibaba/LuaViewSDK#84

It would appear 'system' is not available in XCode 9+

@jet082
Copy link
Author

jet082 commented Sep 2, 2019

Commenting out the line

lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));

in deps/lua/src/loslib.c as suggested in that issue linked above seems to fix the problem.

@jet082
Copy link
Author

jet082 commented Oct 2, 2019

I have confirmed the above changes allow the code to compile and I have tested some sample content and it runs on iOS-arm64.

@jet082
Copy link
Author

jet082 commented Nov 16, 2019

Fixed by 6e7c0de

@jet082 jet082 closed this as completed Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant