Bug 72833 - wireless-tools fails to compile (bad CFLAG munging)
Bug#: 72833 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: henrik@brixandersen.dk Reported By: vapier@gentoo.org
Component: Applications
URL: 
Summary: wireless-tools fails to compile (bad CFLAG munging)
Keywords:  
Status Whiteboard: 
Opened: 2004-11-29 10:33 0000
Description:   Opened: 2004-11-29 10:33 0000
i686-pc-linux-gnu-gcc -pipe -march=pentium4 -O2 -frename-registers
-fomit-frame-
pointer -mmmx -msse -msse2 -fdelete-null-pointer-checks -funroll-loops
-D_FILE_O
FFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -MMD    -c iwevent.c
i686-pc-linux-gnu-gcc -pipe -march=pentium4 -O2 -frename-registers
-fomit-frame-pointer -mmmx -msse -msse2 -fdelete-null-pointer-checks
-funroll-loops -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-MMD    -c ifrename.c
i686-pc-linux-gnu-gcc -shi686-pc-linux-gnu-ared -o libiw.so.28
-Wl,-soname,libiw.so.28 -lm -lc iwlib.so
i686-pc-linux-gnu-gcc: unrecognized option `-shi686-pc-linux-gnu-ared'
/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../crt1.o(.text+0x18): In function
`_start':
init.c: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [libiw.so.28] Error 1
make: *** Waiting for unfinished jobs....

!!! ERROR: net-wireless/wireless-tools-28_pre3 failed.
!!! Function src_compile, Line 51, Exitcode 2
!!! emake failed

Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.4.3,
glibc-2.3.4.20041102-r0,glibc-2.3.4.20041006-r0, 2.6.10-rc2 i686)
=================================================================
System uname: 2.6.10-rc2 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz
Gentoo Base System version 1.6.6
distcc 2.18.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r6,sys-devel/autoconf-2.13
Automake:
sys-devel/automake-1.5,sys-devel/automake-1.9.3,sys-devel/automake-1.8.5-r2,sys-devel/automake-1.7.9,sys-devel/automake-1.6.3,sys-devel/automake-1.4_p6
Binutils: sys-devel/binutils-2.15.92.0.2-r2,sys-devel/binutils-2.15.94.0.1
Headers:  sys-kernel/linux26-headers-1,sys-kernel/linux26-headers-2.6.8.1-r2
Libtools: sys-devel/libtool-1.5.10
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-pipe -march=pentium4 -O2 -frename-registers -fomit-frame-pointer -mmmx
-msse -msse2 -fdelete-null-pointer-checks -funroll-loops -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /opt/glftpd/etc /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/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="-pipe -march=pentium4 -O2 -frename-registers -fomit-frame-pointer
-mmmx -msse -msse2 -fdelete-null-pointer-checks -funroll-loops
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache cvs distlocks noauto noinfo sandbox sfperms sign"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
MAKEOPTS="-j4"
PKGDIR="/mnt/space/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://gentoo/gentoo-portage"
USE="X aalib acl acpi adns alsa apache2 avi bitmap-fonts cdr crypt cscope cups
dedicated dga directfb dvd dvdr emu10k1 encode esd f77 fbcon flac flash
foomaticdb fortran gd gd-external gdbm gif gpm gstreamer gtk gtk2 imagemagick
imap imlib ipv6 joystick jpeg kde libwww mad maildir mikmod mmx moznocompose
moznoirc moznomail mpeg mysql nas ncurses nls nocardbus nptl nptlonly offensive
oggvorbis opengl oss pam pdflib perl php pic plotutils png pnp python quicktime
readline samba sdl skey slp snmp socks5 speex spell sqlite sse ssl svga tcltk
tcpd tiff truetype wavelan x86 xine xml xml2 xmms xv zlib video_cards_nvidia"

------- Comment #1 From Henrik Brix Andersen 2004-11-29 12:46:55 0000 -------
Looks weird - could you please attach the output of 'emerge -v --info'?

------- Comment #2 From SpanKY 2004-11-29 17:38:37 0000 -------
it doesnt matter if i attach that, the sed stuff in src_unpack is still wrong

    sed -i "s:ar:$(tc-getAR):" \
        ${S}/Makefile

that generates this bad diff:
-       $(CC) -shared -o $@ -Wl,-soname,$@ $(LIBS) -lc $^
+       $(CC) -shi686-pc-linux-gnu-ared -o $@ -Wl,-soname,$@ $(LIBS) -lc $^

every single one of those sed statements should have a match clause:
"/^AR/s:ar:$(tc-getAR):"

also, they should all be joined into 1 big sed instead of many small ones

------- Comment #3 From Henrik Brix Andersen 2004-11-30 02:40:50 0000 -------
Fixed.