http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.29.tar.gz (no dependencies, so easy to test) when built with a gcc 4.8.3 linux crosscompiler plus -flto, i get: mips-linux-musl-gcc -L/media/3T/x-prefix/mips/lib -isystem /media/3T/x-prefix/mips/include -s -Wl,--gc-sections -Wl,-z,relro,-z,now -flto -static -Wl,-s -D_GNU_SOURCE -D_BSD_SOURCE -fdata-sections -ffunction-sections -Os -g0 -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack -ftree-dce -s -Os -flto -MMD -o iwlist iwlist.o libiw.a -lm lto1: internal compiler error: in read_cgraph_and_symbols, at lto/lto.c:2935 (the crosscompiler is built from the musl-cross project, current tip as of today, using musl 1.1.1; but my guess is that this would happen with other libcs as well)
i forgot to add that the same works fine with exactly the same toolchain built for armv7l.
maybe related (fails also only on mips with -flto) libpcap 1.3.0 (compiled WITH -fPIC) http://www.tcpdump.org/release/libpcap-1.3.0.tar.gz mips-linux-musl-gcc -L/media/3T/x-prefix/mips/lib -isystem /media/3T/x-prefix/mips/include -shared -Wl,-soname,libpcap.so.$MAJOR_VER -s -Wl,--gc-sections -Wl,-z,relro,-z,now -flto \ -o libpcap.so.$VER pcap-linux.o pcap-usb-linux.o pcap-can-linux.o pcap-netfilter-linux.o fad-gifc.o pcap.o inet.o gencode.o optimize.o nametoaddr.o etherent.o savefile.o sf-pcap.o sf-pcap-ng.o pcap-common.o bpf_image.o bpf_dump.o scanner.o grammar.o bpf_filter.o version.o -lnl-tiny -lnl ranlib libpcap.a /home/rose/musl-cross-4.8.3/mips-linux-musl/lib/gcc/mips-linux-musl/4.8.3/../../../../mips-linux-musl/bin/ld: /tmp/ccchmGhk.ltrans0.ltrans.o: relocation R_MIPS_HI16 against `__gnu_local_gp' can not be used when making a shared object; recompile with -fPIC /tmp/ccchmGhk.ltrans0.ltrans.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status from the looks of it it appears of if __gnu_local_gp could be a libgcc symbol.
Maybe you can check if it is fixed with GCC 4.9.0? What mips target triplet exactly?
(In reply to Richard Biener from comment #3) > What mips target triplet exactly? mips-linux-musl (using the patches/buildscripts from https://bitbucket.org/GregorR/musl-cross, as musl support has still not been merged into gcc) but i suspect the bug affects mips-linux-* or even mips-*