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



hi-
    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:
        x11/gtk/work/.buildlink/include/glib/glib-1.2/glib.h

and functions defined like this:

G_INLINE_FUNC gint
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
xxxcdc[874]> 


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.

chuck


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 libgdk.la 
-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  
-lintl
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libX11.la' seems to be 
moved
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libXdmcp.la' seems to be 
moved
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libXau.la' seems to be 
moved
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libXau.la' seems to be 
moved
libtool: link: warning: 
`/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libXdmcp.la' seems to be 
moved
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  
-L/usr/pkg/src/pkgsrc/x11/gtk/work/.buildlink/lib 
-L/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib 
/usr/pkg/src/pkgsrc/x11/gtk/work/.buildlink/lib/libgmodule.dylib 
/usr/pkg/src/pkgsrc/x11/gtk/work/.buildlink/lib/libglib.dylib -lXi 
/usr/X11/lib/libXext.6.4.0.dylib 
/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libX11.6.2.0.dylib 
/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libXdmcp.6.0.0.dylib 
/usr/pkg/src/pkgsrc/x11/gtk/work/.x11-buildlink/lib/libXau.6.0.0.dylib 
/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]: *** [libgdk.la] Error 1
gnumake[1]: *** [all-recursive] Error 1
gnumake: *** [all-recursive-am] Error 2
*** Error code 2

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

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




Home | Main Index | Thread Index | Old Index