From owner-freebsd-arm@freebsd.org Tue Jan 5 04:43:12 2016 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 983F3A62F27 for ; Tue, 5 Jan 2016 04:43:12 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-3.reflexion.net [208.70.210.3]) (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 4E1CF1C62 for ; Tue, 5 Jan 2016 04:43:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 27016 invoked from network); 5 Jan 2016 04:36:30 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 5 Jan 2016 04:36:30 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Mon, 04 Jan 2016 23:36:37 -0500 (EST) Received: (qmail 31264 invoked from network); 5 Jan 2016 04:36:37 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 5 Jan 2016 04:36:37 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id D3B821C43BC; Mon, 4 Jan 2016 20:36:23 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 11.0-CURRENT Bug 205904 "unresolvable R_ARM_MOVW_ABS_NC relocation" vs. forced -fPIC use Message-Id: <8079E6B2-DC53-4BFA-9129-8A88A1A1F044@dsl-only.net> Date: Mon, 4 Jan 2016 20:36:29 -0800 To: freebsd-arm , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 04:43:12 -0000 I had in Bug 205904 reported that trying "portmaster -DK = textproc/expat2" in a -march=3Darmv7-a -mcpu=3Dcortex-a7 context (on an = rpi2b) gets (for -r293129 and its /usr/bin/ tools): > unresolvable R_ARM_MOVW_ABS_NC relocation against symbol = `malloc@@FBSD_1.0' in an attempted link operation. I've now added a comment saying in part: > Investigating the issue I had the portmaster activity use the = /usr/local/arm-gnueabi-freebsd/bin/ tools instead (via /etc/make.conf = changes) and in that context the message is different but it was still = an error: >=20 >> relocation R_ARM_MOVW_ABS_NC against `malloc' can not be used when = making a shared object; recompile with -fPIC >=20 >=20 > Trying again with -fPIC does let the portmaster command complete in = this /usr/local/arm-gnueabi-freebsd/bin/ based tool context. >=20 >=20 > Going back and trying -fPIC in the /usr/bin/ based tools context also = lets the portmaster command complete. (That context without -fPIC did = not directly indicate to try -fPIC in its messages.) >=20 >=20 > So maybe part of the issue is having compiler arguments like -fPIC = show up in commands for contexts like -march=3Darmv7-a -mcpu=3Dcortex-a7 = without manual intervention in each case. For ports: some parts of a = more complicated port might need[] such and other parts might not. I used /etc/make.conf to force -fPIC being present. I started this investigation to try some things after Ian Lepore's = -r292964 for the /usr/bin/ binutils. I picked on textproc/expat2 = initially as something fairly simple and limited to C. (clang++ has = problems under SCTLR bit[1]=3D=3D1 [alignment required] on arm that make = clang++ Bus Error during most C++ compiles). =3D=3D=3D Mark Millard markmi at dsl-only.net