* linker tables on powerpc - build issues
@ 2016-08-02 21:14 Luis R. Rodriguez
2016-08-03 11:40 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Luis R. Rodriguez @ 2016-08-02 21:14 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, Fengguang Wu, Guenter Roeck, linux-kernel
I've run into a few compilation issues with linker tables support [0]
[1] on only a few architectures:
blackfin - compiler issue it seems, I have a work around now in place
arm - some alignment issue - still need to iron this out
powerpc - issue with including <asm/sections.h> on <asm/jump_labels.h>
The issue with powerpc can be replicated easily with the patch below,
and compilation fails even on a 'make defconfig' configuration, the
issues are recurring include header ordering issues. I've given this
some tries to fix but am still a bit bewildered how to best do this
without affecting non-powerpc compilations. The patch below
replicates the changes in question, it does not include the linker
table work at all, it just includes <asm/sections.h> instead of
<asm/tables.h> to reduce and provide an example of the issues
observed. The list of errors are also pretty endless... so was hoping
some power folks might be able to take a glance if possible. If you
have any ideas, please let me know.
[0] https://lkml.kernel.org/r/1469222687-1600-1-git-send-email-mcgrof@kernel.org
[1] https://git.kernel.org/cgit/linux/kernel/git/mcgrof/linux-next.git/log/?h=20160729-linker-table-v4-blackfin2
diff --git a/arch/powerpc/include/asm/jump_label.h
b/arch/powerpc/include/asm/jump_label.h
index 9a287e0ac8b1..68e46825b0f8 100644
--- a/arch/powerpc/include/asm/jump_label.h
+++ b/arch/powerpc/include/asm/jump_label.h
@@ -9,6 +9,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <asm/sections.h>
#ifndef __ASSEMBLY__
#include <linux/types.h>
diff --git a/arch/powerpc/include/asm/sections.h
b/arch/powerpc/include/asm/sections.h
index 7dc006b58369..929decb62d9c 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -1,11 +1,14 @@
#ifndef _ASM_POWERPC_SECTIONS_H
#define _ASM_POWERPC_SECTIONS_H
-#ifdef __KERNEL__
+#if defined(__KERNEL__) && !defined(__ASSEMBLER__) && !defined(__ASSEMBLY__)
#include <linux/elf.h>
#include <linux/uaccess.h>
+#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) &&
!defined(__ASSEMBLY__) */
+
#include <asm-generic/sections.h>
+#if defined(__KERNEL__) && !defined(__ASSEMBLER__) && !defined(__ASSEMBLY__)
#ifdef __powerpc64__
extern char __start_interrupts[];
@@ -77,5 +80,5 @@ static inline void *dereference_function_descriptor(void *ptr)
#endif
-#endif /* __KERNEL__ */
+#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) &&
!defined(__ASSEMBLY__) */
#endif /* _ASM_POWERPC_SECTIONS_H */
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index af0254c09424..06bceee909da 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -1,6 +1,8 @@
#ifndef _ASM_GENERIC_SECTIONS_H_
#define _ASM_GENERIC_SECTIONS_H_
+#if defined(__KERNEL__) && !defined(__ASSEMBLER__) && !defined(__ASSEMBLY__)
+
/* References to section boundaries */
#include <linux/compiler.h>
@@ -128,4 +130,6 @@ static inline bool init_section_intersects(void
*virt, size_t size)
return memory_intersects(__init_begin, __init_end, virt, size);
}
+#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) &&
!defined(__ASSEMBLY__) */
+
#endif /* _ASM_GENERIC_SECTIONS_H_ */
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: linker tables on powerpc - build issues
2016-08-02 21:14 linker tables on powerpc - build issues Luis R. Rodriguez
@ 2016-08-03 11:40 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-08-03 11:40 UTC (permalink / raw)
To: Luis R. Rodriguez, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, Fengguang Wu, Guenter Roeck, linux-kernel
"Luis R. Rodriguez" <mcgrof@do-not-panic.com> writes:
> I've run into a few compilation issues with linker tables support [0]
> [1] on only a few architectures:
>
> blackfin - compiler issue it seems, I have a work around now in place
> arm - some alignment issue - still need to iron this out
> powerpc - issue with including <asm/sections.h> on <asm/jump_labels.h>
>
> The issue with powerpc can be replicated easily with the patch below,
> and compilation fails even on a 'make defconfig' configuration, the
> issues are recurring include header ordering issues. I've given this
> some tries to fix but am still a bit bewildered how to best do this
> without affecting non-powerpc compilations. The patch below
> replicates the changes in question, it does not include the linker
> table work at all, it just includes <asm/sections.h> instead of
> <asm/tables.h> to reduce and provide an example of the issues
> observed. The list of errors are also pretty endless... so was hoping
> some power folks might be able to take a glance if possible. If you
> have any ideas, please let me know.
What is the end goal?
You want to be able to include asm/sections.h in asm/jump_labels.h? So
that you can get some macros to wrap the pushsection etc, am I right?
The biggest problem I see is dereference_function_descriptor(), which
uses probe_kernel(), which pulls in uaccess.h.
But it doesn't really make sense for dereference_function_descriptor()
to be in sections.h AFAICS.
I'll see if I can unstitch it tomorrow.
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-03 11:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 21:14 linker tables on powerpc - build issues Luis R. Rodriguez
2016-08-03 11:40 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®