[llvm-bugs] [Bug 38559] New: Driver does not honour "-mthumb" for pre-processed assembler and assembler jobs.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Aug 14 05:14:49 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38559
Bug ID: 38559
Summary: Driver does not honour "-mthumb" for pre-processed
assembler and assembler jobs.
Product: new-bugs
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: iains-llvm at btconnect.com
CC: llvm-bugs at lists.llvm.org
Created attachment 20710
--> https://bugs.llvm.org/attachment.cgi?id=20710&action=edit
Recognise -mthumb for assembler tasks.
Ran into this trying to build newlib.
case 1;
we invoke with
./bin/clang -target arm-none-linux-gnu -mcpu=cortex-a7 -mfpu=neon-vfpv4
-mfloat-abi=hard -mthumb /src/test-arm/thumb-mode.S -c
The driver constructs two jobs (1) to pre-process the ".S" file and (2) to
assemble the resulting ".s" file.
the ivocation for the first job is correct ; the "triple" is updated to
"thumbv7".
./bin/clang -cc1 -triple thumbv7-none-linux-gnu -E -save-temps=cwd
the invocation for the second is not : the triple is not updated :
./bin/clang -cc1as -triple armv7-none-linux-gnu
case 2:
./bin/clang -target arm-none-linux-gnu -mcpu=cortex-a7 -mfpu=neon-vfpv4
-mfloat-abi=hard -mthumb thumb-mode.s -c -save-temps
the 'triple' is again not updated to include the thumb component - the cc1as
mode does not recognise -mthumb (but only -Wa/Xassembler -mthumb).
output in both cases:
/src/test-arm/thumb-mode.S:16:2: error: instruction requires: thumb
cbnz r0, .Ltail
===
proposed fix (attached) - recognise the -mthumb flag for assembler tasks this
is consistent with other tools.
alternate fix ; the driver could intercept the thumb flag and push back the
Xassembler -mthumb option. This seems more complex.
===
However, since the current behaviour seems deliberate (there is a driver test
case matching it) - so it's not clear what the intent should be (e.g. does we
expect the user to enter "-mthumb -Wa,-mthumb" ?)
===
test-case
$ more /src/test-arm/thumb-mode.S
#define synd r0
.syntax unified
.arch armv7-a
.fpu neon
.text
.thumb_func
.global foo
.type foo,%function
.cfi_startproc
foo:
cbnz synd, .Ltail
nop
nop
nop
.Ltail:
nop
bx lr
.cfi_endproc
.size foo, . - foo
--
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/20180814/ad60bcea/attachment.html>
More information about the llvm-bugs
mailing list