X-Bugzilla-Reason: CC I've rebuild all packages in debian with binutils-gold and noticed that all packages using a recent version of /usr/share/aclocal/gtk-2.0.m4 fail when they are using also --as-needed.
Output is always: configure:12513: gcc -o conftest -g -O2 -D_REENTRANT -I/usr/include/gtk-2.0 - I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 - I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 - Wl,--as-needed conftest.c -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 - lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 - configure:12513: $? = 0 configure:12513: ./conftest ./conftest: symbol lookup error: ./conftest: undefined symbol: gtk_minor_version configure:12513: $? = 127 configure: program exited with status 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | #include <gtk/gtk.h> | #include <stdio.h> | #include <stdlib.h> | | int | main () | { | int major, minor, micro; | char *tmp_version; | | system ("touch conf.gtktest"); | | /* HP/UX 9 (%...@#!) writes to sscanf strings */ | tmp_version = g_strdup("2.4.0"); | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | printf("%s, bad version string\n", "2.4.0"); | exit(1); | } | | if ((gtk_major_version != 2) || | (gtk_minor_version != 18) || | (gtk_micro_version != 4)) | { | printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", | 2, 18, 4, | gtk_major_version, gtk_minor_version, gtk_micro_version); | printf ("*** was found! If pkg-config was correct, then it is best\n"); | printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | printf("*** required on your system.\n"); | printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); | printf("*** to point to the correct configuration files\n"); | } | else if ((gtk_major_version != GTK_MAJOR_VERSION) || | (gtk_minor_version != GTK_MINOR_VERSION) || | (gtk_micro_version != GTK_MICRO_VERSION)) | { | printf("*** GTK+ header files (version %d.%d.%d) do not match\n", | GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); | printf("*** library (version %d.%d.%d)\n", | gtk_major_version, gtk_minor_version, gtk_micro_version); | } | else | { | if ((gtk_major_version > major) || | ((gtk_major_version == major) && (gtk_minor_version > minor)) || | ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) | { | return 0; | } | else | { | printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", | gtk_major_version, gtk_minor_version, gtk_micro_version); | printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", | major, minor, micro); | printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); | printf("***\n"); | printf("*** If you have already installed a sufficiently new version, this error\n"); | printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); | printf("*** being found. The easiest way to fix this is to remove the old version\n"); | printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); | printf("*** correct copy of pkg-config. (In this case, you will have to\n"); | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | printf("*** so that the correct libraries are found at run- | } | } | return 1; | } So i've started to test it without --as-needed and then it works. So it is probably a bug introduced by fixing #10880. readelf shows following when linked without --as-needed: 0x0000000000000001 (NEEDED) Shared library: [libgtk-x11-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libgdk-x11-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libatk-1.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libpangoft2-1.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libgdk_pixbuf-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [libpangocairo-1.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libgio-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libcairo.so.2] 0x0000000000000001 (NEEDED) Shared library: [libpango-1.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libfreetype.so.6] 0x0000000000000001 (NEEDED) Shared library: [libfontconfig.so.1] 0x0000000000000001 (NEEDED) Shared library: [libgobject-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libgmodule-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libglib-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] and following when linked with --as-needed 0x0000000000000001 (NEEDED) Shared library: [libglib-2.0.so.0] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] I think it should be provided by libgtk-x11-2.0.so.0. If I add -lgtk-x11-2.0 before --as-needed it works. The reduced size version of the gcc call is: gcc -o conftest `pkg-config --cflags gtk+-x11-2.0` -Wl,--as-needed conftest.c `pkg-config --libs gtk+-x11-2.0` So you can try to compile the attached program, compile it with the mentioned gcc call and then try to start it with ./conftest I've used binutils-gold 2.20-4 from Debian sid. Downstream bug is http://bugs.debian.org/559183 -- Summary: Unresolved symbols when using --as-needed Product: binutils Version: 2.20 Status: NEW Severity: normal Priority: P2 Component: gold AssignedTo: ian at airs dot com ReportedBy: robert dot wohlrab at gmx dot de CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=11042 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils