tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

buildlink adds -std=gnu99 to gcc, breaks x11/gtk build on macosx

    I've got a new macbook pro laptop with the latest xcode and i'm 
trying to duplicate my desktop netbsd environment on it, but pkgsrc
is failing to build x11/gtk because it is silently adding -std=gnu99
to the gcc command line and causing glib inline functions to mess
up  ---  they don't inline and end up generating multi-defined symbol 
error (see bottom for example compile failure).

    the problem is an artifact of this file:

and functions defined like this:

g_bit_nth_lsf (guint32 mask,
               gint    nth_bit)

pkgsrc generates 22 non-inline copies of this:

xxcdc[871]> d
cwd: /usr/pkg/src/pkgsrc/x11/gtk/work/gtk+-1.2.10/gdk
xxxcdc[872]> nm *.o | fgrep g_bit_nth_lsf | head -1
00000000 T _g_bit_nth_lsf
xxxcdc[873]> nm *.o | fgrep g_bit_nth_lsf | wc
      22      66     572

why is -std=gnu99 being added?   how can we switch it off?

BTW, this was very difficult to debug because the pkgsrc code goes
out of its way to HIDE the fact that it is adding -std=gnu99 in
the compile output.  if you look at the bmake output and manually
type in the gcc command it shows (without the -std=gnu99) the 
error doesn't happen.


build error:

xxxcdc[863]> bmake
=> Bootstrap dependency digest>=20010302: found digest-20080510
===> Skipping vulnerability checks.
WARNING: No /usr/pkg/var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/download-vulnerability-list'.
===> Building for gtk+-1.2.10nb9
/usr/bin/gnumake  all-recursive
Making all in po
gnumake[2]: Nothing to be done for `all'.
Making all in gdk
/bin/sh ../libtool --mode=link gcc  -pipe -O2 -I/usr/pkg/include -I/usr/include 
-I/usr/X11/include -Wall -L/usr/pkg/lib -L/usr/lib -L/usr/X11/lib -o 
-rpath /usr/pkg/lib -version-info 12:10:0 -export-dynamic -L/usr/pkg/lib 
-lgmodule -lglib -L/usr/X11/lib -L/usr/X11/lib -L/usr/X11/lib -L/usr/X11/lib 
-L/usr/X11/lib -lXi -lXext -lX11 -lm gdk.lo gdkcc.lo gdkcolor.lo gdkcursor.lo 
gdkdnd.lo gdkdraw.lo gdkevents.lo gdkfont.lo gdkgc.lo gdkglobals.lo gdkim.lo 
gdkimage.lo gdkinput.lo gdkpixmap.lo gdkproperty.lo gdkrgb.lo gdkrectangle.lo 
gdkregion.lo gdkselection.lo gdkvisual.lo gdkwindow.lo gdkxid.lo gxid_lib.lo  
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/' seems to be 
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/' seems to be 
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/' seems to be 
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/' seems to be 
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/' seems to be 
gcc -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o 
.libs/libgdk.12.0.10.dylib  .libs/gdk.o .libs/gdkcc.o .libs/gdkcolor.o 
.libs/gdkcursor.o .libs/gdkdnd.o .libs/gdkdraw.o .libs/gdkevents.o 
.libs/gdkfont.o .libs/gdkgc.o .libs/gdkglobals.o .libs/gdkim.o .libs/gdkimage.o 
.libs/gdkinput.o .libs/gdkpixmap.o .libs/gdkproperty.o .libs/gdkrgb.o 
.libs/gdkrectangle.o .libs/gdkregion.o .libs/gdkselection.o .libs/gdkvisual.o 
.libs/gdkwindow.o .libs/gdkxid.o .libs/gxid_lib.o  
/usr/pkg/src/pkgsrc/x11/gtk/work/.buildlink/lib/libglib.dylib -lXi 
/usr/X11/lib/libX11.6.2.0.dylib -lm 
/usr/pkg/src/pkgsrc/x11/gtk/work/.buildlink/lib/libintl.dylib  -install_name  
/usr/pkg/lib/libgdk.12.dylib -compatibility_version 13 -current_version 13.10
ld: duplicate symbol _g_bit_nth_lsf in .libs/gdkcc.o and .libs/gdk.o
collect2: ld returned 1 exit status
gnumake[2]: *** [] Error 1
gnumake[1]: *** [all-recursive] Error 1
gnumake: *** [all-recursive-am] Error 2
*** Error code 2

bmake: stopped in /usr/pkg/src/pkgsrc/x11/gtk
*** Error code 1

bmake: stopped in /usr/pkg/src/pkgsrc/x11/gtk

Home | Main Index | Thread Index | Old Index