Skip to contentSkip to conversation

codafs: Fix build using bare-metal toolchain

PATCH In review Sam Protsenko 4 participants 10 messages Oct 30, 2018 – Jan 9, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 codafs: Fix build using bare-metal toolchain

The kernel is self-contained project and can be built with bare-metal toolchain. But bare-metal toolchain doesn't define __linux__. Because of this u_quad_t type is not defined when using bare-metal toolchain and codafs build fails. This patch fixes it by defining u_quad_t type unconditionally.

Cc Jan Harkes <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 include/linux/coda.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/coda.h +1 -2
index d30209b9cef8..0ca0c83fdb1c 100644
@@ -58,8 +58,7 @@ Mellon the rights to redistribute these changes without encumbrance.
 #ifndef _CODA_HEADER_
 #define _CODA_HEADER_
 
-#if defined(__linux__)
 typedef unsigned long long u_quad_t;
-#endif
+
 #include <uapi/linux/coda.h>
 #endif 
Signature · 1 line
2.19.1
#1 lore raw
Quoted 30 lines · Sam Protsenko

The kernel is self-contained project and can be built with bare-metal toolchain. But bare-metal toolchain doesn't define __linux__. Because of this u_quad_t type is not defined when using bare-metal toolchain and codafs build fails. This patch fixes it by defining u_quad_t type unconditionally.

Cc Jan Harkes <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 include/linux/coda.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/coda.h +1 -3
index d30209b9cef8..0ca0c83fdb1c 100644
@@ -58,8 +58,7 @@ Mellon the rights to redistribute these changes without encumbrance.
 #ifndef _CODA_HEADER_
 #define _CODA_HEADER_
 
-#if defined(__linux__)
 typedef unsigned long long u_quad_t;
-#endif
+
 #include <uapi/linux/coda.h>
 #endif
--
Quoted 2 lines

2.19.1

+ Jan Harkes, + Ruslan Bilovol

Hi Jan,

Can you please apply this? Nobody seems to be interested in taking this patch, so I'm not sure how to proceed further. Please advice.

Thanks!

#2 lore raw
Quoted 10 lines · Sam Protsenko
Quoted 7 lines · Sam Protsenko

The kernel is self-contained project and can be built with bare-metal toolchain. But bare-metal toolchain doesn't define __linux__. Because of this u_quad_t type is not defined when using bare-metal toolchain and codafs build fails. This patch fixes it by defining u_quad_t type unconditionally.

Quoted 3 lines
Quoted 3 lines
Cc Jan Harkes <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Andy Shevchenko <[email protected]>

I'm not sure how you managed to miss people in this list (perhaps by default you have suppress all Cc in your Git configuration), but I guess we may gently ask Christoph to apply this in case Jan will not appear.

Quoted 31 lines
Quoted 20 lines
---
 include/linux/coda.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/coda.h +1 -3
index d30209b9cef8..0ca0c83fdb1c 100644
@@ -58,8 +58,7 @@ Mellon the rights to redistribute these changes without encumbrance.
 #ifndef _CODA_HEADER_
 #define _CODA_HEADER_
 
-#if defined(__linux__)
 typedef unsigned long long u_quad_t;
-#endif
+
 #include <uapi/linux/coda.h>
 #endif
--
Quoted 2 lines

2.19.1

+ Jan Harkes, + Ruslan Bilovol

Hi Jan,

Can you please apply this? Nobody seems to be interested in taking this patch, so I'm not sure how to proceed further. Please advice.

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 4 lines · Andy Shevchenko

I'm not sure how you managed to miss people in this list (perhaps by default you have suppress all Cc in your Git configuration), but I guess we may gently ask Christoph to apply this in case Jan will not appear.

I don't really have a relevant tree. You probably want to send it to Al Viro.

maintainer
#4 lore raw
In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

I'm not sure how you managed to miss people in this list (perhaps by default you have suppress all Cc in your Git configuration), but I guess we may gently ask Christoph to apply this in case Jan will not appear.

You have got to give me a little more than 10 minutes to respond before assuming that I would not appear... I don't think I've ignored any previous emails on this subject and the only issues has been some people not receiving my responses for unknown reasons (agressive spam filter?).

I have no problem with this patch, have it sitting with some other non-urgent patches and in case it doesn't appear upstream it should piggyback with whatever I have to send.

I still don't know why the bare-metal toolchain couldn't just add a -D__linux__. I understand that this define is expected to be always present while compiling kernel headers so that there is no good reason to even bother testing for it, which is why I have no issue with the patch. But it seems it would make your life a lot easier if you had it defined.

Jan

#5 lore raw
Quoted 7 lines · Jan Harkes
Quoted 4 lines · Andy Shevchenko

I'm not sure how you managed to miss people in this list (perhaps by default you have suppress all Cc in your Git configuration), but I guess we may gently ask Christoph to apply this in case Jan will not appear.

Quoted 9 lines

You have got to give me a little more than 10 minutes to respond before assuming that I would not appear... I don't think I've ignored any previous emails on this subject and the only issues has been some people not receiving my responses for unknown reasons (agressive spam filter?).

I have no problem with this patch, have it sitting with some other non-urgent patches and in case it doesn't appear upstream it should piggyback with whatever I have to send.

Thanks, Jan, really appreciate it. We need this patch to fix our tests with allmodconfig configuration (in Linaro CI loops).

Quoted 7 lines

I still don't know why the bare-metal toolchain couldn't just add a -D__linux__. I understand that this define is expected to be always present while compiling kernel headers so that there is no good reason to even bother testing for it, which is why I have no issue with the patch. But it seems it would make your life a lot easier if you had it defined.

As I understand it, from toolchain's point of view, if __linux__ is defined then it means that the program is being built *for* Linux (i.e. we can use Linux specific features, ABI, like syscalls). Checking this definition can make sense in uapi headers, but in kernel code we shouldn't use it (as kernel is baremetal program and not compiled for some OS). I presume that's why __linux__ is not defined in bare-metal toolchains (as those don't provide Linux specific features, libc, etc).

Quoted 2 lines

Jan

#6 lore raw

+ Jan Harkes back to "To:" list, slipped away somehow...

Quoted 41 lines · Sam Protsenko
Quoted 7 lines · Jan Harkes
Quoted 4 lines · Andy Shevchenko

I'm not sure how you managed to miss people in this list (perhaps by default you have suppress all Cc in your Git configuration), but I guess we may gently ask Christoph to apply this in case Jan will not appear.

Quoted 9 lines

You have got to give me a little more than 10 minutes to respond before assuming that I would not appear... I don't think I've ignored any previous emails on this subject and the only issues has been some people not receiving my responses for unknown reasons (agressive spam filter?).

I have no problem with this patch, have it sitting with some other non-urgent patches and in case it doesn't appear upstream it should piggyback with whatever I have to send.

Thanks, Jan, really appreciate it. We need this patch to fix our tests with allmodconfig configuration (in Linaro CI loops).

Quoted 7 lines

I still don't know why the bare-metal toolchain couldn't just add a -D__linux__. I understand that this define is expected to be always present while compiling kernel headers so that there is no good reason to even bother testing for it, which is why I have no issue with the patch. But it seems it would make your life a lot easier if you had it defined.

As I understand it, from toolchain's point of view, if __linux__ is defined then it means that the program is being built *for* Linux (i.e. we can use Linux specific features, ABI, like syscalls). Checking this definition can make sense in uapi headers, but in kernel code we shouldn't use it (as kernel is baremetal program and not compiled for some OS). I presume that's why __linux__ is not defined in bare-metal toolchains (as those don't provide Linux specific features, libc, etc).

Quoted 2 lines

Jan

maintainer
#7 lore raw

That actually makes a lot of sense.

Jan

Quoted 58 lines · Sam Protsenko

+ Jan Harkes back to "To:" list, slipped away somehow...

Quoted 2 lines · Sam Protsenko

On Wed, Nov 21, 2018 at 8:10 PM Jan Harkes <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines · Andy Shevchenko
Quoted 1 line

I'm not sure how you managed to miss people in this list (perhaps

by

Quoted 1 line
Quoted 1 line
Quoted 1 line

default you have suppress all Cc in your Git configuration), but

I

Quoted 1 line
Quoted 1 line
Quoted 1 line

guess we may gently ask Christoph to apply this in case Jan will

not

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

appear.

You have got to give me a little more than 10 minutes to respond

before

Quoted 2 lines
Quoted 2 lines

assuming that I would not appear... I don't think I've ignored any previous emails on this subject and the only issues has been some

people

Quoted 1 line
Quoted 1 line

not receiving my responses for unknown reasons (agressive spam

filter?).

Quoted 7 lines
Quoted 5 lines

I have no problem with this patch, have it sitting with some other non-urgent patches and in case it doesn't appear upstream it should piggyback with whatever I have to send.

Thanks, Jan, really appreciate it. We need this patch to fix our

tests

Quoted 4 lines

with allmodconfig configuration (in Linaro CI loops).

Quoted 2 lines

I still don't know why the bare-metal toolchain couldn't just add a -D__linux__. I understand that this define is expected to be

always

Quoted 1 line
Quoted 1 line

present while compiling kernel headers so that there is no good

reason

Quoted 1 line
Quoted 1 line

to even bother testing for it, which is why I have no issue with

the

Quoted 1 line
Quoted 1 line

patch. But it seems it would make your life a lot easier if you had

it

Quoted 7 lines
Quoted 2 lines

defined.

As I understand it, from toolchain's point of view, if __linux__ is defined then it means that the program is being built *for* Linux (i.e. we can use Linux specific features, ABI, like syscalls). Checking this definition can make sense in uapi headers, but in

kernel

Quoted 7 lines

code we shouldn't use it (as kernel is baremetal program and not compiled for some OS). I presume that's why __linux__ is not defined in bare-metal toolchains (as those don't provide Linux specific features, libc, etc).

Quoted 2 lines

Jan

#8 lore raw

Hi Jan,

Can you please clarify on this patch? As I can see v5.0-rc1 is out now, which means merge window is closed, but I can't see this patch in linux-mainline yet. Do you need any additional steps from my side (like rebasing, etc)?

Thanks!

Quoted 64 lines · Jan Harkes

That actually makes a lot of sense.

Jan

Quoted 58 lines · Sam Protsenko

+ Jan Harkes back to "To:" list, slipped away somehow...

Quoted 2 lines · Sam Protsenko

On Wed, Nov 21, 2018 at 8:10 PM Jan Harkes <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines · Andy Shevchenko
Quoted 1 line

I'm not sure how you managed to miss people in this list (perhaps

by

Quoted 1 line
Quoted 1 line
Quoted 1 line

default you have suppress all Cc in your Git configuration), but

I

Quoted 1 line
Quoted 1 line
Quoted 1 line

guess we may gently ask Christoph to apply this in case Jan will

not

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

appear.

You have got to give me a little more than 10 minutes to respond

before

Quoted 2 lines
Quoted 2 lines

assuming that I would not appear... I don't think I've ignored any previous emails on this subject and the only issues has been some

people

Quoted 1 line
Quoted 1 line

not receiving my responses for unknown reasons (agressive spam

filter?).

Quoted 7 lines
Quoted 5 lines

I have no problem with this patch, have it sitting with some other non-urgent patches and in case it doesn't appear upstream it should piggyback with whatever I have to send.

Thanks, Jan, really appreciate it. We need this patch to fix our

tests

Quoted 4 lines

with allmodconfig configuration (in Linaro CI loops).

Quoted 2 lines

I still don't know why the bare-metal toolchain couldn't just add a -D__linux__. I understand that this define is expected to be

always

Quoted 1 line
Quoted 1 line

present while compiling kernel headers so that there is no good

reason

Quoted 1 line
Quoted 1 line

to even bother testing for it, which is why I have no issue with

the

Quoted 1 line
Quoted 1 line

patch. But it seems it would make your life a lot easier if you had

it

Quoted 7 lines
Quoted 2 lines

defined.

As I understand it, from toolchain's point of view, if __linux__ is defined then it means that the program is being built *for* Linux (i.e. we can use Linux specific features, ABI, like syscalls). Checking this definition can make sense in uapi headers, but in

kernel

Quoted 7 lines

code we shouldn't use it (as kernel is baremetal program and not compiled for some OS). I presume that's why __linux__ is not defined in bare-metal toolchains (as those don't provide Linux specific features, libc, etc).

Quoted 2 lines

Jan

#9 lore raw
In reply to Jan Harkes
Quoted 9 lines · Jan Harkes
Quoted 4 lines · Andy Shevchenko

I'm not sure how you managed to miss people in this list (perhaps by default you have suppress all Cc in your Git configuration), but I guess we may gently ask Christoph to apply this in case Jan will not appear.

You have got to give me a little more than 10 minutes to respond before assuming that I would not appear...

Problem is, AFAICS, Sam's initial Cc list was not fulfilled. As I guessed it might be configuration issue on his side.

Quoted 3 lines

I don't think I've ignored any
previous emails on this subject and the only issues has been some people not receiving my responses for unknown reasons (agressive spam filter?).

Personally I didn't get this one (Gmail "clever" spam filtering).

Signature · 2 lines
With Best Regards,
Andy Shevchenko