Subject: Compiler weirdness.
To: None <tech-userlevel@netbsd.org>
From: Greywolf <greywolf@starwolf.com>
List: tech-userlevel
Date: 04/03/2003 11:54:17
Apologies if this is NOT the right list; I'm not sure what would be.

I'm trying to build grustibus, but it dumps core when I run it.

When I build static, it complains that it cannot find a symbol which,
after some digging, I find to be there in a library which *IS PRESENT*
in the link path and shows up in the compile-time messages, but the
compiler doesn't find it.  I'm sitting and scratching my head with a
vibroblade trying to figure out WTF.  What am I doing wrong?

Percussive diagnostics with +3 clue bricks would be most helpful.

USERLAND: current as of 25 March 2003, built from scratch.
KERNEL: 1.6Q (i.e. sans the updates for UFS2).
X11: XFree86-NetBSD-current as of 25 March 2003, built from scratch.
TOOLCHAIN IN USE: current as of 25 March 2003, built from scratch.

I typescripted this so as to show what I'm doing.   THIS IS KIND OF LONG,
apologies for the bandwidth.

Note that the symbol is found via nm in one of the libs, and said lib is
specified prior to the lib which references said symbol.

---
Script started on Thu Apr  3 09:06:36 2003
rivendell 501# ./configure
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gnome-config... /usr/X11/bin/gnome-config
checking if /usr/X11/bin/gnome-config works... yes
checking for orbit-config... /usr/local/bin/orbit-config
checking for orbit-idl... /usr/local/bin/orbit-idl
checking for working ORBit environment... yes
checking for gnorba libraries... yes
checking for strerror in -lcposix... no
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking what warning flags to pass to the C compiler... -Wall -Wunused
checking what language compliance flags to pass to the C compiler...
checking for pthread_create in -lpthread... yes
checking for gtk-config... /usr/X11/bin/gtk-config
checking for GTK - version >= 1.2.0... yes
checking whether we have GTK > 1.2... checking for SmcSaveYourselfDone in -lSM... yes
checking for X11/SM/SMlib.h... yes
checking for XpmFreeXpmImage in -lXpm... yes
checking host system type... i386-unknown-netbsdelf1.6Q
checking for ranlib... ranlib
checking for working const... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking for working alloca.h... no
checking for alloca... yes
checking for unistd.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether we are using the GNU C Library 2.1 or newer... no
checking for argz.h... no
checking for limits.h... yes
checking for locale.h... yes
checking for nl_types.h... yes
checking for malloc.h... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for feof_unlocked... no
checking for fgets_unlocked... no
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getuid... yes
checking for mempcpy... no
checking for munmap... yes
checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for stpcpy... no
checking for strchr... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for tsearch... yes
checking for __argz_count... no
checking for __argz_stringify... no
checking for __argz_next... no
checking for iconv... no, consider installing GNU libiconv
checking for nl_langinfo and CODESET... yes
checking for LC_MESSAGES... yes
checking whether NLS is requested... yes
checking whether included gettext is requested... no
checking for libintl.h... yes
checking for GNU gettext in libc... no
checking for GNU gettext in libintl... yes
checking for dcgettext... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for bison... bison
checking version of bison... 1.28, ok
checking for catalogs to be installed...  no fr
updating cache ./config.cache
creating ./config.status
creating Makefile
creating grustibus.spec
creating macros/Makefile
creating src/Makefile
creating intl/Makefile
creating po/Makefile.in
creating po/Makefile
creating config.h
config.h is unchanged
creating po/POTFILES
creating po/Makefile
rivendell 502# make CFPAG    FLAGS="-g -O2 -static"
make  all-recursive
Making all in intl
Making all in po
Making all in macros
Making all in src
orbit-idl ../src/Gtm.idl
../src/Gtm.idl:3: Warning: `add_url' underscores within identifiers are discouraged for use with C-language IDL mappings

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c Gtm-common.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c Gtm-skels.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c Gtm-stubs.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c grustibus.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c gui.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c fileio.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c mameio.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c support.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c interface.c

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/include
    -I/usr/X11/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
    -I/usr/X11/lib/gnome-libs/include -I/usr/local/include/glib/glib-1.2
    -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0
    -I/usr/X11/include/gtk-1.2 -I/usr/X11/include -I/usr/X11/include/gtk-1.2
    -I/usr/local/include/glib/glib-1.2 -I/usr/local/lib/glib/include
    -I/usr/X11/include -g -O2 -static -c callbacks.c

gcc -g -O2 -static -o grustibus Gtm-common.o Gtm-skels.o Gtm-stubs.o
    grustibus.o gui.o fileio.o mameio.o support.o interface.o callbacks.o
    -L/usr/X11/lib -Wl,-R/usr/X11/lib -L/usr/local/lib -Wl,-R/usr/local/lib
    -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -lXi
    -lXext -lX11 -lgnome -lgnomesupport -lesd -lossaudio -laudiofile -lm
    -lglib -lintl -lintl -L/usr/X11/lib -Wl,-R/usr/X11/lib -L/usr/local/lib
    -Wl,-R/usr/local/lib -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgnome
    -lgnomesupport -lesd -lossaudio -laudiofile -lgdk_pixbuf -lgtk -lgdk
						^^^^^^^^^^^^
    -lgmodule -lglib -lintl -lXi -lXext -lX11 -lm -lgnomecanvaspixbuf -lgnorba
						  ^^^^^^^^^^^^^^^^^^^
    -lORBitCosNaming -lORBit -lIIOP -lwrap -lORBitutil -lgnomeui -lart_lgpl
    -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -lXi -lXext -lX11 -lgnome
    -lgnomesupport -lesd -lossaudio -laudiofile -lm -lglib -lintl

/usr/X11/lib/libgnomecanvaspixbuf.a(gnome-canvas-pixbuf.o): In function
`gnome_canvas_pixbuf_draw':
    gnome-canvas-pixbuf.o(.text+0xfd9): undefined reference to
    `gdk_pixbuf_render_to_drawable_alpha'

*** Error code 1

Stop.
make: stopped in /usr/src/local/grustibus-0.43/src
*** Error code 1

Stop.
make: stopped in /usr/src/local/grustibus-0.43
*** Error code 1

Stop.
make: stopped in /usr/src/local/grustibus-0.43
rivendell 503# nm -o /usr/X11/lib/libgdk_pixbuf.a |
> grep gdk_pixbuf_render_to_dr awable_alpha
/usr/X11/lib/libgdk_pixbuf.a:gdk-pixbuf-render.o:0000068c T gdk_pixbuf_render_to_drawable_alpha
rivendell 504# exit

Script done on Thu Apr  3 09:08:37 2003
---

				--*greywolf;
--
NetBSD: Multi-platform OS