Skip to content

Commit

Permalink
config: fix building for iOS
Browse files Browse the repository at this point in the history
otherwise failing to link because the builtin is not provided as shown
by :

  $ CC='xcrun -sdk iphoneos clang -arch arm64' make
  Undefined symbols for architecture arm64:
    "___clear_cache", referenced from:
        _sljit_generate_code in sljitLir-c23a56.o
        _sljit_set_jump_addr in sljitLir-c23a56.o
        _sljit_set_const in sljitLir-c23a56.o
  ld: symbol(s) not found for architecture arm64
  • Loading branch information
carenas committed Aug 30, 2020
1 parent 502744f commit a9876e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sljit_src/sljitConfigInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ extern "C" {
#if (!defined SLJIT_CACHE_FLUSH && defined __has_builtin)
#if __has_builtin(__builtin___clear_cache)

#ifndef __APPLE__
#define SLJIT_CACHE_FLUSH(from, to) \
__builtin___clear_cache((char*)(from), (char*)(to))
#endif

#endif /* __has_builtin(__builtin___clear_cache) */
#endif /* (!defined SLJIT_CACHE_FLUSH && defined __has_builtin) */
Expand All @@ -336,7 +338,7 @@ extern "C" {
#define SLJIT_CACHE_FLUSH(from, to)

#elif defined __APPLE__

#include <libkern/OSCacheControl.h>
/* Supported by all macs since Mac OS 10.5.
However, it does not work on non-jailbroken iOS devices,
although the compilation is successful. */
Expand Down

0 comments on commit a9876e5

Please sign in to comment.