<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>90489</bug_id>
          
          <creation_ts>2005-04-26 05:57 0000</creation_ts>
          <short_desc>sleuthkit-2.01 doesn&apos;t compile on AMD64</short_desc>
          <delta_ts>2005-04-28 12:48:30 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>AMD64</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>InCVS</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mathfox@xs4all.nl</reporter>
          <assigned_to>amd64@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>mathfox@xs4all.nl</who>
            <bug_when>2005-04-26 05:57:39 0000</bug_when>
            <thetext>emerge -u world chokes on sleuthkit-2.01:

x86_64-pc-linux-gnu-gcc -DLINUX2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DVER=\&quot;2.01\&quot; -O2 -g   -c -o tsk_endian.o tsk_endian.c
In file included from /usr/include/inttypes.h:28,
                 from tsk_os.h:81,
                 from tsk_endian.c:15:
/usr/include/stdint.h:41: error: conflicting types for &apos;int64_t&apos;
/usr/include/linux/types.h:139: error: previous declaration of &apos;int64_t&apos; was here
/usr/include/stdint.h:56: error: conflicting types for &apos;uint64_t&apos;
/usr/include/linux/types.h:137: error: previous declaration of &apos;uint64_t&apos; was here
make: *** [tsk_endian.o] Error 1

(I&apos;ld blame the kernel guys for choosing long long over long)

And the emerge info output:

Portage 2.0.51.19 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb  7 2005, 11:44:12)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.8.5-r3, 1.7.9-r1, 1.6.3, 1.9.4, 1.4_p6
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS=&quot;amd64&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-O2&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs autoconfig ccache distlocks sandbox strict&quot;
GENTOO_MIRRORS=&quot;http://gentoo.nedlinux.nl http://ftp.easynet.nl/mirror/gentoo/ http://gentoo.mirror.sdv.fr http://gentoo.math.bme.hu&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;amd64 X acpi alsa arts berkdb bitmap-fonts bonobo cdr crypt curl doc dvd dvdr esd fam flac font-server fortran gd gdbm gif gnome gpm gstreamer gtk gtkhtml
guile imagemagick imlib ipv6 java jp2 jpeg junit kde ldap libwww lm-sensors lzw
lzw-tiff mad mikmod motif mozilla mp3 mysql ncurses nls ogg opengl oss pam pda pdflib perl png postgres python qt readline ruby samba sdl slang speex ssl tcltk
tcpd tetex tiff truetype truetype-fonts type1-fonts usb userlocales vorbis xml xml2 xmms xpm xrandr xv zlib&quot;
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
 
Portage 2.0.51.19 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb  7 2005, 11:44:12)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.8.5-r3, 1.7.9-r1, 1.6.3, 1.9.4, 1.4_p6
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS=&quot;amd64&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-O2&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs autoconfig ccache distlocks sandbox strict&quot;
GENTOO_MIRRORS=&quot;http://gentoo.nedlinux.nl http://ftp.easynet.nl/mirror/gentoo/ http://gentoo.mirror.sdv.fr http://gentoo.math.bme.hu&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;amd64 X acpi alsa arts berkdb bitmap-fonts bonobo cdr crypt curl doc dvd dvdr esd fam flac font-server fortran gd gdbm gif gnome gpm gstreamer gtk gtkhtml
guile imagemagick imlib ipv6 java jp2 jpeg junit kde ldap libwww lm-sensors lzw
lzw-tiff mad mikmod motif mozilla mp3 mysql ncurses nls ogg opengl oss pam pda pdflib perl png postgres python qt readline ruby samba sdl slang speex ssl tcltk
tcpd tetex tiff truetype truetype-fonts type1-fonts usb userlocales vorbis xml xml2 xmms xpm xrandr xv zlib&quot;
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>config@gentoo.org</who>
            <bug_when>2005-04-27 14:21:18 0000</bug_when>
            <thetext>Created an attachment (id=57438)
Fixes compilation issue

Could you please try the attached patch? I don&apos;t know that package so I can
hardly figure whether this breaks it. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mathfox@xs4all.nl</who>
            <bug_when>2005-04-27 16:25:30 0000</bug_when>
            <thetext>Yes, it fixes the compilation issue and a quick test of the resulting executables shows no breakage.
Thanks!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dang@gentoo.org</who>
            <bug_when>2005-04-27 19:58:51 0000</bug_when>
            <thetext>There&apos;s a deeper issue here.  On x86, glibc defines uint64_t as unsigned long long, while on amd64, it&apos;s defined as unsigned long.  However, the kernel defines it as unsigned long long in both cases.  This makes the definitions different on amd64.

Now, sleuthkit shouldn&apos;t need to include &lt;linux/types.h&gt;, but this wouldn&apos;t be a problem if the two definitions were the same.  Likely either the linux-headers or glibc should be patched.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mathfox@xs4all.nl</who>
            <bug_when>2005-04-27 23:58:19 0000</bug_when>
            <thetext>Yes, on the AMD64 architecture glibc and Linux use different definitions for the 64 bit integer types. I think that it makes sense for sleuthkit to include &lt;linux/types.h&gt; as sleuthkit needs low level access to the file system structures as laid out on the harddisk (or disk image). It should be possible for system utilities to include both standard and kernel header files.
In my opinion the Linux guys are to blame for using names that are reserved for compiler and library writers. Their conflicting definition paints us in a corner. Commenting out the &lt;linux/types.h&gt; include is getting us out of trouble now; the real soltion would be an attitude adjustment for the kernel hackers.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>config@gentoo.org</who>
            <bug_when>2005-04-28 00:32:41 0000</bug_when>
            <thetext>&quot;On x86, glibc defines uint64_t as unsigned long long, while on amd64, it&apos;s defined as unsigned long.&quot;

Which makes sense. You want 64bits unsigned, so you have to do it this way. 
I actually have _no_ idea why the kernel defines it as unsigned long long. In userspace this results in a 128bit integer type (right?). If that&apos;s the case in kernel-space, then the name uint64_t is indeed surprising.

Why blame the kernel-devs? You actually shouldn&apos;t mix kernel and user-space types - it can mess things badly. In this case, taking the kerne-definitions makes sense (but I agree a different name would make it simpler)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dang@gentoo.org</who>
            <bug_when>2005-04-28 07:34:06 0000</bug_when>
            <thetext>No, long long is always 64-bit on gcc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>config@gentoo.org</who>
            <bug_when>2005-04-28 12:48:30 0000</bug_when>
            <thetext>I&apos;ve added the patch to cvs. Thanks for reporting</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>57438</attachid>
            <date>2005-04-27 14:21 0000</date>
            <desc>Fixes compilation issue</desc>
            <filename>sleuthkit.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNyYy9taXNjL3Rza19vcy5oLm9sZAkyMDA1LTA0LTI4IDIzOjEyOjU2LjAwMDAwMDAwMCAr
MDAwMAorKysgc3JjL21pc2MvdHNrX29zLmgJMjAwNS0wNC0yOCAyMzoxMTozNC4wMDAwMDAwMDAg
KzAwMDAKQEAgLTc3LDcgKzc3LDcgQEAKICAgKi8KICNpZiBkZWZpbmVkKExJTlVYMikKICNkZWZp
bmUgU1VQUE9SVEVECi0jaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKy8qICNpbmNsdWRlIDxsaW51
eC90eXBlcy5oPiAqLyAKICNpbmNsdWRlIDxpbnR0eXBlcy5oPgogI2VuZGlmCQkJCS8qIExJTlVY
ICovCiAK
</data>        

          </attachment>
    </bug>

</bugzilla>