Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jan 2016 20:36:29 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-arm <freebsd-arm@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
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>

next in thread | raw e-mail | index | archive | help

I had in Bug 205904 reported that trying "portmaster -DK textproc/expat2" in a -march=armv7-a -mcpu=cortex-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:
> 
>> relocation R_ARM_MOVW_ABS_NC against `malloc' can not be used when making a shared object; recompile with -fPIC
> 
> 
> Trying again with -fPIC does let the portmaster command complete in this /usr/local/arm-gnueabi-freebsd/bin/ based tool context.
> 
> 
> 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.)
> 
> 
> So maybe part of the issue is having compiler arguments like -fPIC show up in commands for contexts like -march=armv7-a -mcpu=cortex-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]==1 [alignment required] on arm that make clang++ Bus Error during most C++ compiles).

===
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8079E6B2-DC53-4BFA-9129-8A88A1A1F044>