diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-04-18 15:11:59 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-04-18 15:11:59 +0000 |
commit | 7f5331423810a41cc31345c64cf7ee9fa55c5948 (patch) | |
tree | 21c4cc725a82469739e824ca7a1ac74bac3f9e32 | |
parent | 001822aa58d2998ecc11067c07863745630ad388 (diff) | |
download | fsf-binutils-gdb-7f5331423810a41cc31345c64cf7ee9fa55c5948.zip fsf-binutils-gdb-7f5331423810a41cc31345c64cf7ee9fa55c5948.tar.gz fsf-binutils-gdb-7f5331423810a41cc31345c64cf7ee9fa55c5948.tar.bz2 |
put -lpthread into LIBS instead of CONFIG_LDFLAGS.
The problem showed up on AIX when we switched from the system linker
to GNU ld. What happens is that configure is adding -lpthdebug to
CONFIG_LDFLAGS when AIX thread debugging support is detected. But
this causes the "-lpthread" switch to be placed at the _before_
GDB's .o files (see Makefile.in):
INTERNAL_LDFLAGS = [...] $(CONFIG_LDFLAGS)
[...]
gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
rm -f gdb$(EXEEXT)
$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
And as a result of this, the linker reports an error due to some
symbols in aix-thread.o not being satisfied.
This patch adds the "-lpthread" switch to LIBS instead, which should
be the right place to add it.
gdb/ChangeLog (Tristan Gingold):
* configure.ac (aix): Put -lpthread into libs.
* configure: Regenerate.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rwxr-xr-x | gdb/configure | 2 | ||||
-rw-r--r-- | gdb/configure.ac | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3fa5738..464d412 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-04-18 Tristan Gingold <gingold@adacore.com> + + * configure.ac (aix): Put -lpthread into libs. + * configure: Regenerate. + 2012-04-18 Tom Tromey <tromey@redhat.com> * linespec.c (convert_linespec_to_sals): Don't use diff --git a/gdb/configure b/gdb/configure index bb2d3c0..60652d6 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16221,7 +16221,7 @@ $as_echo "$gdb_cv_have_aix_thread_debug" >&6; } if test $gdb_cv_have_aix_thread_debug = yes; then CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" CONFIG_OBS="${CONFIG_OBS} aix-thread.o" - CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug" + LIBS="$LIBS -lpthdebug" # Older versions of AIX do not provide the declaration for # the getthrds function (it appears that it was introduced diff --git a/gdb/configure.ac b/gdb/configure.ac index de500cc..03cd666 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1682,7 +1682,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then if test $gdb_cv_have_aix_thread_debug = yes; then CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" CONFIG_OBS="${CONFIG_OBS} aix-thread.o" - CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug" + LIBS="$LIBS -lpthdebug" # Older versions of AIX do not provide the declaration for # the getthrds function (it appears that it was introduced |