Bug 11420 - undefined reference to "fmod", "dlopen", "sem_wait", "openpty"
Summary: undefined reference to "fmod", "dlopen", "sem_wait", "openpty"
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 7.1
: P2 normal
Target Milestone: 7.1
Assignee: Paul Pluzhnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-23 07:55 UTC by robert.bu
Modified: 2018-05-04 14:13 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed: 2018-04-17 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description robert.bu 2010-03-23 07:55:35 UTC
When configure option has "with-python=/home/STools/GNU/python-2.6.5", the
configure script complains about can not find python-2.6, python-2.5,
python-2.4. The root cause is that the test case in configure can not be built
because of the undefined references mentioned in Summary.

I added "-lm -ldl -lrt -lutil" to "LIBS" in the function of "AC_TRY_LIBPYTHON"
in gdb/configure.ac.

My platform is Red Hat Enterprise Linux AS release 4 (Nahant Update 7).
Comment 1 Paul Pluzhnikov 2018-04-17 01:37:30 UTC
https://stackoverflow.com/a/49868387 provides a partial fix.
Comment 2 Sourceware Commits 2018-05-04 14:10:24 UTC
The master branch has been updated by Simon Marchi <simark@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bf27f0e2c76839af8524e053cca271934150a90c

commit bf27f0e2c76839af8524e053cca271934150a90c
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Fri May 4 10:07:58 2018 -0400

    configure uses incorrect link order when testing libpython
    
    References:
    
    https://stackoverflow.com/a/49868387
    https://sourceware.org/bugzilla/show_bug.cgi?id=11420
    
    Configure uses "gcc -o conftest -g ... conftest.c -ldl -lncurses -lm -ldl
    ... -lpthread ... -lpython2.7" when deciding whether give libpython is
    usable.
    
    That of course is the wrong link order, and only works for shared libraries
    (mostly by accident), and only on some systems.
    
    gdb/ChangeLog:
    
    	PR gdb/11420
    	* configure.ac: Prepend libpython.
    	* python/python-config.py: Likewise.
    	* configure: Regenerate.
Comment 3 Simon Marchi 2018-05-04 14:13:23 UTC
Fixed by patch above, thanks Paul.