From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10906 invoked by alias); 4 Mar 2011 16:52:40 -0000 Received: (qmail 10892 invoked by uid 22791); 4 Mar 2011 16:52:38 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Mar 2011 16:52:32 +0000 Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id p24GqSNL009809 for ; Fri, 4 Mar 2011 08:52:29 -0800 Received: from pzk36 (pzk36.prod.google.com [10.243.19.164]) by kpbe19.cbf.corp.google.com with ESMTP id p24GqQM7006300 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 4 Mar 2011 08:52:27 -0800 Received: by pzk36 with SMTP id 36so486166pzk.30 for ; Fri, 04 Mar 2011 08:52:26 -0800 (PST) Received: by 10.142.194.12 with SMTP id r12mr690164wff.252.1299257546352; Fri, 04 Mar 2011 08:52:26 -0800 (PST) Received: from coign.google.com (dhcp-172-22-123-197.mtv.corp.google.com [172.22.123.197]) by mx.google.com with ESMTPS id m10sm3184614wfl.23.2011.03.04.08.52.24 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 08:52:25 -0800 (PST) From: Ian Lance Taylor To: "H.J. Lu" Cc: Olaf van der Spek , binutils@sourceware.org Subject: Re: Support for automatic linking via pragma References: Date: Fri, 04 Mar 2011 16:52:00 -0000 In-Reply-To: (H. J. Lu's message of "Fri, 4 Mar 2011 08:44:09 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00059.txt.bz2 "H.J. Lu" writes: > On Fri, Mar 4, 2011 at 8:29 AM, Olaf van der Spek wrote: >> On Mon, Feb 28, 2011 at 7:17 PM, Olaf van der Spek wrote: >>> Hi, >>> >>> I've submitted a feature request for automatic linking via pragma: >>> http://sourceware.org/bugzilla/show_bug.cgi?id=12485 >>> What do others think about the idea? >> >> Somebody? >> >> Let me quote the request: >> MSVC supports the following pragma, which can be used to automatically link a >> library when a header file is included. This is used by for example Boost. >> >> It makes linking with the right lib a lot simpler. No more fiddling >> with autoconf to detect the right lib name. >> > > Not necessarily. Unlike DSO, object files don't have ABI/API > information. You may not link foo.o compiled with glibc 2.5/libbar > 1.3 against glibc 2.13/libbar 1.9 I don't see how that is relevant to what Olaf is talking about. What Olaf is saying is that he wants to be able to have a .h file automatically a -l option to the link command line. What you are saying is that if that you have a .o file, you have to link against the -l which corresponds to the .h file which was used when the .o file was compiled. That is of course a real problem, but it's a problem that exists whether or not we implement the MSVC pragma. Ian