Subject: gnome2/gcc34/amd64 build fails in graphics/cairo
To: None <netbsd-users@NetBSD.org>
From: Anders Lindgren <ali@df.lth.se>
List: netbsd-users
Date: 10/22/2005 23:10:56
In case this can be useful to someone...

---------------8<--------------------8<----------------------
# uname -v
NetBSD 3.0_BETA (GENERIC) #0: Sat Oct  8 11:09:08 UTC 2005 
builds@b2.netbsd.org:/home/builds/ab/netbsd-3/amd64/200510080000Z-obj/home/builds/ab/netbsd-3/src/sys/arch/amd64/compile/GENERIC
---------------8<--------------------8<----------------------

It seems there are some amd64 optimizer flag additions in gcc 3.4.4, so I 
installed the minimum packages needed to build the gcc34 package (only 
C/C++), installed it, and then went on to install meta-pkgs/gnome from 
pkgsrc HEAD as of a few days ago, with the following mk.conf (suggested by 
the cpuflags package, which in turn outputs nothing for my athlon64):

COPTS?=  -pipe -mcpu=athlon64 -mtune=athlon64 ${DEFCOPTS}
CFLAGS+= -pipe -mcpu=athlon64 -mtune=athlon64

I put /usr/pkg/gcc34/bin first in my path and tried to build gnome.
It dies with weirdo looking libgcc errors in graphics/cairo, however.
I have just cvs update:d my pkgsrc tree and neither gcc34 nor cairo was 
changed since my last update, so this error is probably still lurking
there (Removing the mk.conf stuff made no difference, as expected...)

The package installs fine with the base gcc 3.3.3 and no CFLAGS stuff in 
mk.conf, so this is related to gcc 3.4.4 somehow.

Continuing to build gnome now with a gcc 3.3.3 built cairo and the rest 
(well, we'll see how far I get ;-) ) built with pkgsrc gcc 3.4.4...

Here's the linking breakage in graphics/cairo:

---------------8<--------------------8<----------------------
Making all in test
/bin/sh ../libtool --tag=CC --mode=link cc  -O2 -pipe -mcpu=athlon64 
-mtune=athlon64 -I/usr/pkg/include -I/usr/include 
-I/usr/pkg/include/freetype2 -DGLX_GLXEXT_LEGACY -I/usr/pkg/gcc34/include 
-I/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/include 
-L/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4 
-Wl,-R/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4 -L/usr/pkg/gcc34/lib 
-Wl,-R/usr/pkg/gcc34/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib 
-Wl,-R/usr/lib -L/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/ 
-Wl,-R/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/ -L/usr/X11R6/lib 
-Wl,-R/usr/X11R6/lib -o imagediff  imagediff.o libcairotest.la 
../src/libcairo.la   -pthread  -lintl -lm
cc -O2 -pipe -mcpu=athlon64 -mtune=athlon64 
-I/usr/pkgsrc/graphics/cairo/work/.buildlink/include 
-I/usr/pkgsrc/graphics/cairo/work/.buildlink/include/freetype2 
-DGLX_GLXEXT_LEGACY 
-I/usr/pkgsrc/graphics/cairo/work/.buildlink/gcc34/include 
-I/usr/pkgsrc/graphics/cairo/work/.buildlink/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/include 
-Wl,-R/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4 
-Wl,-R/usr/pkg/gcc34/lib -Wl,-R/usr/pkg/lib 
-Wl,-R/usr/pkg/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/ -Wl,-R/usr/X11R6/lib 
-o .libs/imagediff imagediff.o -pthread 
-L/usr/pkgsrc/graphics/cairo/work/.buildlink/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4 
-L/usr/pkgsrc/graphics/cairo/work/.buildlink/gcc34/lib 
-L/usr/pkgsrc/graphics/cairo/work/.buildlink/lib 
-L/usr/pkgsrc/graphics/cairo/work/.buildlink/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/ 
-L/usr/pkgsrc/graphics/cairo/work/.x11-buildlink/lib 
./.libs/libcairotest.a ../src/.libs/libcairo.so 
/usr/pkgsrc/graphics/cairo/work/.buildlink/lib/libXrender.so -lX11 
/usr/pkgsrc/graphics/cairo/work/.buildlink/lib/libpng.so 
/usr/pkgsrc/graphics/cairo/work/.buildlink/lib/libglitz.so 
/usr/pkgsrc/graphics/cairo/work/.buildlink/lib/libfontconfig.so 
/usr/pkgsrc/graphics/cairo/work/.buildlink/lib/libexpat.so 
/usr/pkgsrc/graphics/cairo/work/.buildlink/lib/libfreetype.so -lz -lintl 
-lm -Wl,--rpath -Wl,/usr/pkg/lib -Wl,--rpath 
-Wl,/usr/pkgsrc/graphics/cairo/work/.buildlink/lib
/usr/bin/ld: .libs/imagediff: hidden symbol `__popcountdi2' in 
/usr/pkgsrc/graphics/cairo/work/.buildlink/gcc34/lib/gcc/x86_64--netbsd3.0/3.4.4/libgcc.a(_popcountsi2.oS) 
is referenced by DSO
collect2: ld returned 1 exit status
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/graphics/cairo/work/cairo-1.0.2/test
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/graphics/cairo/work/cairo-1.0.2
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/graphics/cairo/work/cairo-1.0.2
*** Error code 1
---------------8<--------------------8<----------------------