使用bazel为ARM交叉编译libjpeg_turbo

问题描述 投票:0回答:1

我正在尝试构建https://github.com/google/vr180,最后一次更新是5年前,但我想在我的设备上使用3D相机尝试该应用程序。

我已经修复了很多问题,你可以在这里找到: https://github.com/google/vr180/compare/master...cashlo:vr180:master

我现在遇到的错误是编译 libjpeg_turbo:

ERROR: /home/cashlo/.cache/bazel/_bazel_cashlo/fb1e4801723ba8ca32ad0cb068148412/external/libjpeg_turbo/BUILD.bazel:248:11: Compiling simd/arm/aarch64/jsimd_neon.S failed: (Exit 1): linux-sandbox failed: error executing CppCompile command 
  (cd /home/cashlo/.cache/bazel/_bazel_cashlo/fb1e4801723ba8ca32ad0cb068148412/sandbox/linux-sandbox/124/execroot/_main && \
  exec env - \
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /home/cashlo/.cache/bazel/_bazel_cashlo/install/ec66cb4ed623de0db7a7f89408b9b468/linux-sandbox -t 15 -w /dev/shm -w /home/cashlo/.cache/bazel/_bazel_cashlo/fb1e4801723ba8ca32ad0cb068148412/sandbox/linux-sandbox/124/execroot/_main -w /tmp -M /home/cashlo/.cache/bazel/_bazel_cashlo/fb1e4801723ba8ca32ad0cb068148412/sandbox/linux-sandbox/124/_hermetic_tmp -m /tmp -S /home/cashlo/.cache/bazel/_bazel_cashlo/fb1e4801723ba8ca32ad0cb068148412/sandbox/linux-sandbox/124/stats.out -D /home/cashlo/.cache/bazel/_bazel_cashlo/fb1e4801723ba8ca32ad0cb068148412/sandbox/linux-sandbox/124/debug.out -- /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -MD -MF bazel-out/k8-fastbuild-android-ST-5b74a929aefd/bin/external/libjpeg_turbo/_objs/libjpegturbo_simd_armv7a/jsimd_neon.pic.d -fPIC -iquote external/libjpeg_turbo -iquote bazel-out/k8-fastbuild-android-ST-5b74a929aefd/bin/external/libjpeg_turbo -isystem external/libjpeg_turbo/simd/arm -isystem bazel-out/k8-fastbuild-android-ST-5b74a929aefd/bin/external/libjpeg_turbo/simd/arm -O3 -w -D__ARM_NEON__ '-march=armv7-a' -fprefetch-loop-arrays -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/libjpeg_turbo/simd/arm/aarch64/jsimd_neon.S -o bazel-out/k8-fastbuild-android-ST-5b74a929aefd/bin/external/libjpeg_turbo/_objs/libjpegturbo_simd_armv7a/jsimd_neon.pic.o)
cc1: error: bad value 'armv7-a' for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native

我想需要通过在 BUILD.libjpeg_turbo 文件中使用 ARM 版本的 gcc 来修复?

https://github.com/cashlo/vr180/blob/master/cpp/third_party/BUILD.libjpeg_turbo

android linux bazel virtual-reality
1个回答
0
投票

这是由 Bazel 7.0 中的更改引起的,添加标志

--noincompatible_enable_android_toolchain_resolution
修复了该问题。

© www.soinside.com 2019 - 2024. All rights reserved.