Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected token in '.ascii' directive #1196

Closed
nickdesaulniers opened this issue Nov 9, 2020 · 6 comments
Closed

unexpected token in '.ascii' directive #1196

nickdesaulniers opened this issue Nov 9, 2020 · 6 comments
Assignees
Labels
[ARCH] arm32 This bug impacts ARCH=arm [BUG] llvm A bug that should be fixed in upstream LLVM [FIXED][LLVM] 12 This bug was fixed in LLVM 12.0 [TOOL] integrated-as The issue is relevant to LLVM integrated assembler

Comments

@nickdesaulniers
Copy link
Member

linux-next allyesconfig:

ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make LLVM=1 LLVM_IAS=1 -j71 arch/arm/probes/kprobes/test-arm.o
...
arch/arm/probes/kprobes/test-arm.c:131:2: error: unexpected token in '.ascii' directive
        DATA_PROCESSING_DNM("and",0xf00f00ff)
        ^
arch/arm/probes/kprobes/test-arm.c:81:2: note: expanded from macro 'DATA_PROCESSING_DNM'
        _DATA_PROCESSING_DNM(op,"",val)         \
        ^
arch/arm/probes/kprobes/test-arm.c:58:2: note: expanded from macro '_DATA_PROCESSING_DNM'
        TEST_RR(  op "eq" s "   r0,  r",1, VAL1,", r",2, val, "")               \
        ^
arch/arm/probes/kprobes/test-core.h:239:2: note: expanded from macro 'TEST_RR'
        TESTCASE_START(code1 #reg1 code2 #reg2 code3)           \
        ^
arch/arm/probes/kprobes/test-core.h:113:14: note: expanded from macro 'TESTCASE_START'
        "10:                                            \n\t"   \
                                                          ^
<inline asm>:4:15: note: instantiated into assembly here
        .ascii "and" "eq" "" "  r0,  r" "1" ", r" "2" ""                                
                     ^
@nickdesaulniers nickdesaulniers added [BUG] Untriaged Something isn't working [TOOL] integrated-as The issue is relevant to LLVM integrated assembler [ARCH] arm32 This bug impacts ARCH=arm labels Nov 9, 2020
@nickdesaulniers
Copy link
Member Author

@nickdesaulniers
Copy link
Member Author

via CONFIG_KPROBES (need to disable CONFIG_KGDB to disable CONFIG_KPROBES from allyesconfig)

@jcai19 jcai19 self-assigned this Nov 13, 2020
@jcai19
Copy link
Member

jcai19 commented Nov 13, 2020

@nickdesaulniers nickdesaulniers added [PATCH] Submitted A patch has been submitted for review [BUG] llvm A bug that should be fixed in upstream LLVM and removed [BUG] Untriaged Something isn't working labels Nov 14, 2020
@jcai19
Copy link
Member

jcai19 commented Nov 14, 2020

Clang supports multiple arguments but they have to be comma separated. Is this the only place we need to fix? If so maybe we can fix this on Linux upstream instead?

@nickdesaulniers
Copy link
Member Author

/* don't use .asciz here as 'title' may be */ \
/* multiple strings to be concatenated. */ \
".ascii "#title" \n\t" \

Maybe if TESTCASE_START could be converted to a variadic macro. Though it also describes a difference between .ascii vs .asciz that I think is coming up in code review of https://reviews.llvm.org/D91460.

jcai19 added a commit to llvm/llvm-project that referenced this issue Dec 21, 2020
Currently the integrated assembler only allows commas as the separator
between string arguments in .ascii. This patch adds support to using
space as separators and make IAS consistent with GNU assembler.

Link: ClangBuiltLinux/linux#1196

Reviewed By: nickdesaulniers, jrtc27

Differential Revision: https://reviews.llvm.org/D91460
@jcai19
Copy link
Member

jcai19 commented Dec 21, 2020

LLVM patch accepted and merged.

@nickdesaulniers nickdesaulniers added [FIXED][LLVM] 12 This bug was fixed in LLVM 12.0 and removed [PATCH] Submitted A patch has been submitted for review labels Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] arm32 This bug impacts ARCH=arm [BUG] llvm A bug that should be fixed in upstream LLVM [FIXED][LLVM] 12 This bug was fixed in LLVM 12.0 [TOOL] integrated-as The issue is relevant to LLVM integrated assembler
Projects
None yet
Development

No branches or pull requests

2 participants