Re: [PATCH] kbuild: make Clang build userprogs for target architecture

2020-07-05 Thread Miguel Ojeda
Hi Masahiro, On Sun, Jul 5, 2020 at 5:30 PM Masahiro Yamada wrote: > > Hmm, adding '#include ' did not make any difference. That should have worked, because POSIX defines it to be there. It sounds like you need --sysroot to point it to the proper ones. > If I add -std=c99, I get a different err

Re: [PATCH] kbuild: make Clang build userprogs for target architecture

2020-07-05 Thread Masahiro Yamada
On Wed, Jul 1, 2020 at 4:13 AM Miguel Ojeda wrote: > > On Tue, Jun 30, 2020 at 6:26 PM Masahiro Yamada wrote: > > > > I can reproduce this in the following > > simple test code: > > > > > > ->8 > > #include > > > > int main(void) > > { > > ssize_t x = 1; >

Re: [PATCH] kbuild: make Clang build userprogs for target architecture

2020-06-30 Thread Miguel Ojeda
On Tue, Jun 30, 2020 at 6:26 PM Masahiro Yamada wrote: > > I can reproduce this in the following > simple test code: > > > ->8 > #include > > int main(void) > { > ssize_t x = 1; > > printf("%zd", x); > > return 0; > } > --->8

Re: [PATCH] kbuild: make Clang build userprogs for target architecture

2020-06-30 Thread Masahiro Yamada
On Tue, Jun 30, 2020 at 2:39 AM Nick Desaulniers wrote: > > On Mon, Jun 29, 2020 at 1:59 AM Masahiro Yamada wrote: > > > > Programs added 'userprogs' should be compiled for the target > > architecture i.e. the same architecture as the kernel. > > > > GCC does this correctly since the target archi

Re: [PATCH] kbuild: make Clang build userprogs for target architecture

2020-06-29 Thread Nick Desaulniers
On Mon, Jun 29, 2020 at 1:59 AM Masahiro Yamada wrote: > > Programs added 'userprogs' should be compiled for the target > architecture i.e. the same architecture as the kernel. > > GCC does this correctly since the target architecture is implied > by the toolchain prefix. > > Clang builds standalo

[PATCH] kbuild: make Clang build userprogs for target architecture

2020-06-29 Thread Masahiro Yamada
Programs added 'userprogs' should be compiled for the target architecture i.e. the same architecture as the kernel. GCC does this correctly since the target architecture is implied by the toolchain prefix. Clang builds standalone programs always for the host architecture because the target triple