diff mbox series

[1/2] codafs: Fix build using bare-metal toolchain

Message ID 20180828142421.15335-2-semen.protsenko@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series Fix allmodconfig build with bare-metal toolchain | expand

Commit Message

Sam Protsenko Aug. 28, 2018, 2:24 p.m. UTC
The kernel is self-contained project and can be built with bare-metal
toolchain. But bare-metal toolchain doesn't define u_quad_t type.
Because of this codafs build fails when building with bare-metal
toolchain. This patch fixes it by defining u_quad_t type in case when
non-Linux toolchain is used.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 include/uapi/linux/coda.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andy Shevchenko Aug. 28, 2018, 5:03 p.m. UTC | #1
On Tue, Aug 28, 2018 at 5:24 PM Sam Protsenko
<semen.protsenko@linaro.org> wrote:
>
> The kernel is self-contained project and can be built with bare-metal
> toolchain. But bare-metal toolchain doesn't define u_quad_t type.
> Because of this codafs build fails when building with bare-metal
> toolchain. This patch fixes it by defining u_quad_t type in case when
> non-Linux toolchain is used.

>  #endif /* !KERNEL */

I'm wondering what the heck KERNEL is doing in UAPI header.
Looks like this header is split wrongly in the first place.

> +#if defined(__KERNEL__) && !defined(__linux__) && !defined(_UQUAD_T_) && \

P.S. Actually it's the only header which uses KERNEL in UAPI.
Definitely it should be fixed first.

--
With Best Regards,
Andy Shevchenko
Andy Shevchenko Aug. 28, 2018, 5:07 p.m. UTC | #2
On Tue, Aug 28, 2018 at 8:03 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:

> P.S. Actually it's the only header which uses KERNEL in UAPI.
> Definitely it should be fixed first.

Okay, it seems I missed __ parts. So, my statement above is wrong.
Christoph Hellwig Aug. 29, 2018, 6:33 a.m. UTC | #3
Please just drop the ifdef entirely.  The file is part of the kernel
tree and can't be used for anything non-Linux.
Sam Protsenko Aug. 29, 2018, 2:03 p.m. UTC | #4
On Wed, Aug 29, 2018 at 9:33 AM, Christoph Hellwig <hch@infradead.org> wrote:
> Please just drop the ifdef entirely.  The file is part of the kernel
> tree and can't be used for anything non-Linux.

I have better idea :) We can modify include/linux/coda.h instead, by
checking for __KERNEL__ (along with existing check for __linux__).
This way we can leave user-space API header alone. Don't know how come
I didn't notice that in the first place... Anyway, will send v2
shortly. Thanks for the review.
diff mbox series

Patch

diff --git a/include/uapi/linux/coda.h b/include/uapi/linux/coda.h
index 695fade33c64..098a6c318b0a 100644
--- a/include/uapi/linux/coda.h
+++ b/include/uapi/linux/coda.h
@@ -96,6 +96,11 @@  typedef unsigned long long u_quad_t;
 #endif /* !KERNEL */
 #endif /* !DJGPP */
 
+/* Handle bare-metal toolchain case */
+#if defined(__KERNEL__) && !defined(__linux__) && !defined(_UQUAD_T_) && \
+!defined(__UQUAD_TYPE)
+typedef unsigned long long u_quad_t;
+#endif
 
 #if defined(__linux__)
 #include <linux/time.h>