From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Evans Subject: Re: [PATCH V2] kvm tools: Add build target for statically-linked binary Date: Mon, 30 Jan 2012 14:58:08 +1100 Message-ID: <4F261550.9070701@ozlabs.org> References: <4F0A76AD.6070506@ozlabs.org> <4F0A8D22.1030302@ozlabs.org> <4F0A9C6D.9030003@gmail.com> <4F260BEA.5030606@ozlabs.org> <1327895506.6697.1.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Asias He , KVM list , Pekka Enberg To: Sasha Levin Return-path: Received: from ozlabs.org ([203.10.76.45]:42131 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753529Ab2A3D6D (ORCPT ); Sun, 29 Jan 2012 22:58:03 -0500 In-Reply-To: <1327895506.6697.1.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: On 30/01/12 14:51, Sasha Levin wrote: > On Mon, 2012-01-30 at 14:18 +1100, Matt Evans wrote: >> In lieu of any good lightweight solutions, can we include this patch as it is >> still useful for builds on systems without the offending optional libraries? > > How about we do it as a 'make static' target which will generate a > static binary without optional libraries (or just libs that don't link > statically)? Sure, but that was my question: how? That 'make static' target can drop -lbfd, -lSDL etc. from the link line but all of the '.o's that we've already built either may depend on one of those libs or may do something different because CONFIG_HAS_SDL (or similar) was set. The only way I can think of doing this is to have 'make static' depend on a second set of $(all_objects_except_without_optional_libs) which are built without CONFIG_HAS_SDL etc., but that'd make Makefile fugly IMHO. Unless, that is, CFLAGS (and thus CONFIG_HAS_SDL, has_SDL probing, etc.) can somehow change depending on the make target. Matt