Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 105258

Summary: >=net-irc/ircd-hybrid-7.1.0 has problems with AMD64 multilib
Product: Gentoo Linux Reporter: Alan LeVee <alan.levee>
Component: New packagesAssignee: Packages in net-irc <net-irc>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo
Priority: High    
Version: 2005.1   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to fix amd64 header bits/stat.h
7.2.1-amd64-multilib.patch

Description Alan LeVee 2005-09-08 07:41:00 UTC
The software ircd-hybrid-7.1.0 and above has compiling issues on the AMD64 
problem that seem to be related to the multilib that is used by Gentoo/AMD64. 
This error occurs during the lexer generation and can be seen here:

In file included from /usr/include/bits/stat.h:7,
                 from /usr/include/gentoo-multilib/amd64/sys/stat.h:105,
                 from /usr/include/sys/stat.h:7,
                 from ../include/stdinc.h:123,
                 from ircd_lexer.l:31:
/usr/include/gentoo-multilib/amd64/bits/stat.h:103: error: parse error
before '[' token
make[1]: *** [lex.yy.o] Error 1
make[1]: Leaving directory `/home/trelane/ircd-hybrid-7.2beta1/src'
make: *** [build] Error 2

However I cannot provide you with an 'emerge info' as this problem was reported 
to the ircd-hybrid development (me and others) by a Gentoo user trying to 
compile ircd-hybrid on AMD64. If you manage to get this resolved that would be 
great because as far as I can tell, this is not related to our code but to the 
multilib itself.

Reproducible: Always
Steps to Reproduce:
1. emerge net-irc/ircd-hybrid
2.
3.

Actual Results:  
ircd-hybrid fails to build due to parse errors in AMD64 multilib

Expected Results:  
ircd-hybrid should have built successfully.
Comment 1 Simon Stelling (RETIRED) gentoo-dev 2005-09-08 09:58:50 UTC
not even masked testing on amd64. feel free to reopen with a working patch
Comment 2 Herbie Hopkins (RETIRED) gentoo-dev 2005-09-08 12:09:30 UTC
Looks like a headers problem to me. Reopening in order to attach a patch.
Comment 3 Herbie Hopkins (RETIRED) gentoo-dev 2005-09-08 12:15:50 UTC
Created attachment 67953 [details, diff]
patch to fix amd64 header bits/stat.h

Toolchain: This patch to gentoo-multilib/amd64/bits/stat.h seems to fix the
problem for me. Does it look sane to you?
Comment 4 SpanKY gentoo-dev 2005-09-08 13:11:05 UTC
Comment on attachment 67953 [details, diff]
patch to fix amd64 header bits/stat.h

i havent looked at the issue at all but i'm 99% sure that patch is wrong
Comment 5 Kevin F. Quinn (RETIRED) gentoo-dev 2005-09-08 14:43:03 UTC
My first guess as to the cause was a rogue macro definition of '__unused' - did
a quick grep and found one in src/lex.yy.c (from ircd-hybrid-7.1.1.tgz) the
following:

#if defined(__FreeBSD__)
#include <sys/cdefs.h>
#else
#define __unused
#endif

I'd guess that leads to the 'long int __unused[3]' being replaced with 'long int
[3]' in bits/stat,h which is syntatically invalid and would cause the error shown.

I suggest it would be better to do:

#if defined(__FreeBSD__)
#include <sys/cdefs.h>
#define REALLOC_SUFFIX __unused
#else
#define REALLOC_SUFFIX
#endif

and then later on in the same file (src/lex.yy.c):

static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) REALLOC_SUFFIX;

rather than:

static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) __unused;

however I haven't actually tried it.  Also a better name than REALLOC_SUFFIX may
be appropriate; I don't know what it's trying to achieve, as I don't run FreeBSD.
Comment 6 SpanKY gentoo-dev 2005-09-08 14:46:53 UTC
thanks kevin

bug is clearly in ircd-hybrid
Comment 7 JG 2006-06-24 08:17:19 UTC
I have a slightly different result that seems to be the same issue:

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 ../include/stdinc.h:123,
                 from ircd_lexer.l:31:
/usr/include/gentoo-multilib/amd64/bits/stat.h:103: error: syntax error before '[' token
x86_64-pc-linux-gnu-gcc -I../include -I../lib/pcre   -Wall -O2 -g -march=opteron -msse3 -O3 -pipe -c listener.c
make[1]: *** [lex.yy.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/ircd-hybrid-7.2.1/work/ircd-hybrid-7.2.1/src'
make: *** [build] Error 2

!!! ERROR: net-irc/ircd-hybrid-7.2.1 failed.
Call stack:
  ebuild.sh, line 1540:   Called dyn_compile
  ebuild.sh, line 940:   Called src_compile
  ircd-hybrid-7.2.1.ebuild, line 89:   Called die
Comment 8 Markus Ullmann (RETIRED) gentoo-dev 2006-06-24 11:47:33 UTC
Created attachment 90048 [details, diff]
7.2.1-amd64-multilib.patch

Please test with this patch if it works for you
Comment 9 Guido Passet 2006-06-29 02:13:09 UTC
(In reply to comment #8)
> Created an attachment (id=90048) [edit]
> 7.2.1-amd64-multilib.patch
> 
> Please test with this patch if it works for you

Yeps. This patch works for me.

Cheers,
guid0

Comment 10 Markus Ullmann (RETIRED) gentoo-dev 2006-06-30 07:47:23 UTC
Okay, thanks for testing :)