Message ID | 20180910085714.4834-2-joel@jms.id.au (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | powerpc: Clang build fixes | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | next/apply_patch Successfully applied |
snowpatch_ozlabs/checkpatch | success | Test checkpatch on branch next |
On Mon, Sep 10, 2018 at 06:57:13PM +1000, Joel Stanley wrote: > Clang's assembler does not like the syntax of the cmpdi: > > arch/powerpc/boot/crt0.S:168:22: error: unexpected modifier on variable reference > cmpdi 12,RELACOUNT@l > ^ > arch/powerpc/boot/crt0.S:168:11: error: unknown operand > cmpdi 12,RELACOUNT@l > ^ > Enclosing RELACOUNT in () makes it is happy. Tested with GCC 8 and Clang > 8 (trunk). Is clang going to fix this? You also might want to add a comment that this is a workaround for that broken assembler. Segher
On Tue, 11 Sep 2018 at 21:02, Segher Boessenkool <segher@kernel.crashing.org> wrote: > > On Mon, Sep 10, 2018 at 06:57:13PM +1000, Joel Stanley wrote: > > Clang's assembler does not like the syntax of the cmpdi: > > > > arch/powerpc/boot/crt0.S:168:22: error: unexpected modifier on variable reference > > cmpdi 12,RELACOUNT@l > > ^ > > arch/powerpc/boot/crt0.S:168:11: error: unknown operand > > cmpdi 12,RELACOUNT@l > > ^ > > Enclosing RELACOUNT in () makes it is happy. Tested with GCC 8 and Clang > > 8 (trunk). > > Is clang going to fix this? You also might want to add a comment that > this is a workaround for that broken assembler. I am not sure that we need a comment, it doesn't look too out of place compared to the other uses of wrapping symbols in (). I did open a bug against clang though in the hope that they can fix the behaviour: https://bugs.llvm.org/show_bug.cgi?id=38945 Cheers, Joel
diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S index dcf2f15e6797..ace3f3c64620 100644 --- a/arch/powerpc/boot/crt0.S +++ b/arch/powerpc/boot/crt0.S @@ -165,7 +165,7 @@ p_base: mflr r10 /* r10 now points to runtime addr of p_base */ ld r13,8(r11) /* get RELA pointer in r13 */ b 11f 10: addis r12,r12,(-RELACOUNT)@ha - cmpdi r12,RELACOUNT@l + cmpdi r12,(RELACOUNT)@l bne 11f ld r8,8(r11) /* get RELACOUNT value in r8 */ 11: addi r11,r11,16
Clang's assembler does not like the syntax of the cmpdi: arch/powerpc/boot/crt0.S:168:22: error: unexpected modifier on variable reference cmpdi 12,RELACOUNT@l ^ arch/powerpc/boot/crt0.S:168:11: error: unknown operand cmpdi 12,RELACOUNT@l ^ Enclosing RELACOUNT in () makes it is happy. Tested with GCC 8 and Clang 8 (trunk). Signed-off-by: Joel Stanley <joel@jms.id.au> --- arch/powerpc/boot/crt0.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)