facebook / hermes

A JavaScript engine optimized for running React Native.
https://hermesengine.dev/
MIT License
9.67k stars 619 forks source link

When I CrossCompilation build for android, I got the error, the branch is 'rn/0.74-stable' #1459

Closed hopestar90 closed 1 month ago

hopestar90 commented 1 month ago

I excute the command './gradlew githubReleaseNoIntl', to get the android Compile product libhermes.so. But I got the errors: image

tmikov commented 1 month ago

Please, provide actual text of the error instead of a screenshot. Thanks.

hopestar90 commented 1 month ago

Please, provide actual text of the error instead of a screenshot. Thanks. Hi~ This is the error log:

> Task :hermes:buildCMakeRelease[arm64-v8a][libhermes]-2 FAILED
C/C++: ninja: Entering directory `/Users/victor.chi/github_hermes_workspace/staging/hermes/Release/3f204a92/arm64-v8a'
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':hermes:buildCMakeRelease[arm64-v8a][libhermes]-2'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/victor.chi/github_hermes_workspace/staging/hermes/Release/3f204a92/arm64-v8a'
  [1/2] Linking CXX shared library /Users/victor.chi/github_hermes_workspace/build_android/hermes/intermediates/cxx/Release/3f204a92/obj/arm64-v8a/libjsi.so
  FAILED: /Users/victor.chi/github_hermes_workspace/build_android/hermes/intermediates/cxx/Release/3f204a92/obj/arm64-v8a/libjsi.so 
  : && /Users/victor.chi/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/Users/victor.chi/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/victor.chi/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-deprecated-copy -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -ffp-contract=on -Wno-range-loop-analysis -ffunction-sections -fdata-sections -faddrsig -fvisibility=hidden -O2 -DNDEBUG  -flto=thin  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments    -fuse-ld=gold -shared -Wl,-soname,libjsi.so -o /Users/victor.chi/github_hermes_workspace/build_android/hermes/intermediates/cxx/Release/3f204a92/obj/arm64-v8a/libjsi.so jsi/CMakeFiles/jsi.dir/jsi.cpp.o  -latomic -lm && :
  /Users/victor.chi/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: --no-rosegment: unknown option
  /Users/victor.chi/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: use the --help option for usage information
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      /Users/victor.chi/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/victor.chi/github_hermes_workspace/staging/hermes/Release/3f204a92/arm64-v8a \
        libhermes
    from /Users/victor.chi/github_hermes_workspace/shopee-hermes/android/hermes

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org
hopestar90 commented 1 month ago

I have build successfully