[llvm-bugs] [Bug 38770] New: big-endian arm32 linux kernel builds fail

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 30 04:11:10 PDT 2018


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

            Bug ID: 38770
           Summary: big-endian arm32 linux kernel builds fail
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arnd at linaro.org
                CC: llvm-bugs at lists.llvm.org

The kernel uses "-no-integrated-as", so clang calls the GNU assembler instead.
When that assembler is targetted at little-endian output, we are missing the
-EB
flag, so the output ends up being little-endian anyway, and causing a link
failure in the end.

I could work around the problem by passing -EB to the assembler as well as the
linker, but I would expect this to be implied by -mbig-endian.

--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -45,8 +45,8 @@ KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs
-mno-sched-prolog
 endif

 ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
-KBUILD_CPPFLAGS        += -mbig-endian
-KBUILD_BIARCHFLAGS += -mbig-endian
+KBUILD_CPPFLAGS        += -mbig-endian -Wa,-EB
+KBUILD_BIARCHFLAGS += -mbig-endian -Wa,-EB
 CHECKFLAGS     += -D__ARMEB__
 AS             += -EB
 KBUILD_LDFLAGS += -EB
--- a/arch/arm/vdso/Makefile
+++ b/arch/arm/vdso/Makefile
@@ -17,6 +17,10 @@ VDSO_LDFLAGS += $(call cc-ldoption,
-Wl$(comma)--hash-style=sysv)
 VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--build-id)
 VDSO_LDFLAGS += $(call cc-ldoption, -fuse-ld=bfd)

+ifdef CONFIG_CPU_BIG_ENDIAN
+VDSO_LDFLAGS += -Wl,-EB
+endif
+
 obj-$(CONFIG_VDSO) += vdso.o
 extra-$(CONFIG_VDSO) += vdso.lds
 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)

-- 
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/20180830/8bbefd28/attachment.html>


More information about the llvm-bugs mailing list