Skip to content

Commit

Permalink
Remove '-lgcc' option in ndk 23. Fixes mozilla#75.
Browse files Browse the repository at this point in the history
  • Loading branch information
minyung authored and sally-sim committed Feb 23, 2022
1 parent 327a188 commit b1b5c48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/src/main/kotlin/com/nishtahir/CargoBuildTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ open class CargoBuildTask : DefaultTask() {
if (toolchain.type != ToolchainType.DESKTOP) {
val toolchainDirectory = if (toolchain.type == ToolchainType.ANDROID_PREBUILT) {
val ndkPath = app.ndkDirectory
val ndkVersion = ndkPath.name
val ndkVersionMajor = ndkVersion.split(".").first()
environment("CARGO_NDK_MAJOR_VERSION", ndkVersionMajor)

val hostTag = if (Os.isFamily(Os.FAMILY_WINDOWS)) {
if (Os.isArch("x86_64") || Os.isArch("amd64")) {
"windows-x86_64"
Expand Down
4 changes: 4 additions & 0 deletions plugin/src/main/resources/com/nishtahir/linker-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

args = [os.environ['RUST_ANDROID_GRADLE_CC'], os.environ['RUST_ANDROID_GRADLE_CC_LINK_ARG']] + sys.argv[1:]

# The gcc library is not included in ndk version 23.
if 23 == int(os.environ['CARGO_NDK_MAJOR_VERSION']):
args.remove("-lgcc")

# This only appears when the subprocess call fails, but it's helpful then.
printable_cmd = ' '.join(pipes.quote(arg) for arg in args)
print(printable_cmd)
Expand Down

0 comments on commit b1b5c48

Please sign in to comment.