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

Building Thorium for Android arm64: clang error: unsupported option '-mfpu=' for target 'x86_64-unknown-linux-gnu' #672

Closed
vsharkovski opened this issue May 11, 2024 · 3 comments

Comments

@vsharkovski
Copy link

vsharkovski commented May 11, 2024

Hi, I am trying to build Thorium for Android and I ran into a compilation error I can't understand. Any help would be sincerely appreciated.

Building done on a fresh install of Ubuntu 22.04. The steps followed were from BUILDING.md but I tried adding the missing steps to build for Android. Please let me know if I missed some step or made some mistake here:

  • Install depot_tools
  • Clone Thorium
  • Clone Chromium: fetch --nohooks chromium
  • Run ./build/install-build-deps.sh --no-nacl --android
  • Edit chromium/.gclient, add line at end target_os = ["android"]
  • gclient sync
  • Run ./trunk.sh
  • Edit version.sh, add line near end with --target=android-arm64 so it downloads that PGO profile. Run it
  • Run ./setup.sh --android
  • Update last line of ~/thorium/arm/android/android_arm64_args.gn with path of downloaded android arm64 PGO file
  • Paste contents of args.gn file when running gn args out/thorium
  • Run ./build_android.sh --arm64 4

Here is the failing console output:

[4 processes, 46629/102753 @ 4.2/s : 11028.484s ] CXX obj/content/browser/browser/v8_snapshot_files.o
../../content/browser/v8_snapshot_files.cc:35:10: warning: 'return' will never be executed [-Wunreachable-code-return]
   35 |   return files;
      |          ^~~~~
1 warning generated.
[4 processes, 70441/102753 @ 3.8/s : 18744.445s ] CXX clang_x64_v8_arm64/obj/third_party/webrtc/common_audio/common_audio_neon/fir_filter_neon.o
FAILED: clang_x64_v8_arm64/obj/third_party/webrtc/common_audio/common_audio_neon/fir_filter_neon.o 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF clang_x64_v8_arm64/obj/third_party/webrtc/common_audio/common_audio_neon/fir_filter_neon.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -DCR_CLANG_REVISION=\"llvmorg-19-init-2319-g7c4c2746-1\" -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=834e97d73f13a166af65952fb681071eec87a2c4 -DCR_SYSROOT_KEY=20230611T210420Z-2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_STRICT_FIELD_TRIALS=0 -DRTC_ENABLE_VP9 -DRTC_ENABLE_H265 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_ENABLE_LIBEVENT -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DBASE_USE_PERFETTO_CLIENT_LIBRARY=1 -I../.. -Iclang_x64_v8_arm64/gen -I../../buildtools/third_party/libc++ -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Iclang_x64_v8_arm64/gen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/perfetto/include -Iclang_x64_v8_arm64/gen/third_party/perfetto/build_config -Iclang_x64_v8_arm64/gen/third_party/perfetto -I../../base/allocator/partition_allocator/src -Iclang_x64_v8_arm64/gen/base/allocator/partition_allocator/src -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Iclang_x64_v8_arm64/gen/protoc_out -mfpu=neon -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wno-invalid-offsetof -Wno-vla-extension -Wno-thread-safety-reference-return -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 -ffp-contract=fast -fcomplete-member-pointers -m64 -O3 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mpclmul -maes -mavx -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O3 -mllvm -enable-interleaved-mem-accesses -mllvm -aggressive-ext-opt -mllvm -enable-gvn-hoist -O3 -fdata-sections -ffunction-sections -funique-section-names -fno-math-errno -fno-omit-frame-pointer -g0 -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ref-template-as-trivial-member -Xclang -plugin-arg-find-bad-constructs -Xclang check-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang check-allow-auto-typedefs-better-nested -Xclang -plugin-arg-find-bad-constructs -Xclang check-raw-ptr-to-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang disable-check-raw-ptr-to-stack-allocated-error -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-exclude-path=/third_party/dawn/ -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-exclude-path=base/logging.h -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-exclude-path=base/synchronization/lock_impl.h -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-exclude-path=base/check.h -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wno-shadow -Wctad-maybe-unsupported -DPROTOBUF_ALLOW_DEPRECATED=1 -Wno-c++11-narrowing-const-reference -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -fvisibility-inlines-hidden -c ../../third_party/webrtc/common_audio/fir_filter_neon.cc -o clang_x64_v8_arm64/obj/third_party/webrtc/common_audio/common_audio_neon/fir_filter_neon.o
clang++: error: unsupported option '-mfpu=' for target 'x86_64-unknown-linux-gnu'
[1 processes, 70444/102753 @ 3.8/s : 18745.128s ] CXX clang_x64_v8_arm64/obj/third_party/webrtc/common_audio/common_audio_cc/dot_product_with_scale.o
ninja: build stopped: subcommand failed.

Thanks in advance, love the project btw.

@Alex313031
Copy link
Owner

Alex313031 commented May 15, 2024

@vsharkovski Sorry you're having issues. M124 is almost out (I'm building the Linux versions right now). I will build the Android versions next, and fix any building issues that may occur.) When I am sure that it is good on my end, I will let you know here so you can try compiling again. If you have issues then we know it is on your end, and then I can help you with any issues you encounter

@Alex313031
Copy link
Owner

Alex313031 commented May 17, 2024

@vsharkovski I ran into the same issue. I fixed it, and can confirm that both arm32 and arm64 Android can be built properly now. Can you do a git pull and git submodule update --remote (for the libjxl submodule) to get the latest Thorium, and then try your build again.

@vsharkovski
Copy link
Author

@Alex313031 The build worked perfectly, thanks a ton.

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

2 participants