From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12941 invoked by alias); 29 Aug 2009 00:48:21 -0000 Received: (qmail 12933 invoked by uid 22791); 29 Aug 2009 00:48:21 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_92,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Aug 2009 00:48:11 +0000 Received: from zps78.corp.google.com (zps78.corp.google.com [172.25.146.78]) by smtp-out.google.com with ESMTP id n7T0m8DG013264 for ; Fri, 28 Aug 2009 17:48:08 -0700 Received: from ewy22 (ewy22.prod.google.com [10.241.103.22]) by zps78.corp.google.com with ESMTP id n7T0m5bl002695 for ; Fri, 28 Aug 2009 17:48:06 -0700 Received: by ewy22 with SMTP id 22so2465638ewy.4 for ; Fri, 28 Aug 2009 17:48:05 -0700 (PDT) Received: by 10.211.131.34 with SMTP id i34mr2015961ebn.35.1251506885352; Fri, 28 Aug 2009 17:48:05 -0700 (PDT) Received: from localhost.localdomain.google.com ([67.218.105.202]) by mx.google.com with ESMTPS id 23sm893782eya.3.2009.08.28.17.48.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 Aug 2009 17:48:04 -0700 (PDT) To: sje@cup.hp.com Cc: gcc@gcc.gnu.org Subject: Re: Checking for -rdynamic flag in gcc/configure References: <200908282349.n7SNnK301767@lucas.cup.hp.com> From: Ian Lance Taylor Date: Sat, 29 Aug 2009 15:36:00 -0000 In-Reply-To: <200908282349.n7SNnK301767@lucas.cup.hp.com> (Steve Ellcey's message of "Fri\, 28 Aug 2009 16\:49\:20 -0700 \(PDT\)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00535.txt.bz2 Steve Ellcey writes: > I have a question about the check for -rdynamic in gcc/configure. > What we have in configure.ac is: > > # Check -rdynamic > LDFLAGS="$LDFLAGS -rdynamic" > AC_MSG_CHECKING([for -rdynamic]) > AC_TRY_LINK([],[return 0;], > [AC_MSG_RESULT([yes]); have_rdynamic=yes], > [AC_MSG_RESULT([no])]) > if test x"$have_rdynamic" = x"yes" ; then > pluginlibs="-rdynamic" > fi > > The problem I have is that on HP-UX this test will set have_rdynamic > to yes even though the HP linker doesn't understand the option. > The AC_TRY_LINK works because the linker prints a warning message > about not understanding -rdynamic but still runs and creates an > object file. Thus the configure script thinks the HP linker does > know about the -rdynamic flag and continues to use it (resulting > in more warnings during the GCC build). > > Any ideas on how to address this? Link a small program with -rdynamic, one which defines a globally visible function which is not called. Run objdump -T and see if you can see that symbol in the output. If you follow this path you must do the in_tree_ld/ld_ver dance so that cross-compilers continue to work. Or, run ld --help and look for --export-dynamic. Ian