public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* 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

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