<p dir="auto">I'm cross compiling from linux to arm using a custom cross tool and getting the following error. It looks like it is switching the arch from arm to x86_64 during the build of the standard library.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/linux_arm_stripped/stdlib%/pkg failed (Exit 1) process-wrapper failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/__main__ &amp;&amp; \
  exec env - \
    CC=tools/compilers/arm/gcc/clang/clang \
    CGO_CFLAGS='--sysroot=external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot --target=armv6z-raspberrypi-linux-gnueabihf -mfloat-abi=hard -mfpu=vfp -isystem external/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0/include -isystem external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/usr/include -isystem external/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0/include-fixed -U_FORTIFY_SOURCE -fstack-protector -fPIE -fdiagnostics-color=always -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=&quot;redacted&quot; -D__TIMESTAMP__=&quot;redacted&quot; -D__TIME__=&quot;redacted&quot;' \
    CGO_ENABLED=1 \
    CGO_LDFLAGS='--sysroot=external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot -lstdc++ -latomic -lm -lpthread -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/lib -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/lib -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Lexternal/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0 -Bexternal/arm_compiler/arm-buildroot-linux-gnueabihf/bin -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -no-canonical-prefixes -pie -Wl,-z,relro,-z,now' \
    GOARCH=arm \
    GOOS=linux \
    GOROOT=external/go_sdk \
    GOROOT_FINAL=GOROOT \
    PATH=tools/compilers/arm/gcc:tools/compilers/arm/gcc/clang:/bin:/usr/bin \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/__main__/_bin/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/stdlib -sdk external/go_sdk -installsuffix linux_arm -out bazel-out/armeabi-v7a-fastbuild/bin/external/io_bazel_rules_go/linux_arm_stripped/stdlib% -filter_buildid bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/filter_buildid)
# runtime/cgo
arm-buildroot-linux-gneabihf-ld: unrecognised emulation mode: elf_x86_64
Supported emulations: armelf_linux_eabi armelfb_linux_eabi"><pre class="notranslate"><code class="notranslate">/root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/linux_arm_stripped/stdlib%/pkg failed (Exit 1) process-wrapper failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/__main__ &amp;&amp; \
  exec env - \
    CC=tools/compilers/arm/gcc/clang/clang \
    CGO_CFLAGS='--sysroot=external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot --target=armv6z-raspberrypi-linux-gnueabihf -mfloat-abi=hard -mfpu=vfp -isystem external/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0/include -isystem external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/usr/include -isystem external/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0/include-fixed -U_FORTIFY_SOURCE -fstack-protector -fPIE -fdiagnostics-color=always -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"' \
    CGO_ENABLED=1 \
    CGO_LDFLAGS='--sysroot=external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot -lstdc++ -latomic -lm -lpthread -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/lib -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/lib -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Lexternal/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0 -Bexternal/arm_compiler/arm-buildroot-linux-gnueabihf/bin -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -no-canonical-prefixes -pie -Wl,-z,relro,-z,now' \
    GOARCH=arm \
    GOOS=linux \
    GOROOT=external/go_sdk \
    GOROOT_FINAL=GOROOT \
    PATH=tools/compilers/arm/gcc:tools/compilers/arm/gcc/clang:/bin:/usr/bin \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/__main__/_bin/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/stdlib -sdk external/go_sdk -installsuffix linux_arm -out bazel-out/armeabi-v7a-fastbuild/bin/external/io_bazel_rules_go/linux_arm_stripped/stdlib% -filter_buildid bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/filter_buildid)
# runtime/cgo
arm-buildroot-linux-gneabihf-ld: unrecognised emulation mode: elf_x86_64
Supported emulations: armelf_linux_eabi armelfb_linux_eabi
</code></pre></div>

<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Operating System / Platform =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Compiler =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
</ul>
<h5 dir="auto">Detailed description</h5>

<h5 dir="auto">Steps to reproduce</h5>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Several builds (e.g. <a href="http://pullrequest.opencv.org/buildbot/builders/precommit_linux64_no_opt/builds/17355" rel="nofollow">this</a> and <a href="http://pullrequest.opencv.org/buildbot/builders/precommit_linux64_no_opt/builds/17347" rel="nofollow">this</a>) are failing, due to bad parsing of the test results..</p>
<h5 dir="auto">Actual results</h5>
<p dir="auto">Failure with the following status:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test_dnn test_dnn ; cases (tests): 0 (0) ; passed: 695 ; failed "><pre class="notranslate"><code class="notranslate">test_dnn test_dnn ; cases (tests): 0 (0) ; passed: 695 ; failed 
</code></pre></div>
<h5 dir="auto">Expected results</h5>
<p dir="auto">Success with the following status:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test_dnn test_dnn ; cases (tests): 60 (887) ; passed: 887 ; "><pre class="notranslate"><code class="notranslate">test_dnn test_dnn ; cases (tests): 60 (887) ; passed: 887 ; 
</code></pre></div>