From owner-freebsd-arm@freebsd.org Sat Oct 7 22:49:44 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1078E43F49 for ; Sat, 7 Oct 2017 22:49:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C97736D6D7 for ; Sat, 7 Oct 2017 22:49:42 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cc944c70-abb1-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id cc944c70-abb1-11e7-a893-25625093991c; Sat, 07 Oct 2017 22:49:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v97Mna29009242; Sat, 7 Oct 2017 16:49:36 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507416576.86205.295.camel@freebsd.org> Subject: Re: armv7, building p7zip and -fPIC From: Ian Lepore To: Mark Linimon Cc: freebsd-arm Date: Sat, 07 Oct 2017 16:49:36 -0600 In-Reply-To: <20171007214849.GB22150@lonesome.com> References: <1507403387.86205.286.camel@freebsd.org> <20171007214849.GB22150@lonesome.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 22:49:44 -0000 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