From owner-freebsd-hackers Mon Nov 27 8:29:58 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by hub.freebsd.org (Postfix) with ESMTP id CCF3337B479 for ; Mon, 27 Nov 2000 08:29:55 -0800 (PST) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.11.1/8.11.1) id eARGZQw29552; Mon, 27 Nov 2000 08:35:27 -0800 (PST) (envelope-from sgk) From: Steve Kargl Message-Id: <200011271635.eARGZQw29552@troutmask.apl.washington.edu> Subject: Re: porting Linux application to FreeBSD In-Reply-To: <3A228681.4A3DBE88@iss.net> from Andrew Otwell at "Nov 27, 2000 11:06:25 am" To: Andrew Otwell Date: Mon, 27 Nov 2000 08:35:26 -0800 (PST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Andrew Otwell wrote: > > A couple of you answered my first query which gave me.... > > gcc -nostdinc -I/includedir -nostdlib -L/libdir source.c > > This always failed with either.... > > ld: No reference to __DYNAMIC > collect2: ld returned 1 exit status > info gcc gcc -v -static -nostdinc -I/includedir -nostdlib source.c \ -L/libdir -lfirstlib -lsecondlib .... -lc The -v flag will show you all aspects of the linking of your program. The -static flags make gcc use static linking. The -nostdlib suppress the normal linking of libraries usually supplied by the system. This means you have to explicitly list all libraries on the command including the standard C library. -- Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message