Date: Tue, 7 Mar 2006 23:35:25 +0100 From: Roman Neuhauser <neuhauser@sigpipe.cz> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: ports@freebsd.org, pfgshield-freebsd@yahoo.com, Kris Kennaway <kris@obsecurity.org> Subject: Re: amd64 and -fPIC Message-ID: <20060307223525.GA4435@isis.sigpipe.cz> In-Reply-To: <20060307205455.GA11840@ns1.xcllnt.net> References: <20060307192606.GA56153@xor.obsecurity.org> <20060307195849.70339.qmail@web32714.mail.mud.yahoo.com> <20060307205455.GA11840@ns1.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
# marcel@xcllnt.net / 2006-03-07 12:54:55 -0800: > A shared object has to be position independent and any object files > that constitute the shared object have to be constructed in such a > way. For C/C++ and GCC this means that -fPIC is required. Some > platforms (i.e. i386) don't generate different code for -fPIC, so the > omission of -fPIC when it is necessary doesn't result in problems. > This is just a quirk of the platform, not the norm. Also, linking an > archive library into a shared object is perfectly valid, provided of > course that all object files in the archive library are compiled for > inclusion in a shared object. This of course means that they must be > position independent and thus compiled with -fPIC (or equivalent). As > such, you must determine up front for what purpose you create an > archive library (linking into an executable or linking into a shared > object) or create 2 variants: one non-PIC and one PIC. > > A generic port that only builds archive libraries better be PIC to > cover all bases. Performance cannot really be a concern when you're > working with generic parts. If performance is a concern, customization > is pretty much a given and the use of generic parts is almost always > abandoned. That's pretty much what I've been trying to say, except this version is much better. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060307223525.GA4435>