[llvm-bugs] [Bug 46630] New: call_apsr.S fails to build during builtins test

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 7 21:24:43 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46630

            Bug ID: 46630
           Summary: call_apsr.S fails to build during builtins test
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: builtins
          Assignee: unassignedbugs at nondot.org
          Reporter: p.waydan at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23700
  --> https://bugs.llvm.org/attachment.cgi?id=23700&action=edit
cmake arguments

I successful built and linked the compiler-rt builtins for armv6m using an
Alpine Linux docker image. Most of the tests pass, but I still have four
failures.

********************
********************
Failed Tests (4):
  Builtins-armv6m-linux :: arm/aeabi_cdcmpeq_test.c
  Builtins-armv6m-linux :: arm/aeabi_cdcmple_test.c
  Builtins-armv6m-linux :: arm/aeabi_cfcmpeq_test.c
  Builtins-armv6m-linux :: arm/aeabi_cfcmple_test.c


Testing Time: 10.56s
  Unsupported      :  94
  Passed           : 104
  Expectedly Failed:   1
  Failed           :   4

Looking at the fail logs, I can see that call_apsr.S could not be compiled
correctly.

: 'RUN: at line 2';       /usr/bin/clang  -c -march=armv6m
/tmp/llvm-project/compiler-rt/test/builtins/Unit/arm/call_apsr.S -o
/tmp/llvm-project/build-rt/test/builtins/Unit/ARMV6MLinuxConfig/arm/Output/aeabi_cfcmple_test.c.tmp.aspr.o

Trying the above compilation command directly from the terminal gives the
following error:

error: unknown target CPU 'armv6m'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom,
silvermont, slm, goldmont, goldmont-plus,
      tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge,
core-avx-i, haswell, core-avx2,
      broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake,
cannonlake, icelake-client, icelake-server,
      tigerlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3,
athlon64-sse3, opteron-sse3, amdfam10,
      barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1,
znver2, x86-64

All these targets are x86 which indicates that clang is targeting the host
machine.

I found the relative code in compiler-rt/test/builtins/Unit/lit.cfg.py lines
84:90.

# FIXME: move the call_apsr.s into call_apsr.h as inline-asm.
# some ARM tests needs call_apsr.s
call_apsr_source = os.path.join(builtins_lit_source_dir, 'arm', 'call_apsr.S')
march_flag = '-march=' + target_arch
call_apsr_flags = ['-c', march_flag, call_apsr_source]
config.substitutions.append( ("%arm_call_apsr ", \
                              build_invocation(call_apsr_flags)) )

So lit.cfg.py is calling clang with an -march argument and no -target argument.
I can solve the issue and successfully build and run the tests by adding
--target=arm-none-eabi to the call_apsr_flags list, but this is not an
acceptable argument if compiling with gcc.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200708/a4f9edbb/attachment.html>


More information about the llvm-bugs mailing list