[llvm-bugs] [Bug 31590] New: FreeBSD clang 3.91 TARGET_ARCH=powerpc64 context: clang 3.9.1 can not compile/assemble the likes of llvm/projects/libunwind/src/UnwindRegistersSave.S

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 9 13:22:56 PST 2017


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

            Bug ID: 31590
           Summary: FreeBSD clang 3.91 TARGET_ARCH=powerpc64 context:
                    clang 3.9.1 can not compile/assemble the likes of
                    llvm/projects/libunwind/src/UnwindRegistersSave.S
           Product: libraries
           Version: 3.9
          Hardware: Macintosh
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: markmi at dsl-only.net
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

[I experiment with trying to use clang as the system
compiler for powerpc64 and powerpc.
I placed the report based on the assumption that clang is
supposed to be able to parse the likes of:
llvm/projects/libunwind/src/UnwindRegistersRestore.S
and
llvm/projects/libunwind/src/UnwindRegistersSave.S
for powerpc64 and for powerpc. If the UnwindRegisters*.S
notation is wrong then this submittal will need to be
reclassified to report the notation needing to be
fixed.]

Under head (-r311147 or so) of FreeBSD I attempted to build
using llvm's libunwind on & for powerpc64 (via the standard
FreeBSD build tools). This used FreeBSD's system clang 3.9.1
variant.

The result was reporting of syntax errors for the
UnwindRegisters*.S files (for example).

For example ";" was not treated as a start-of-comment and
the rest of the lines were parsed and reported on.

Another example is complaining about r3 in:
stw r0, 8(r3)

There are other types of examples as well.

Justin Hibbits reported the following about the notation:

The naked 'r*' and 'f*' register designations are a Darwinism.
SysV notation requires '%r*' and '%f*', or naked numbers.

(So it may be that the UnwindRegisters*.S files are not
correct?)

Supporting details:

/usr/bin/clang -B /usr/local/powerpc64-freebsd/bin/ -target
powerpc64-unknown-freebsd12.0
--sysroot=/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc.powerpc64/usr/src/tmp
-B/usr/local/powerpc64-freebsd/bin/ -O2 -pipe  
-I/usr/src/contrib/llvm/projects/libunwind/include -I/usr/src/lib/libgcc_eh
-D_LIBUNWIND_IS_NATIVE_ONLY -std=gnu99 -Wsystem-headers -Wall -Wno-format-y2k
-Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
-Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value
-Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
-Wno-unused-local-typedef -Wno-switch -Wno-switch-enum
-Wno-knr-promoted-parameter  -Qunused-arguments    -c
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S -o
UnwindRegistersSave.o

reported the likes of:

. . .
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:104:3:
error: unrecognized instruction mnemonic
; On entry:
  ^
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:104:11:
error: unexpected token at start of statement
; On entry:
          ^
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:105:3:
error: unrecognized instruction mnemonic
; thread_state pointer is in r3
  ^
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:105:24:
error: unrecognized instruction mnemonic
; thread_state pointer is in r3
                       ^
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:105:30:
error: unrecognized instruction mnemonic
; thread_state pointer is in r3
                             ^
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:107:23:
error: unexpected token in directive
.globl unw_getcontext @ .type unw_getcontext, at function @ unw_getcontext:
                      ^
/usr/src/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S:108:13:
error: invalid memory operand
  stw r0, 8(r3)
            ^
. . .

-- 
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/20170109/e9c427c0/attachment-0001.html>


More information about the llvm-bugs mailing list