on 2011-5-28 6:23, Richard Purdie wrote: > On Fri, 2011-05-27 at 22:24 +0100, Phil Blundell wrote: >> On Fri, 2011-05-27 at 14:09 -0700, Saul Wold wrote: >>> From: Yu Ke >>> >>> [YOCTO #737] >>> >>> The AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) >>> macro seems not work well in ppc arch, so this patch force the DLOPEN_LIBS="-ldl" >>> >> >> That's a bit of a weird report. Do we know why it doesn't work? I >> guess we don't care all that much about Solaris targets, but equally I >> can't think of any reason why ppc should be special. > > Seconded. I'd like to see the config.log of that failing on ppc... > > Cheers, > > Richard > The marco in question is in xorg-server-1.10.1/configure.ac " AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) AC_SUBST(DLOPEN_LIBS) " Ideally, the dlopen test should fail since dlopen is not available in libc, and then DLOPEN_LIBS="-ldl" is executed. In this case, the later build will correctly link libdl. qemux86 fall into this case. But in ppc case, the dlopen test unfortunately pass, and DLOPEN_LIBS become "", which caused later linker error of unresolved dlopen reference. but I did not yet understand why ppc is so special. For detail, I've attached two config.log, one for ppc, one for qemux86. in ppc, configure:15235: checking for dlopen configure:15235: result: yes in qemux86: configure:15235: checking for dlopen configure:15235: i586-poky-linux-gcc -march=i586 --sysroot=/home/kyu3/sdb/test/tmp/sysroots/qemux86 -std=gnu99 -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--as-needed conftest.c >&5 /tmp/ccaQGSPX.o: In function `main': /home/kyu3/sdb/test/tmp/work/i586-poky-linux/xserver-xf86-lite-1.10.1-r0/xorg-server-1.10.1/conftest.c:74: undefined reference to `dlopen' collect2: ld returned 1 exit status configure:15235: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "xorg-server" | #define PACKAGE_TARNAME "xorg-server" | #define PACKAGE_VERSION "1.10.1" | #define PACKAGE_STRING "xorg-server 1.10.1" | #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg" | #define PACKAGE_URL "" | #define PACKAGE "xorg-server" | #define VERSION "1.10.1" | #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 PACKAGE_VERSION_MAJOR 1 | #define PACKAGE_VERSION_MINOR 10 | #define PACKAGE_VERSION_PATCHLEVEL 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define YYTEXT_POINTER 1 | #define _FILE_OFFSET_BITS 64 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_FCNTL_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define HAVE_STROPTS_H 1 | #define HAVE_FNMATCH_H 1 | #define HAVE_SYS_UTSNAME_H 1 | #define SIZEOF_UNSIGNED_LONG 4 | #define HAVE_BYTESWAP_H 1 | /* end confdefs.h. */ | /* Define dlopen to an innocuous variant, in case declares dlopen. | For example, HP-UX 11i declares gettimeofday. */ | #define dlopen innocuous_dlopen | | /* System header to define __stub macros and hopefully few prototypes, | which can conflict with char dlopen (); below. | Prefer to if __STDC__ is defined, since | exists even on freestanding compilers. */ | | #ifdef __STDC__ | # include | #else | # include | #endif | | #undef dlopen | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char dlopen (); | /* The GNU C library defines this for functions which it implements | to always fail with ENOSYS. Some functions are actually named | something starting with __ and the normal name is an alias. */ | #if defined __stub_dlopen || defined __stub___dlopen | choke me | #endif | | int | main () | { | return dlopen (); | ; | return 0; | } configure:15235: result: no configure:15239: checking for dlopen in -ldl configure:15264: i586-poky-linux-gcc -march=i586 --sysroot=/home/kyu3/sdb/test/tmp/sysroots/qemux86 -std=gnu99 -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--as-needed conftest.c -ldl >&5 configure:15264: $? = 0 configure:15273: result: yes