Thread (103 messages) 103 messages, 16 authors, 2017-12-04

[PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

From: Segher Boessenkool <hidden>
Date: 2017-11-16 15:41:14
Also in: linux-kbuild, lkml

On Thu, Nov 16, 2017 at 04:07:42PM +0300, Yury Norov wrote:
quoted
quoted
Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros
in-place and workaround gcc and clang limitations on redefining macros
across different assembler blocks.
What limitations? Can you elaborate please? Is this a fix?
Regarding GCC.

When it joins preprocessed source files into single asm file,
mrs_s/msr_s becomes either not declared or declared multiple times.

./ccuFb68h.s:33120: Error: Macro `mrs_s' was already defined
./ccuFb68h.s:33124: Error: Macro `msr_s' was already defined

I'm not sure that GCC works correctly in this case, and I sent the
email to Linaro toolchain group to clarify it. See below.
The compiler is free to inline code, reorder code, duplicate code, etc.
Inline assembler is not exempt from this.

The compiler is fine, the assembler is fine (and the linker has nothing
to do with it).  Your code is not fine.


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help