llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

error: expected absolute expression

Open jcai19 opened this issue 7 years ago • 6 comments

Bugzilla Link 43795
Resolution FIXED
Resolved on Dec 17, 2020 17:04
Version trunk
OS Linux

Extended Description

While building Linux kernel for 32-bit ARM with LLVM's integrated assembler, I ran into the following error:

$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j32 CC=clang AS=clang arch/arm/mm/proc-v7.o

arch/arm/mm/proc-v7.S:169:143: error: expected absolute expression .pushsection ".alt.smp.init", "a" ; .long 9998b ;9997: orr r1, r1, #((1 << 0) | (1 << 6))|(3 << 3) ; .if . - 9997b == 2 ; nop ; .endif ; .if . - 9997b != 4 ; .error "ALT_UP() content must assemble to exactly 4 bytes"; .endif ; .popsection

The reason is in "if . - 9997b == 2" directive the temporary label created for the dot symbol and 9997 get assigned to two adjacent MCFragments in the same MCSection.

jcai19 avatar Oct 24 '19 22:10 jcai19

https://reviews.llvm.org/D69411 accepted and merged.

jcai19 avatar Dec 18 '20 01:12 jcai19

Please ignore my last comment. It was supposed to be for a different bug.

jcai19 avatar Jan 27 '20 23:01 jcai19

Fixed on kernel https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=790756c7e0229dedc83bf058ac69633045b1000e

jcai19 avatar Jan 27 '20 23:01 jcai19

Fixed on kernel https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=790756c7e0229dedc83bf058ac69633045b1000e

jcai19 avatar Jan 27 '20 23:01 jcai19

https://reviews.llvm.org/D69411

jcai19 avatar Oct 24 '19 22:10 jcai19

assigned to @jcai19

jcai19 avatar Oct 24 '19 22:10 jcai19