[LU-1537] posix-types.h redefines __s64 and __u64 in an incompatible way on powerpc Created: 18/Jun/12  Updated: 18/Apr/13  Resolved: 18/Apr/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.4.0

Type: Bug Priority: Minor
Reporter: Prakash Surya (Inactive) Assignee: Oleg Drokin
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 4412

 Description   

The linux kernel defines 64bit user space values as l64 on powerpc machines. Unfortunately this is incompatible with the way Lustre assumes 64bit values are ll64 in user space.

The relevant code from the kernel headers (arch/powerpc/include/asm/types.h):

#if defined(__powerpc64__) && !defined(__KERNEL__)
# include <asm-generic/int-l64.h>
#else
# include <asm-generic/int-ll64.h>
#endif

The relevant code from the Lustre headers (libcfs/include/libcfs/posix/posix-types.h):

#ifndef HAVE___S64
typedef __signed__ long long __s64;
#endif
#ifndef HAVE___U64
typedef unsigned long long __u64;
#endif

This incompatibility is causing the following program to fail compilation:

$ cat main.c 
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <lustre/liblustreapi.h>
#include <lustre/lustre_user.h>

int
main ( )
{
 (void) llapi_file_open("filename",O_CREAT|O_WRONLY,0666,1048576ll,-1,10,0);
}

$ make main
cc     main.c   -o main
In file included from /usr/include/lustre/lustre_user.h:50,
                 from /usr/include/lustre/liblustreapi.h:48,
                 from main.c:6:
/usr/include/libcfs/posix/posix-types.h:79: error: conflicting types for '__s64'
/usr/include/asm-generic/int-l64.h:28: note: previous declaration of '__s64' was here
/usr/include/libcfs/posix/posix-types.h:82: error: conflicting types for '__u64'
/usr/include/asm-generic/int-l64.h:29: note: previous declaration of '__u64' was here
make: *** [main] Error 1


 Comments   
Comment by Prakash Surya (Inactive) [ 18/Jun/12 ]

See: http://review.whamcloud.com/3127

Comment by Peter Jones [ 18/Jun/12 ]

Oleg was looking at this area recently

Comment by Jodi Levi (Inactive) [ 18/Apr/13 ]

can this ticket be closed since Change, 3127 landed?

Comment by Prakash Surya (Inactive) [ 18/Apr/13 ]

Yes, this can be closed.

Comment by Jodi Levi (Inactive) [ 18/Apr/13 ]

Landed to master.

Generated at Sat Feb 10 01:17:31 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.