Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 290465 - [PATCH] dev-util/git-1.6.4.4: fails to compile on uclibc system: error: 'struct stat' has no member named 'st_mtim'
Summary: [PATCH] dev-util/git-1.6.4.4: fails to compile on uclibc system: error: 'stru...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-25 15:51 UTC by Anthony Basile
Modified: 2010-04-22 14:02 UTC (History)
3 users (show)

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


Attachments
Modifies Makefile to set NO_NSEC (uclibc-no-nsec.patch,446 bytes, patch)
2009-10-25 15:56 UTC, Anthony Basile
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2009-10-25 15:51:21 UTC
uclibc does not have nanosecond resolution.  git doesn't check if the system uses uclibc and so the resulting code tries to make reference to members of struct stat that aren't available.  Thus git fails to compile.

Reproducible: Always

Steps to Reproduce:
1. emerge git
2.
3.

Actual Results:  
Fails to compile.

Expected Results:  
Expect git to emerge.

Compilation dies at

builtin-fetch-pack.c: In function 'fetch_pack':
builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
make: *** [builtin-fetch-pack.o] Error 1
Comment 1 Anthony Basile gentoo-dev 2009-10-25 15:52:06 UTC
Portage 2.1.6.13 (uclibc/x86/hardened, gcc-4.4.2, uclibc-0.9.30.1-r1, 2.6.28-hardened-r9 i686)
=================================================================
System uname: Linux-2.6.28-hardened-r9-i686-AMD_Phenom-tm-_9650_Quad-Core_Processor-with-gentoo-1.12.11.1
Timestamp of tree: Sat, 24 Oct 2009 07:00:01 +0000
app-shells/bash:     4.0_p28
dev-lang/python:     2.6.2-r1
dev-util/cmake:      2.6.4
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i386-gentoo-linux-uclibc"
CFLAGS="-Os -pipe"
CHOST="i386-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://192.168.100.9/pub/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/hardened-development"
SYNC="rsync://192.168.100.7/portage"
USE="cli cracklib crypt dri hardened modules mudflap ncurses openmp pcre perl pic python readline reflection server session spl ssl tcpd uclibc uclibc-compat wordexp x86 xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="uclibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Anthony Basile gentoo-dev 2009-10-25 15:56:48 UTC
Created attachment 208214 [details, diff]
Modifies Makefile to set NO_NSEC

This patch can be applied on uclibc systems only by adding the following to src_unpack() in the ebuild:

if [[ ${CHOST} == *-uclibc* ]] ; then
        epatch "${FILESDIR}"/uclibc-no-nsec.patch
fi
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-11-17 22:07:56 UTC
I've just done a commit to 1.6.5.3 to fix this, using the regular mechanism to pass in the flags (no patches needed). Please test.
Comment 4 Anthony Basile gentoo-dev 2009-11-18 03:34:48 UTC
I tested git-1.6.5.3 and it compiles and works fine.
Comment 5 Marco Albanese 2010-04-22 14:02:51 UTC
(In reply to comment #4)
> I tested git-1.6.5.3 and it compiles and works fine.
> 

I've tested it too and it compiles and works fine now :). Thank you