Bug 2428 - configure: off64_t datatype detection broken on 64bit systems
Summary: configure: off64_t datatype detection broken on 64bit systems
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.25b
Hardware: All All
: P1 normal
Target Milestone: none
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 2432 2434
  Show dependency treegraph
 
Reported: 2005-03-09 06:39 UTC by Walter Haidinger
Modified: 2010-04-26 03:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Haidinger 2005-03-09 06:39:12 UTC
./configure never detects off64_t under Solaris 9.

Therefore HAVE_OFF64_T is never defined in include/config.h

I've ripped the conftest.c from config.log (attached below) and added
just a printf() call to display the sizeof() return values.

If turns out, that _both_ sizeof(off_t) and sizeof(off64_t) return 8
makeing the sizeof-comparison succeed and subsequently conftest returns 1.

Obviously just comparing the sizeof calls isn't the proper way under Solaris.

Steps to reproduce:
* Configure command used:
./configure --prefix=/usr/local/samba3 --with-sendfile-support --with-quotas
--with-sys-quotas --with-acl-support --with-libsmbclient --with-winbind
--with-automount

* config.log output:
...
configure:22223: checking for off64_t
configure:22247: gcc -o conftest -O   -D_LARGEFILE_SOURCE -D_REENTRANT
-D_FILE_OFFSET_BITS=64  -lthread conftest.c -lsec -lgen
 -lresolv -lsocket -lnsl -ldl -lrt >&5
configure:22250: $? = 0
configure:22252: ./conftest
configure:22255: $? = 1
configure: program exited with status 1
...

* The failing program from config.log with the added printf() call:
# cat conftest.c
/* confdefs.h.  */

#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define HAVE_VOLATILE 1
#define SYSV 1
#define _LARGEFILE64_SOURCE 1
#define _FILE_OFFSET_BITS 64
#define STDC_HEADERS 1
#define HAVE_DIRENT_H 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_UNISTD_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_SYS_FCNTL_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_UNISTD_H 1
#define HAVE_RPC_NETTYPE_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
#define HAVE_GRP_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MEMORY_H 1
#define HAVE_RPC_RPC_H 1
#define HAVE_RPCSVC_NIS_H 1
#define HAVE_RPCSVC_YP_PROT_H 1
#define HAVE_RPCSVC_YPCLNT_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_CTYPE_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_IPC_H 1
#define HAVE_SYS_MODE_H 1
#define HAVE_SYS_MMAN_H 1
#define HAVE_SYS_FILIO_H 1
#define HAVE_SYS_SHM_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STDLIB_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_MOUNT_H 1
#define HAVE_SYS_VFS_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_SYS_TERMIO_H 1
#define HAVE_SYS_STATFS_H 1
#define HAVE_SYS_STATVFS_H 1
#define HAVE_STDARG_H 1
#define HAVE_SYS_SOCKIO_H 1
#define HAVE_SYS_SYSMACROS_H 1
#define HAVE_DLFCN_H 1
#define HAVE_SYS_SYSLOG_H 1
#define HAVE_SYSLOG_H 1
#define HAVE_LANGINFO_H 1
#define HAVE_LOCALE_H 1
#define HAVE_SHADOW_H 1
#define HAVE_NETINET_TCP_H 1
#define HAVE_NETINET_IN_SYSTM_H 1
#define HAVE_NSS_COMMON_H 1
#define HAVE_NSSWITCH_H 1
#define HAVE_SECURITY_PAM_APPL_H 1
#define HAVE_STROPTS_H 1
#define HAVE_POLL_H 1
#define HAVE_SYS_SYSCALL_H 1
#define HAVE_SYS_ACL_H 1
#define HAVE_GLOB_H 1
#define HAVE_SECURITY_PAM_MODULES_H 1
#define HAVE_NET_IF_H 1
#define HAVE_NETINET_IP_H 1
#define HAVE_UTMP_H 1
#define HAVE_UTMPX_H 1
#define HAVE_LASTLOG_H 1
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_SHORT 2
#define WORDS_BIGENDIAN 1
#define RETSIGTYPE void
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define HAVE_ST_RDEV 1
#define HAVE_DIRENT_D_OFF 1
#define loff_t off_t
#define HAVE_IMMEDIATE_STRUCTURES 1
#define HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS 1
#define HAVE_UNIXSOCKET 1
#define HAVE_SOCKLEN_T_TYPE 1
#define HAVE_SIG_ATOMIC_T_TYPE 1
#define HAVE_ERRNO_DECL 1
#define HAVE_VSNPRINTF_DECL 1
#define HAVE_SNPRINTF_DECL 1
#define HAVE_READLINE_READLINE_H 1
#define HAVE_READLINE_HISTORY_H 1
#define HAVE_READLINE_READLINE_H 1
#define HAVE_LIBREADLINE 1
#define HAVE_NEW_LIBREADLINE 1
#define HAVE_LIBNSL 1
#define HAVE_LIBSOCKET 1
#define HAVE_CONNECT 1
#define HAVE_YP_GET_DEFAULT_DOMAIN 1
#define HAVE_EXECL 1
#define HAVE_DLOPEN 1
#define HAVE_DLCLOSE 1
#define HAVE_DLSYM 1
#define HAVE_DLERROR 1
#define HAVE_WAITPID 1
#define HAVE_GETCWD 1
#define HAVE_STRDUP 1
#define HAVE_STRTOUL 1
#define HAVE_STRERROR 1
#define HAVE_CHOWN 1
#define HAVE_FCHOWN 1
#define HAVE_CHMOD 1
#define HAVE_FCHMOD 1
#define HAVE_CHROOT 1
#define HAVE_LINK 1
#define HAVE_MKNOD 1
#define HAVE_FSTAT 1
#define HAVE_STRCHR 1
#define HAVE_UTIME 1
#define HAVE_UTIMES 1
#define HAVE_GETRLIMIT 1
#define HAVE_FSYNC 1
#define HAVE_MEMSET 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_SETPGID 1
#define HAVE_MEMMOVE 1
#define HAVE_VSNPRINTF 1
#define HAVE_SNPRINTF 1
#define HAVE_SETSID 1
#define HAVE_GLOB 1
#define HAVE_STRPBRK 1
#define HAVE_PIPE 1
#define HAVE_STRFTIME 1
#define HAVE_SIGPROCMASK 1
#define HAVE_SIGACTION 1
#define HAVE_SIGSET 1
#define HAVE_INNETGR 1
#define HAVE_SETNETGRENT 1
#define HAVE_GETNETGRENT 1
#define HAVE_ENDNETGRENT 1
#define HAVE_INITGROUPS 1
#define HAVE_SELECT 1
#define HAVE_POLL 1
#define HAVE_GETGRNAM 1
#define HAVE_GETGRENT 1
#define HAVE_PATHCONF 1
#define HAVE_REALPATH 1
#define HAVE_SETGROUPS 1
#define HAVE_SYSCONF 1
#define HAVE_MKTIME 1
#define HAVE_RENAME 1
#define HAVE_FTRUNCATE 1
#define HAVE_STAT64 1
#define HAVE_FSTAT64 1
#define HAVE_LSTAT64 1
#define HAVE_FOPEN64 1
#define HAVE_ATEXIT 1
#define HAVE_GRANTPT 1
#define HAVE_DUP2 1
#define HAVE_LSEEK64 1
#define HAVE_FTRUNCATE64 1
#define HAVE_READDIR64 1
#define HAVE_FSEEKO64 1
#define HAVE_FTELLO64 1
#define HAVE_SETLINEBUF 1
#define HAVE_SRANDOM 1
#define HAVE_RANDOM 1
#define HAVE_SRAND 1
#define HAVE_RAND 1
#define HAVE_USLEEP 1
#define HAVE_STRCASECMP 1
#define HAVE_FCVT 1
#define HAVE_SYMLINK 1
#define HAVE_READLINK 1
#define HAVE_SYSLOG 1
#define HAVE_VSYSLOG 1
#define HAVE_SETLOCALE 1
#define HAVE_NL_LANGINFO 1
#define HAVE_NANOSLEEP 1
#define HAVE_SETBUFFER 1
#define HAVE_SHMGET 1
#define HAVE_SHM_OPEN 1
#define HAVE_SYSCALL 1
#define HAVE__DUP 1
#define HAVE__DUP2 1
#define HAVE__OPENDIR 1
#define HAVE__READDIR 1
#define HAVE__SEEKDIR 1
#define HAVE__TELLDIR 1
#define HAVE__CLOSEDIR 1
#define HAVE__GETCWD 1
#define HAVE__STAT 1
#define HAVE__LSTAT 1
#define HAVE__FSTAT 1
#define HAVE__ACL 1
#define HAVE__FACL 1
#define HAVE__OPEN 1
#define HAVE__CHDIR 1
#define HAVE__CLOSE 1
#define HAVE__FCHDIR 1
#define HAVE__FCNTL 1
#define HAVE_GETDENTS 1
#define HAVE__GETDENTS 1
#define HAVE__LSEEK 1
#define HAVE__READ 1
#define HAVE__WRITE 1
#define HAVE__FORK 1
#define HAVE__STAT64 1
#define HAVE__FSTAT64 1
#define HAVE__LSTAT64 1
#define HAVE_LLSEEK 1
#define HAVE__LLSEEK 1
#define HAVE_READDIR64 1
#define HAVE__READDIR64 1
#define HAVE_PREAD 1
#define HAVE__PREAD 1
#define HAVE_PREAD64 1
#define HAVE__PREAD64 1
#define HAVE_PWRITE 1
#define HAVE__PWRITE 1
#define HAVE_PWRITE64 1
#define HAVE__PWRITE64 1
#define HAVE_OPEN64 1
#define HAVE__OPEN64 1
#define HAVE_CREAT64 1
#define HAVE_LIBRESOLV 1
#define HAVE_LIBGEN 1
#define HAVE_GETSPNAM 1
#define HAVE_GETSPNAM 1
#define HAVE_LIBSEC 1
#define HAVE_GETSPNAM 1
#define SUNOS5 1
#define STAT_ST_BLOCKSIZE 512
#define BROKEN_GETGRNAM 1
#define HAVE_LONGLONG 1
#define COMPILER_SUPPORTS_LL 1
#define SIZEOF_OFF_T 8
/* end confdefs.h.  */

#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
#include <sys/stat.h>
main() { struct stat64 st; off64_t s; 
   printf("off_t: %d   off64_t: %d\n", sizeof(off_t), sizeof(off64_t));
   if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null",
&st)==0)?0:1); }

* Compile it:
# gcc -o conftest -O   -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 
-lthread conftest.c -lsec -lgen -lresolv -lsocket -lnsl -ldl -lrt

* Run it and check exitcode:
# ./conftest ; echo $?
off_t: 8   off64_t: 8
1

I hope this is enough information. 
Regards, Walter

PS: FYI: I detected this while investigation a possible sendfile bug 
         with largefiles for which I'll open a new bug too.
    under Solaris.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2005-10-14 12:27:49 UTC
Hmmm...looks like this still exists in 3.0.20b.  Updating version and priority
Comment 2 Björn Jacke 2007-08-23 01:39:35 UTC
isn't a test like
if (sizeof(off_t) == sizeof(off64_t)) exit(1)
broken on any 64bit environment? For example this also breaks detection of off64_t on x86_64 Linux machines. I think this (currently) doesn't *break* anything but it is confusing.
How about testing for sizeof(off64_t) >= 8 ?
Comment 3 Stefan Metzmacher 2010-04-26 03:18:26 UTC
If it's still broken in 3.5, please reopen.
3.0 isn't supported anymore.