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

sys: disable jit on apple aarch64 #16

Merged
merged 1 commit into from
Aug 27, 2020
Merged

Conversation

b8591340
Copy link
Contributor

clang fails with

    Undefined symbols for architecture arm64:
      "___clear_cache", referenced from:
          _sljit_generate_code in libforeign.a(pcre2_jit_compile.o)
    ld: symbol(s) not found for architecture arm64

I’ve only tested an aarch64-apple-ios build, but see here and here for the others.

I also disabled it on the equivalent x86_64 targets to keep an identical binary across simulators and Catalyst (x86_64-apple-ios-macabi); the latter might be debatable assuming the symbols are there as they should be, and we might want to enable it there.

Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me! But would like to leave a trail of breadcrumbs in the code so that it's easy to tell when or if we should re-enable it again.

clang fails with

    Undefined symbols for architecture arm64:
      "___clear_cache", referenced from:
          _sljit_generate_code in libforeign.a(pcre2_jit_compile.o)
    ld: symbol(s) not found for architecture arm64
// x86_64-apple-ios-macabi disabled out of caution (not tested) (needs attention)
//
// We may want to monitor developments on the `aarch64-apple-darwin` front as they may end up
// propagating to all `aarch64`-based targets and the `x86_64` equivalents.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thanks so much! :D

@BurntSushi BurntSushi merged commit 710307d into BurntSushi:master Aug 27, 2020
BurntSushi added a commit to BurntSushi/ripgrep that referenced this pull request Aug 27, 2020
This brings in a PR that disables the JIT on certain Apple targets since
it doesn't appear to build.

See: BurntSushi/rust-pcre2#16
@BurntSushi
Copy link
Owner

This PR is on crates.io in pcre2-sys 0.2.5. (I've also updated ripgrep master to use the new version of pcre2-sys.)

Thanks again!

@carenas
Copy link
Contributor

carenas commented Sep 9, 2020

the following patch might help, but it is likely incomplete as the resulting code is known to cause older versions of iOS to crash (unless the iDevice was rooted), you might be interested on testing zherczeg/sljit#90 if the objective is to have JIT enabled in Apple Silicon eventually

@BurntSushi
Copy link
Owner

@carenas Thanks. Yes, it would be nice to have the JIT enabled on Apple silicon eventually. But not only do I not have access to Apple's new silicon, but I won't have the bandwidth to do that kind of testing anyway. Thank you for the heads up though!

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

Successfully merging this pull request may close these issues.

3 participants