From owner-freebsd-hackers@FreeBSD.ORG Tue May 24 08:08:41 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B68D616A41C for ; Tue, 24 May 2005 08:08:41 +0000 (GMT) (envelope-from dmp@bitfreak.org) Received: from mail.bitfreak.org (mail.bitfreak.org [65.75.198.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C2C543D1F for ; Tue, 24 May 2005 08:08:41 +0000 (GMT) (envelope-from dmp@bitfreak.org) Received: from SMILEY (mail.bitfreak.org [65.75.198.146]) by mail.bitfreak.org (Postfix) with ESMTP id 60D2F19F3B; Tue, 24 May 2005 01:09:32 -0700 (PDT) From: "Darren Pilgrim" To: "'Dan Nelson'" Date: Tue, 24 May 2005 01:08:30 -0700 Message-ID: <002001c56037$c90171b0$0a2a15ac@SMILEY> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <20050524044808.GD16069@dan.emsphone.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Importance: Normal Cc: hackers@freebsd.org Subject: RE: Forcing static-linking on a port? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2005 08:08:41 -0000 From: Dan Nelson [mailto:dnelson@allantgroup.com]=20 >=20 > In the last episode (May 23), Darren Pilgrim said: > > I need to make use of a port during start up, but it has library > > dependencies that aren't available, before the complete library path = is > > established. I've tried the following: > >=20 > > NO_SHARED=3Dtrue (added to /etc/make.conf) > > make -DNO_SHARED > > make LDFLAGS+=3D-static > >=20 > > Every time, running file on the compiled program tells me that the binary is > > dynamically-linked. I couldn't find anything else in any man pages, = Mk > > files, mailing lists, Google, etc. Sorry for the semi-inappropriate list > > choice, but this one would get swallowed up on -questions. >=20 > NO_SHARED only works on programs that use the bsd.prog.mk makefile > template; I'd guess under a dozen ports do this. >=20 > Some pieces of software have dynamic-link options hardcoded in their > Makefiles, probably as a workaround for bugs in other OSes. Those > options override -static. I can't think of a valid reason for them to > be used in FreeBSD. Search for (and remove) any occurances of > -Wl,-Bdynamic and -Wl,-Bstatic , and you should be set. No luck on either string. I ended up getting what I wanted by going = through the source Makefile and adding "-static" to the appropriate line in the target for the program I needed static-linked. Now devd can bring up my wireless NIC at boot. Works great!