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

Bug 546636

Summary: sys-process/lsof: configure script probing of glibc fails w/gcc-5
Product: Gentoo Linux Reporter: SpanKY <vapier>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 536984    

Description SpanKY gentoo-dev 2015-04-14 22:38:19 UTC
building lsof w/gcc-5 fails:
Testing C library type with x86_64-pc-linux-gnu-gcc ... 
./Configure: 2828: ./Configure: arithmetic expression: expecting primary: "   "
 * ERROR: sys-process/lsof-4.88::gentoo failed (configure phase):
 *   (no error message)

it boils down to this code:
$ cat test.c
#include <features.h>
#undef XXX
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
XXX: __GLIBC__ * 100 + __GLIBC_MINOR__
#elif defined(__GLIBC__)
XXX: __GLIBC__ * 100
#endif

$ gcc-4.9.2 -E test.c
...
# 2 "test.c" 2


XXX: 2 * 100 + 21

$ gcc-5.0.0-alpha20150322 -E bash.c
...
# 2 "test.c" 2


XXX: 
# 4 "test.c" 3 4
    2 
# 4 "test.c"
              * 100 + 
# 4 "test.c" 3 4
                      21

passing in the -P flag makes it work for all versions ...