[PATCH] XDM: Fix FTBFS with gold or recent gcc releases.

Dan Nicholson dbn.lists at gmail.com
Sat Feb 19 18:11:44 PST 2011


On Sat, Feb 19, 2011 at 11:35 AM, Alan Coopersmith
<alan.coopersmith at oracle.com> wrote:
> On 02/19/11 11:30 AM, Fernando Lemos wrote:
>> On Sat, Feb 19, 2011 at 6:47 PM, Alan Coopersmith
>> <alan.coopersmith at oracle.com> wrote:
>>> On 02/19/11 10:28 AM, Mark Kettenis wrote:
>>>>> Date: Sat, 19 Feb 2011 18:03:04 +0000
>>>>> From: Fernando Lemos <fernandotcl at gmail.com>
>>>>>
>>>>> /usr/bin/ld: session.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
>>>>> /usr/bin/ld: note: 'dlclose@@GLIBC_2.2.5' is defined in DSO
>>>>> /lib64/libdl.so.2 so try adding it to the linker command line
>>>>> /lib64/libdl.so.2: could not read symbols: Invalid operation
>>>>> collect2: ld returned 1 exit status
>>>>> make[2]: *** [xdm] Error 1
>>>>>
>>>>> Adding AC_SEARCH_LIBS([dlopen], [dl]) solves it, not sure there isn't
>>>>> a better way to do it?
>>>>
>>>> Looks like AC_LIBTOOL_DLOPEN does the check for dlopen/-ldl, but
>>>> doesn't automatically add it.  You'll need to add @LIBADD_DL@ and/or
>>>> $(LIBADD_DL) in the appropriate places.  That's probably a better way
>>>> to fix this issue.
>>>
>>> Unfortunately, it looks like that worked with libtool 1.x but I don't
>>> see it in libtool 2.2.10.   I'm not seeing any obvious way to get the
>>> results of libtools check into a variable we can use.
>> [...]
>>
>> Indeed, I did some tests with libtool 2.2 and couldn't get LIBADD_LD
>> to show up. The documentation for libtool 2.4 doesn't mention
>> LIBADD_LD either, and nothing similar is documented for
>> AC_LIBTOOL_DLOPEN or LT_INIT.
>>
>> Should I go ahead and submit a new patch that uses AC_SEARCH_LIBS?
>
> Sure, though I'll probably wait a few days before pushing to master
> to see if any of our autotools gurus can find a better way.   It does
> look like the xserver configure.ac does the check manually instead of
> relying on libtool, so we may not have a better answer for the range
> of libtools we support.

Yeah, I think AC_LIBTOOL_DLOPEN (or LT_INIT([dlopen]) with current
libtool) is more about building modules that can be dlopened.
Libtool's answer for using dlopen portably is libltdl:

http://www.gnu.org/software/libtool/manual/libtool.html#Using-libltdl

If we're content with just requiring -ldl and dlopen(), then I think
AC_CHECK_LIB/AC_SEARCH_LIBS is needed.

--
Dan


More information about the xorg-devel mailing list