From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22616 invoked by alias); 15 Jun 2010 20:36:14 -0000 Received: (qmail 22608 invoked by uid 22791); 15 Jun 2010 20:36:13 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jun 2010 20:36:04 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5FKa2Al019187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 15 Jun 2010 16:36:03 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5FKa0mO005260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jun 2010 16:36:02 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o5FKa05B029687; Tue, 15 Jun 2010 22:36:00 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o5FKZwuR029686; Tue, 15 Jun 2010 22:35:58 +0200 Date: Tue, 15 Jun 2010 20:36:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: Andreas Schwab , "H.J. Lu" , gdb-patches@sourceware.org Subject: Re: [patch] Smaller gdb: -rdynamic -> -Wl,--dynamic-list Message-ID: <20100615203558.GA29393@host0.dyn.jankratochvil.net> References: <20100513131840.GA31032@host0.dyn.jankratochvil.net> <20100516180828.GA6448@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00353.txt.bz2 On Tue, 15 Jun 2010 19:31:01 +0200, Tom Tromey wrote: > >>>>> "Andreas" == Andreas Schwab writes: > > Andreas> 2010-06-13 Andreas Schwab > Andreas> * configure.ac: Check for RDYNAMIC also for cross builds. > Andreas> * configure: Regenerate. > > This is ok. Thanks. A patch on top of this one is attached. Original code had `-rdynamic' hardcoded in the .mh files. .mh files get included iff we have ${gdb_native}. It means two things: (1) The `-rdynamic' upgrade to `-Wl,--dynamic-list' makes sense only iff we have ${gdb_native}. (2) Iff we have ${gdb_native} we should always provide at least `-rdynamic'. Current code with my change for non-$GCC configurations provided empty RDYNAMIC and thus breaking non-$GCC threading support. (OTOH there is a notice -rdynamic' is required only for $GCC thus probably nothing got broken.) Moreover as the functionality is really tested (by either AC_RUN_IFELSE or AC_TRY_LINK) it should not be needed to check $GCC. On non-$GCC the functionality test should always fail anyway. Removed the $GCC check. This patch is more a cleanup only / safer change from the original code before `-Wl,--dynamic-list' introduction. I am not aware on which configuration this patch below can change anything. No problem dropping it. Tested build on x86_64-fedora13-linux-gnu and x86_64-rhel4-linux-gnu. Thanks, Jan 2010-06-15 Jan Kratochvil * configure.ac: Always set RDYNAMIC at least as `-rdynamic'. * configure: Regenerate. --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1453,54 +1453,47 @@ aix*) ;; esac +AC_MSG_CHECKING(for the dynamic export flag) +dynamic_list=false if test "${gdb_native}" = yes; then - if test "$GCC" = "yes" ; then - # The dynamically loaded libthread_db needs access to symbols in the gdb - # executable. Older GNU ld supports --export-dynamic but --dynamic-list - # may not be supported there. - AC_MSG_CHECKING(for the dynamic export flag) - old_LDFLAGS="$LDFLAGS" - # Older GNU ld supports --export-dynamic but --dynamic-list it does not. - RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" - LDFLAGS="$LDFLAGS $RDYNAMIC" - dynamic_list=false - if test "${have_libpython}" = no; then - AC_TRY_LINK([], [], [dynamic_list=true]) - else - # Workaround http://bugs.python.org/issue4434 where static - # libpythonX.Y.a would get its symbols required for - # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. - # Problem does not happen for the recommended libpythonX.Y.so linkage. - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PYTHON_CFLAGS" - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [#include "]${have_libpython}[/Python.h"], - [int err; - Py_Initialize (); - err = PyRun_SimpleString ("import itertools\n"); - Py_Finalize (); - return err == 0 ? 0 : 1;]), - [dynamic_list=true], [], [true]) - CFLAGS="$old_CFLAGS" - fi - if $dynamic_list;then - found="-Wl,--dynamic-list" - RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' - else - RDYNAMIC="-rdynamic" - LDFLAGS="$old_LDFLAGS $RDYNAMIC" - AC_TRY_LINK([], [], - [found="-rdynamic"], - [found="no" - # Error on its usage by .mh file. - RDYNAMIC="no-rdynamic-available"]) - fi - AC_SUBST(RDYNAMIC) - LDFLAGS="$old_LDFLAGS" - AC_MSG_RESULT($found) + # The dynamically loaded libthread_db needs access to symbols in the gdb + # executable. Older GNU ld supports --export-dynamic but --dynamic-list + # may not be supported there. + old_LDFLAGS="$LDFLAGS" + # Older GNU ld supports --export-dynamic but --dynamic-list it does not. + RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" + LDFLAGS="$LDFLAGS $RDYNAMIC" + if test "${have_libpython}" = no; then + AC_TRY_LINK([], [], [dynamic_list=true]) + else + # Workaround http://bugs.python.org/issue4434 where static + # libpythonX.Y.a would get its symbols required for + # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. + # Problem does not happen for the recommended libpythonX.Y.so linkage. + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" + AC_RUN_IFELSE( + AC_LANG_PROGRAM( + [#include "]${have_libpython}[/Python.h"], + [int err; + Py_Initialize (); + err = PyRun_SimpleString ("import itertools\n"); + Py_Finalize (); + return err == 0 ? 0 : 1;]), + [dynamic_list=true], [], [true]) + CFLAGS="$old_CFLAGS" fi + LDFLAGS="$old_LDFLAGS" +fi +if $dynamic_list; then + found="-Wl,--dynamic-list" + RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' +else + found="-rdynamic" + RDYNAMIC="-rdynamic" fi +AC_SUBST(RDYNAMIC) +AC_MSG_RESULT($found) dnl For certain native configurations, we need to check whether thread dnl support can be built in or not.