From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28400 invoked by alias); 16 Nov 2011 00:02:38 -0000 Received: (qmail 28390 invoked by uid 22791); 16 Nov 2011 00:02:37 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-bw0-f47.google.com (HELO mail-bw0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Nov 2011 00:02:12 +0000 Received: by bkbzs2 with SMTP id zs2so8938349bkb.20 for ; Tue, 15 Nov 2011 16:02:11 -0800 (PST) Received: by 10.204.14.208 with SMTP id h16mr26023922bka.2.1321401731113; Tue, 15 Nov 2011 16:02:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.202.135 with HTTP; Tue, 15 Nov 2011 16:01:50 -0800 (PST) From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Wed, 16 Nov 2011 01:00:00 -0000 Message-ID: Subject: Re: Different linking behavior between g++ 4.5.2 and 4.6.1 To: Andrew Pinski Cc: gcc-help@gcc.gnu.org, Carlo Pinciroli , Jonathan Wakely , Ian Lance Taylor , doko@ubuntu.com Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00154.txt.bz2 Hi Andrew and Jonathan (cc: Ian and Matthias since they discussed this issue recently), Perhaps we should add a new entry to the FAQ at the wiki about this. We have seen a few questions already in gcc-help, and it seems it is going to be a frequent issue with the most recent major distros: http://gcc.gnu.org/ml/gcc-help/2011-11/msg00132.html https://lists.ubuntu.com/archives/ubuntu-devel/2010-November/031991.html https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition http://wiki.debian.org/ToolChain/DSOLinking#Onlylinkwithneededlibraries http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking I could add it myself, but I am not sure how to summarize the problem and, in particular, it doesn't seem to me that "just use --no-as-needed" is the correct answer. http://gcc.gnu.org/wiki/FAQ Cheers, Manuel. On -10/01/37 20:59, Carlo Pinciroli wrote: > Thank you very much Andrew, your suggestion indeed solved the problem. > And thanks also for your fast answer! :-) > > Cheers, > Carlo > > On Tue, Nov 15, 2011 at 6:49 PM, Andrew Pinski wrote: >> On Tue, Nov 15, 2011 at 9:34 AM, Carlo Pinciroli wrote: >>> >>> Dear forum, >>> >>> I have a problem with linking of a program I have wrote. Instead of giving >>> you the entire program, which is pretty large, I have prepared a basic >>> example that you can find attached to this message. The example uses CMake >>> to compile. >>> >>> I have three files: >> >> Sounds like --as-needed is the default with the linker you are using. >> That is GCC is not the issue but rather the defaults with the distros >> you are using are different. >> >> Thanks, >> Andrew Pinski >> > > >