Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Oct 2017 16:49:36 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Mark Linimon <linimon@lonesome.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: armv7, building p7zip and -fPIC
Message-ID:  <1507416576.86205.295.camel@freebsd.org>
In-Reply-To: <20171007214849.GB22150@lonesome.com>
References:  <CAC67Hz8kctZyTEW%2B0qQRVYLzPEK7cG9JXhw90fwHx84fnuwO0w@mail.gmail.com> <CANCZdfo-1ngKQSkkW5zjZwMWj0QnVnrf2WaJ68=bh_oNPKZ3hw@mail.gmail.com> <CAC67Hz8RxH%2BNd0dPbn4qstpFJEkoFWkKpTQ81sX6K3NUuYPDtA@mail.gmail.com> <1507403387.86205.286.camel@freebsd.org> <20171007214849.GB22150@lonesome.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2017-10-07 at 16:48 -0500, Mark Linimon wrote:
> On Sat, Oct 07, 2017 at 01:09:47PM -0600, Ian Lepore wrote:
> > 
> > This is really not just an armv7-only thing, the -fPIC flag should
> > always be used.
> OK, I'm going to admit some ignorance and prepare to take my beating.
> 
> The last time I tried to pepper some -fPIC flags around without knowing
> what I was doing, I was told (in no uncertain terms) that I didn't know
> what I was doing.  While this was true I wasn't happy with the way I was
> told :-)
> 
> So can you please provide a "-fPIC for dummies" summary?  I'll add it to
> the wiki.
> 
> (In my old embedded systems days, we didn't need all this fancy stuff;
> you just stuffed your statically-linked result in the 64KB EPROM and you
> were done.)
> 
> mcl
> 

Then maybe things I don't understand well enough are in play.  I was
under the impression that if you build a shared lib without -fPIC on
any arch, then you end up with relocations in the text segment,
requiring rtld to do writes into that segment, which triggers COW
copying of the pages, at which point it's really no longer a shared
library because every process has its own private copy of most/all of
the text pages.

Maybe some or all of that isn't true somehow on some arches.

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1507416576.86205.295.camel>