Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 27372 - dev-libs/elfutils-0.84 does not compile due to use of st_atim in stat64 structure
Summary: dev-libs/elfutils-0.84 does not compile due to use of st_atim in stat64 struc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: Alpha Linux
: High normal
Assignee: Stefan Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-26 11:17 UTC by Mark Wagner
Modified: 2003-09-20 18:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix strip.c (foo,494 bytes, patch)
2003-08-26 11:18 UTC, Mark Wagner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wagner 2003-08-26 11:17:46 UTC
From stat(2)

              struct stat {
                  dev_t         st_dev;      /* device */
                  ino_t         st_ino;      /* inode */
                  mode_t        st_mode;     /* protection */
                  nlink_t       st_nlink;    /* number of hard links */
                  uid_t         st_uid;      /* user ID of owner */
                  gid_t         st_gid;      /* group ID of owner */
                  dev_t         st_rdev;     /* device type (if inode device) */
                 off_t         st_size;     /* total size, in bytes */
                  blksize_t     st_blksize;  /* blocksize for filesystem I/O */
                  blkcnt_t      st_blocks;   /* number of blocks allocated */
                  time_t        st_atime;    /* time of last access */
                  time_t        st_mtime;    /* time of last modification */
                  time_t        st_ctime;    /* time of last change */
              };

From elfutils-0.84/src/strip.c:
    246           struct stat64 st;
...
    274           TIMESPEC_TO_TIMEVAL (&tv[0], &st.st_atim);
    275           TIMESPEC_TO_TIMEVAL (&tv[1], &st.st_mtim);

Now, I cannot comprehend the maze of different stat.h files used to define
stat64, but in /usr/src/linux/include/asm-*/stat.h none of the stat64s seem to
have these fields.

The attached patch allowed me to compile on Alpha.

Note that st_atim and st_mtim are of type timespec_t and st_atime and st_mtime
are of type time_t so adding a couple e's won't fix the problem.


Reproducible: Always
Steps to Reproduce:
1. ebuild elfutils-0.84.ebuild compile

Actual Results:  
strip.c: In function `process_file':
strip.c:274: structure has no member named `st_atim'
strip.c:274: structure has no member named `st_atim'
strip.c:275: structure has no member named `st_mtim'
strip.c:275: structure has no member named `st_mtim'
make[2]: *** [strip.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rm i386_ld.o
make[2]: Leaving directory `/var/tmp/portage/elfutils-0.84/work/elfutils-0.84/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/elfutils-0.84/work/elfutils-0.84'
make: *** [all] Error 2

!!! ERROR: dev-libs/elfutils-0.84 failed.
!!! Function src_compile, Line 37, Exitcode 2
!!! (no error message)


Expected Results:  
Compiled strip.c with no errors.

Portage 2.0.49 (default-alpha-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21-alpha-r1)
=================================================================
System uname: 2.4.21-alpha-r1 alpha EV56
ACCEPT_KEYWORDS="alpha ~alpha ppc ~ppc sparc ~sparc"
AUTOCLEAN="yes"
CFLAGS="-mcpu=ev56 -O3 -pipe "
CHOST="alphaev56-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-mcpu=ev56 -O3 -pipe "
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache sandbox userpriv usersandbox fixpackages"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="alpha cups encode foomaticdb gif gnome kde libg++ mikmod nls oggvorbis oss
qt quicktime truetype xmms xv berkdb X sdl gpm esd opengl -motif crypt ethereal
gd gdbm gtk gtkhtml guile imlib java jikes jpeg kerberos ldap libwww mbox
ncurses pam pdflib perl pic png postgres python readline e sasl slang snmp Ad
spell ssl tcltk tcpd tetex xml xml2 zlib opie"
Comment 1 Mark Wagner 2003-08-26 11:18:40 UTC
Created attachment 16642 [details, diff]
Patch to fix strip.c
Comment 2 Stefan Jones (RETIRED) gentoo-dev 2003-08-28 01:07:16 UTC
Could you look in /usr/include/bits/stat.h
It is there for x86.

If it isn't for Alpha then glibc needs to be upgraded for Alpha from glibc CVS, I guess, I will just mask this version then for alpha.
Comment 3 Alberto Ornaghi 2003-09-01 07:45:54 UTC
I've the same problem on x86...

strip.c: In function `process_file':
strip.c:274: structure has no member named `st_atim'
strip.c:274: structure has no member named `st_atim'
strip.c:275: structure has no member named `st_mtim'
strip.c:275: structure has no member named `st_mtim'
make[2]: *** [strip.o] Error 1

linux-headers is 2.4.19-r1, perhaps it need an update to 2.4.22 ?
glibc is 2.3.1-r4

bye
Comment 4 Stefan Jones (RETIRED) gentoo-dev 2003-09-01 13:21:06 UTC
This patch will not work with glibc-2.3.2 which is in portage for x86.

As it stands, unpatched, it works fine with glibc-2.3.2 on x86, but not on alpha.

With patch it will work with glibc-2.3.1 on everything, with glibc-2.3.2 on alpha but not x86.

I say I will not apply patch and remove alpha keyword, and up the glibc version required, and wait will a newer version of glibc pops up!
Comment 5 Stefan Jones (RETIRED) gentoo-dev 2003-09-01 13:36:33 UTC
ok, added the patch for alpha only, and changed the requirement to glibc-2.3.2 or higher.

Please test on alpha.
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2003-09-20 18:41:44 UTC
This is fixed on alpha.  I'm running elfutils-0.84 with glibc-2.3.2-r1 on an alpha.  Thanks Stefan.