* possible problem with generic asm/types.h
@ 2013-05-25 15:14 Mark Salter
2013-05-25 16:01 ` Geert Uytterhoeven
2013-05-26 10:32 ` Arnd Bergmann
0 siblings, 2 replies; 7+ messages in thread
From: Mark Salter @ 2013-05-25 15:14 UTC (permalink / raw)
To: linux-arch; +Cc: Arnd Bergmann, catalin.marinas
While building some stuff for aarch64, I ran into a conflict between
the kernel's definition of __s64 and glibc's definition of int64_t.
The package I was building (fuse) does this:
#include <stdint.h>
#define __s64 int64_t
The kernel typedefs __s64 in asm/types.h and due to ordering of includes
in the fuse package sources, the kernel __s64 gets used at some points
while the fuse __s64 gets used in others. This leads to a build failure
on aarch64 because glibc typedefs int64_t as a long while kernel uses
long long for __s64. Both are 64bits but it creates a type conflict in
some of the fuse code. But this same fuse code builds on other arches so
I looked a further and found what I think is a problem with the kernel's
asm-generic/types.h file which has:
/*
* int-ll64 is used practically everywhere now,
* so use it as a reasonable default.
*/
#include <asm-generic/int-ll64.h>
Shouldn't this be:
#include <asm/bitsperlong.h>
#if __BITS_PER_LONG == 64
#include <asm-generic/int-l64.h>
#else
#include <asm-generic/int-ll64.h>
#endif
--Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: possible problem with generic asm/types.h
2013-05-25 15:14 possible problem with generic asm/types.h Mark Salter
@ 2013-05-25 16:01 ` Geert Uytterhoeven
2013-05-25 16:37 ` Mark Salter
2013-05-26 10:32 ` Arnd Bergmann
1 sibling, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2013-05-25 16:01 UTC (permalink / raw)
To: Mark Salter; +Cc: Linux-Arch, Arnd Bergmann, Catalin Marinas
On Sat, May 25, 2013 at 5:14 PM, Mark Salter <msalter@redhat.com> wrote:
> /*
> * int-ll64 is used practically everywhere now,
This comment is obsolete, it's used everywhere now.
> * so use it as a reasonable default.
> */
> #include <asm-generic/int-ll64.h>
>
> Shouldn't this be:
>
> #include <asm/bitsperlong.h>
> #if __BITS_PER_LONG == 64
> #include <asm-generic/int-l64.h>
> #else
> #include <asm-generic/int-ll64.h>
> #endif
No. Inside the kernel, all 64-bit platforms use int-ll64.h.
For backwards compatibility, alpha, ia64, mips, and powerpc (unless
__SANE_USERSPACE_TYPES__ is defined) still use int-l64.h in userspace.
So it seems your glibc ues the old convention. Any chance you can still
switch?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: possible problem with generic asm/types.h
2013-05-25 16:01 ` Geert Uytterhoeven
@ 2013-05-25 16:37 ` Mark Salter
2013-05-25 16:39 ` Geert Uytterhoeven
0 siblings, 1 reply; 7+ messages in thread
From: Mark Salter @ 2013-05-25 16:37 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux-Arch, Arnd Bergmann, Catalin Marinas
On Sat, 2013-05-25 at 18:01 +0200, Geert Uytterhoeven wrote:
> On Sat, May 25, 2013 at 5:14 PM, Mark Salter <msalter@redhat.com> wrote:
> > /*
> > * int-ll64 is used practically everywhere now,
>
> This comment is obsolete, it's used everywhere now.
>
> > * so use it as a reasonable default.
> > */
> > #include <asm-generic/int-ll64.h>
> >
> > Shouldn't this be:
> >
> > #include <asm/bitsperlong.h>
> > #if __BITS_PER_LONG == 64
> > #include <asm-generic/int-l64.h>
> > #else
> > #include <asm-generic/int-ll64.h>
> > #endif
>
> No. Inside the kernel, all 64-bit platforms use int-ll64.h.
Except for alpha and ia64...
>
> For backwards compatibility, alpha, ia64, mips, and powerpc (unless
> __SANE_USERSPACE_TYPES__ is defined) still use int-l64.h in userspace.
>
> So it seems your glibc ues the old convention. Any chance you can still
> switch?
Not glibc, which provides the same stdint.h for all arches. The problem
is the namespace pollution caused by the app defining __s64 to be
glibc's int64_t. I assume that aarch64 kernel headers pull in the kernel
definition of __s64 for some reason where other kernel arches do not. So
it is just by luck that fuse builds on the other arches. I think I'll
take it up with the fuse maintainers...
--Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: possible problem with generic asm/types.h
2013-05-25 16:37 ` Mark Salter
@ 2013-05-25 16:39 ` Geert Uytterhoeven
2013-05-25 16:43 ` Mark Salter
0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2013-05-25 16:39 UTC (permalink / raw)
To: Mark Salter; +Cc: Linux-Arch, Arnd Bergmann, Catalin Marinas
On Sat, May 25, 2013 at 6:37 PM, Mark Salter <msalter@redhat.com> wrote:
>> No. Inside the kernel, all 64-bit platforms use int-ll64.h.
>
> Except for alpha and ia64...
Nope:
$ git grep int-l arch/{alpha,ia64}/include/asm/types.h
arch/alpha/include/asm/types.h:#include <asm-generic/int-ll64.h>
arch/ia64/include/asm/types.h:#include <asm-generic/int-ll64.h>
$
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: possible problem with generic asm/types.h
2013-05-25 16:39 ` Geert Uytterhoeven
@ 2013-05-25 16:43 ` Mark Salter
2013-05-26 7:40 ` Geert Uytterhoeven
0 siblings, 1 reply; 7+ messages in thread
From: Mark Salter @ 2013-05-25 16:43 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux-Arch, Arnd Bergmann, Catalin Marinas
On Sat, 2013-05-25 at 18:39 +0200, Geert Uytterhoeven wrote:
> On Sat, May 25, 2013 at 6:37 PM, Mark Salter <msalter@redhat.com> wrote:
> >> No. Inside the kernel, all 64-bit platforms use int-ll64.h.
> >
> > Except for alpha and ia64...
>
> Nope:
>
> $ git grep int-l arch/{alpha,ia64}/include/asm/types.h
> arch/alpha/include/asm/types.h:#include <asm-generic/int-ll64.h>
> arch/ia64/include/asm/types.h:#include <asm-generic/int-ll64.h>
> $
Hmm.
$ git grep int-l arch/{alpha,ia64}/include/uapi/asm/types.h
arch/alpha/include/uapi/asm/types.h:#include <asm-generic/int-l64.h>
arch/ia64/include/uapi/asm/types.h:#include <asm-generic/int-l64.h>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: possible problem with generic asm/types.h
2013-05-25 16:43 ` Mark Salter
@ 2013-05-26 7:40 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2013-05-26 7:40 UTC (permalink / raw)
To: Mark Salter; +Cc: Linux-Arch, Arnd Bergmann, Catalin Marinas
On Sat, May 25, 2013 at 6:43 PM, Mark Salter <msalter@redhat.com> wrote:
> On Sat, 2013-05-25 at 18:39 +0200, Geert Uytterhoeven wrote:
>> On Sat, May 25, 2013 at 6:37 PM, Mark Salter <msalter@redhat.com> wrote:
>> >> No. Inside the kernel, all 64-bit platforms use int-ll64.h.
^^^^^^^^^^^^^^^^
>> >
>> > Except for alpha and ia64...
>>
>> Nope:
>>
>> $ git grep int-l arch/{alpha,ia64}/include/asm/types.h
>> arch/alpha/include/asm/types.h:#include <asm-generic/int-ll64.h>
>> arch/ia64/include/asm/types.h:#include <asm-generic/int-ll64.h>
>> $
>
> Hmm.
>
> $ git grep int-l arch/{alpha,ia64}/include/uapi/asm/types.h
> arch/alpha/include/uapi/asm/types.h:#include <asm-generic/int-l64.h>
> arch/ia64/include/uapi/asm/types.h:#include <asm-generic/int-l64.h>
As I wrote before:
> For backwards compatibility, alpha, ia64, mips, and powerpc (unless
> __SANE_USERSPACE_TYPES__ is defined) still use int-l64.h in userspace.
^^^^^^^^^^^^
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: possible problem with generic asm/types.h
2013-05-25 15:14 possible problem with generic asm/types.h Mark Salter
2013-05-25 16:01 ` Geert Uytterhoeven
@ 2013-05-26 10:32 ` Arnd Bergmann
1 sibling, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2013-05-26 10:32 UTC (permalink / raw)
To: Mark Salter; +Cc: linux-arch, catalin.marinas
On Saturday 25 May 2013, Mark Salter wrote:
>
> While building some stuff for aarch64, I ran into a conflict between
> the kernel's definition of __s64 and glibc's definition of int64_t.
> The package I was building (fuse) does this:
>
> #include <stdint.h>
> #define __s64 int64_t
It's an old bug in fuse. The header that ships with the kernel
should work fine, just update your user space package.
Arnd
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-05-26 10:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-25 15:14 possible problem with generic asm/types.h Mark Salter
2013-05-25 16:01 ` Geert Uytterhoeven
2013-05-25 16:37 ` Mark Salter
2013-05-25 16:39 ` Geert Uytterhoeven
2013-05-25 16:43 ` Mark Salter
2013-05-26 7:40 ` Geert Uytterhoeven
2013-05-26 10:32 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox