Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120194 - dev-embedded/avrdude-5.1 compilation fails on amd64
Summary: dev-embedded/avrdude-5.1 compilation fails on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Embedded Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 08:34 UTC by Lukas Sandström
Modified: 2007-02-24 20:22 UTC (History)
2 users (show)

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


Attachments
My stat.h (stat.h,7.34 KB, text/plain)
2006-01-24 11:07 UTC, Lukas Sandström
Details
avrdude-5.1.patch (avrdude-5.1.patch,628 bytes, patch)
2006-01-24 13:17 UTC, Lukas Sandström
Details | Diff
slightly improved patch (patch,1.69 KB, patch)
2006-01-26 06:12 UTC, Simon Stelling (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Sandström 2006-01-24 08:34:51 UTC
Emerging of avrdude-5.1 fails with the following error:

<..snipped..>
checking for parallel device... /dev/parport0
checking for serial device... /dev/ttyS0
configure: creating ./config.status
config.status: creating windows/Makefile
config.status: creating avrdude.spec
config.status: creating Makefile
config.status: creating avrdude.conf.tmp
config.status: creating ac_cfg.h
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory `/var/tmp/portage/avrdude-5.1/work/avrdude-5.1'
make[2]: Entering directory `/var/tmp/portage/avrdude-5.1/work/avrdude-5.1'
if x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.  -DCONFIG_DIR=\"/etc\"  -Wall   -O2 -pipe -march=k8  -MT avrdude-config_gram.o -MD -MP -MF ".deps/avrdude-config_gram.Tpo" -c -o avrdude-config_gram.o `test -f 'config_gram.c' || echo './'`config_gram.c; \
then mv -f ".deps/avrdude-config_gram.Tpo" ".deps/avrdude-config_gram.Po"; else rm -f ".deps/avrdude-config_gram.Tpo"; exit 1; fi
if x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.  -DCONFIG_DIR=\"/etc\"  -Wall   -O2 -pipe -march=k8  -MT avrdude-lexer.o -MD -MP -MF ".deps/avrdude-lexer.Tpo" -c -o avrdude-lexer.o `test -f 'lexer.c' || echo './'`lexer.c; \
then mv -f ".deps/avrdude-lexer.Tpo" ".deps/avrdude-lexer.Po"; else rm -f ".deps/avrdude-lexer.Tpo"; exit 1; fi
In file included from /usr/include/bits/stat.h:8,
                 from /usr/include/gentoo-multilib/amd64/sys/stat.h:105,
                 from /usr/include/sys/stat.h:8,
                 from lexer.l:29:
/usr/include/gentoo-multilib/amd64/bits/stat.h:103: error: parse error before '[' token
make[2]: *** [avrdude-lexer.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/avrdude-5.1/work/avrdude-5.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/avrdude-5.1/work/avrdude-5.1'
make: *** [all] Error 2

!!! ERROR: dev-embedded/avrdude-5.1 failed.
!!! Function src_compile, Line 26, Exitcode 2
!!! emake failed
!!! If you need support, post the topmost build error, NOT this status message.

emerge --info:

Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.15-rc7-git x86_64)
=================================================================
System uname: 2.6.15-rc7-git x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.14
ccache version 2.3 [disabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=k8 "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /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"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -march=k8 "
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.du.se/pub/os/gentoo http://ftp.du.se/pub/os/gentoo http://ds.thn.htu.se/linux/gentoo http://mirror.pudas.net/gentoo ftp://mirror.pudas.net/gentoo"
LANG="en_US.ISO-8859-1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X alsa audiofile avi berkdb bitmap-fonts bzip2 cairo cdb cdparanoia cdr crypt curl dga divx4linux dts dvd dvdr dvdread emboss encode esd exif expat fam ffmpeg firefox flac foomaticdb fortran gcj gdbm gif glitz glut gnome gpm gstreamer gtk gtk2 gtkhtml idn imagemagick imlib java jpeg junit kde lcms ldap libwww lzo lzw lzw-tiff mad matroska mng motif mp3 mpeg mysql ncurses nls nptl nptlonly nvidia ogg oggvorbis openal opengl pam pcre pdflib perl png python qt quicktime readline real recode samba sdl spell ssl svf tcltk tcpd tetex tga theora tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vorbis wmf xanim xine xml2 xpm xv xvid xvmc zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Henrik Brix Andersen 2006-01-24 08:56:00 UTC
AMD64 herd, any idea about this issue?

/usr/include/gentoo-multilib/amd64/bits/stat.h:103: error: parse error before '[' token
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2006-01-24 09:26:53 UTC
Lukas, please attach your '/usr/include/gentoo-multilib/amd64/bits/stat.h'
Comment 3 Lukas Sandström 2006-01-24 11:07:33 UTC
Created attachment 78017 [details]
My stat.h
Comment 4 Lukas Sandström 2006-01-24 11:09:46 UTC
Note that I tried compiling a short C program which #included <sys/stat.h>
and it compiled just fine.

#include <sys/stat.h>

int main() {
return 0;
}
Comment 5 Sandro Bonazzola (RETIRED) gentoo-dev 2006-01-24 12:32:31 UTC
I can reproduce this here on ~amd64.
Going into building directory:
avrdude-5.1 # gcc -c lexer.c
In file included from /usr/include/bits/stat.h:8,
                 from /usr/include/gentoo-multilib/amd64/sys/stat.h:105,
                 from /usr/include/sys/stat.h:8,
                 from lexer.l:29:
/usr/include/gentoo-multilib/amd64/bits/stat.h:103: error: syntax error before '[' token

looking into /usr/include/bits/stat.h
#ifdef __x86_64__
# include <gentoo-multilib/amd64/bits/stat.h>
#endif /* __x86_64__ */

looking /usr/include/gentoo-multilib/amd64/sys/stat.h:105
#include <bits/stat.h>

looking /usr/include/sys/stat.h
#ifdef __x86_64__
# include <gentoo-multilib/amd64/sys/stat.h>
#endif /* __x86_64__ */

lexer.l: 
#include <math.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>

/usr/include/gentoo-multilib/amd64/bits/stat.h
#if __WORDSIZE == 64
    long int __unused[3];
#else
# ifndef __USE_FILE_OFFSET64
    unsigned long int __unused4;
    unsigned long int __unused5;
# else
    __ino64_t st_ino;                   /* File serial number.  */
# endif
#endif

I can't see any syntax error in those files. But still fails to compile.
Comment 6 Lukas Sandström 2006-01-24 13:17:36 UTC
Created attachment 78026 [details, diff]
avrdude-5.1.patch

It builds with this path, but I haven't tested it much.
The problem is that __unused is defined in lexer.c in the
avrdude sources.
Comment 7 Simon Stelling (RETIRED) gentoo-dev 2006-01-24 13:59:57 UTC
right, so this is dev-embedded's territory
Comment 8 Lukas Sandström 2006-01-26 05:26:17 UTC
I filed a bug report upstream.

http://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=15536
Comment 9 Simon Stelling (RETIRED) gentoo-dev 2006-01-26 06:12:22 UTC
Created attachment 78160 [details, diff]
slightly improved patch

Brix, I tested this patch and it works (of course), but I'm not sure how dev-embedded handles patching. Should I use patch or is epatch fine? If epatch is fine, please apply this :)
Comment 10 SpanKY gentoo-dev 2006-01-26 07:23:02 UTC
> Brix, I tested this patch and it works (of course), but I'm not sure how
> dev-embedded handles patching. Should I use patch or is epatch fine?

uhh, ebuilds should *always* use epatch
Comment 11 Lukas Sandström 2006-01-26 11:46:08 UTC
An avrdude developer suggested the following workaround, which worked for me:

lexer.c is a generated file, from lexer.l.  Thus, there is
no CVS file for it, so we cannot patch it that way.

I'm a bit surprised this file even makes it into the source
distribution, but that's the way "make distcheck" created
the tarball.  I rather suspect a bug in the autoconf/automake
configuration files used in avrdude.

As a workaround, I suggest you remove lexer.c, config_gram.c,
and config_gram.h locally before starting the build, so the
make process will recreate them using your local lex and yacc.
Comment 12 Daniel Black (RETIRED) gentoo-dev 2006-01-27 15:52:38 UTC
Thanks Lukas - I've changed it to remove the autogenerated files.

Please reopen if any problems remain.
Comment 13 Eric Thibodeau 2007-02-24 20:16:01 UTC
I just tried avrdude 5.3.1 and it seems the files aren't auto-generated unfortunately (build complains about those files missing exactly).
Comment 14 Eric Thibodeau 2007-02-24 20:22:33 UTC
Okay, make gets ahead of itself on this one:
MAKEOPTS=-j1
..needs to be added to the ebuild and all should be nice to unmask it ;)