From mint-bounce@lists.fishpool.fi Thu Jul 1 04:39:09 2010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=8VgzTTL1asa8AkyOxWOxIvaqw6gjGceUEdOYNbR5Wdg=; b=nyth8wKdgV3Oy1gGoly4wJWJ6uhviGzy7ZpvFvjCXiprNAetT6YIygYxev+5pOIozs +wdCdK36JFcEPOj310pLzHCQrkSQo4kzLMCKeslBg6bMs9SeTYzixcTBobIbl32PHMT5 iVP1g47TME1pBPq2t+TRMs1VCnp3XJgIlRq94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=pElfh1lCIOoVdX14fuvgDBPhW3nJm1HWPYl7ifIxdnemCO9fwVSPcL9fmKB6Cea1RY /fH2KYCf8FhWPKaOY+dRXIF41k70GwwlASn/d8sic7yr1++bktf7yAfMKa6zH+e2F1p8 6xRbeXHd2q8ZF8+U5JunxQ1fywdhNOUpdD9pg= Message-ID: <4C2C53A9.5000507@freesbee.fr> Date: Thu, 01 Jul 2010 10:36:57 +0200 From: =?UTF-8?B?VmluY2VudCBSaXZpw6hyZQ==?= User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: Re: [MiNT] Problems linking lib that uses the constructor __attribute References: <4C2BD466.60202@freesbee.fr> <0ec61e46d4c65404a97aff015d065d36-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYBWkF+CTpUX1hYSEIDXFpZ-webmailer2@server02.webmailer.hosteurope.de> In-Reply-To: <0ec61e46d4c65404a97aff015d065d36-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYBWkF+CTpUX1hYSEIDXFpZ-webmailer2@server02.webmailer.hosteurope.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: m0n0 wrote: > which does not work, because of doubly defined references.... I have to > adjust the sdl.pc to make it work..., the line than looks like: > > --whole-archive -lnsfb --no-whole-archive -lsdl -lgem -lldg -lgem Please use only --whole-archive as last resort :-( I have found a linker option which seems to be exactly what you need. The option -u can force a reference to an external symbol which may be defined inside a library. You have to: - use the form -Wl,-u on the GCC command line to pass that option down to the linker - put that option *before* the library containing the definition - prepend the function name with an _ as the linker deals with assembler symbols Thus, try the following instead of your quote above: -Wl,-u,_sdl_register_frontend -lnsfb -lsdl -lgem -lldg -lgem Everything should be good and optimal. -- Vincent Rivière