[llvm-bugs] [Bug 49023] New: clang's integrated assembler doesn't permit setting -Wa, -mimplicit-it=always

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 3 11:21:26 PST 2021


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

            Bug ID: 49023
           Summary: clang's integrated assembler doesn't permit setting
                    -Wa,-mimplicit-it=always
           Product: clang
           Version: trunk
          Hardware: PC
               URL: https://github.com/ClangBuiltLinux/linux/issues/1270
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ndesaulniers at google.com
                CC: arnd at linaro.org, caij2003 at gmail.com,
                    david.spickett at linaro.org, htmldeveloper at gmail.com,
                    kristof.beyls at arm.com, llozano at chromium.org,
                    llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk, srhines at google.com
            Blocks: 4068

While it seems we can use the internal flag `-mllvm --arm-implicit-it=always`,
it would be good to support the more canonical -Wa,-mimplicit-it=always form as
well. This is used by the Linux kernel when building a 32b THUMB2 image.


Otherwise, clang will fail when using the integrated assembler for inline asm,
example:

In file included from arch/arm/mach-imx/pm-imx6.c:19:
In file included from ./include/linux/suspend.h:5:
In file included from ./include/linux/swap.h:9:
In file included from ./include/linux/memcontrol.h:13:
In file included from ./include/linux/cgroup.h:28:
In file included from ./include/linux/cgroup-defs.h:22:
In file included from ./include/linux/bpf-cgroup.h:5:
In file included from ./include/linux/bpf.h:21:
In file included from ./include/linux/kallsyms.h:12:
In file included from ./include/linux/mm.h:33:
In file included from ./include/linux/pgtable.h:6:
In file included from ./arch/arm/include/asm/pgtable.h:25:
./arch/arm/include/asm/tlbflush.h:342:2: error: predicated instructions must be
in IT block
        tlb_op(TLB_V7_UIS_FULL, "c8, c7, 0", zero);
        ^
./arch/arm/include/asm/tlbflush.h:320:30: note: expanded from macro 'tlb_op'
#define tlb_op(f, regs, arg)    __tlb_op(f, "p15, 0, %0, " regs, arg)
                                ^
./arch/arm/include/asm/tlbflush.h:314:21: note: expanded from macro '__tlb_op'
                        asm("tst %1, %2\n\t"                            \
                                         ^
<inline asm>:2:2: note: instantiated into assembly here
        mcrne p15, 0, r2, c8, c7, 0
        ^


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
-- 
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/20210203/219d111b/attachment-0001.html>


More information about the llvm-bugs mailing list