possible problem with generic asm/types.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux