From owner-freebsd-ports Fri Sep 22 7:48:38 2000 Delivered-To: freebsd-ports@freebsd.org Received: from iraun1.ira.uka.de (iraun1.ira.uka.de [129.13.10.90]) by hub.freebsd.org (Postfix) with ESMTP id 17E8437B43C; Fri, 22 Sep 2000 07:48:36 -0700 (PDT) Received: from i30nb2.ira.uka.de by iraun1 (PP) with ESMTP; Fri, 22 Sep 2000 16:48:31 +0200 Received: (from esk@localhost) by i30nb2.ira.uka.de (8.9.3/8.9.3) id QAA49575; Fri, 22 Sep 2000 16:48:04 +0200 (CEST) (envelope-from esk) From: Espen Skoglund MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 22 Sep 2000 16:48:03 +0200 (CEST) To: Maxim Sobolev Cc: Espen Skoglund , ports@FreeBSD.org Subject: Re: Modifying linkopts in libtool In-Reply-To: <39CB6ADF.2976F4EF@FreeBSD.org> References: <14795.15262.123604.865457@i30nb2.ira.uka.de> <39CB6ADF.2976F4EF@FreeBSD.org> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14795.28046.251154.85719@i30nb2.ira.uka.de> Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org [Maxim Sobolev] > Espen Skoglund wrote: >> Hi, >> >> I was trying to create a port containing a shared library using the >> _fini() function for cleanup. The package was also using libtool, >> and it had put `linkopts=-nostdlib' in its ltmain.sh in order avoid >> conflicts with the _fini() function in crtbeginS.o. However, when >> I specify USE_LIBTOOL in the port-makefile, the port-version of >> libtool is used instead of the one inside the package. Does anyone >> have any suggestion of how to cope with this? I thought about >> modifying the package makefile or something, but this is sort of >> troublesome because libtool ignores most of the command line >> options that you pass to it. The soultion that I've currently come >> up with is to add a pre-build target that patches the produced >> libtool script to include the linkopts line above, but I would >> prefer something that could be incorporated into the package. > Add `CONFIGURE_ENV= LDFLAGS="linkopts=-nostdlib"' into port's > Makefile or patch appropriate Makefile.in. Well, this won't work. First of all, the linkopts is a shell variable which is defined in the generated libtool script. Second, setting LDFLAGS or anything in the Makefile won't work because the libtool script tends to ignore most of the arguments given to gcc. As far as I can tell by a quick look through the script, the command line for linking is produced by: archive_cmds="\$CC -shared \$compile_rpath \$libobjs \$deplibs \ \$linkopts \${wl}-soname \$wl \$soname -o \$lib" which does not really give any room for extra flags. eSk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message