Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2018 14:35:02 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Jan Beich <jbeich@FreeBSD.org>
Cc:        ports-list freebsd <freebsd-ports@freebsd.org>
Subject:   Re: ports head -r487783: on armv7 x11/pixman fails to build:  /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against local  symbol in readonly segment; recompile object files with -fPIC
Message-ID:  <03FFE5BB-777D-40D3-9AA3-C8C359BE1F2B@yahoo.com>
In-Reply-To: <a7m8-loy5-wny@FreeBSD.org>
References:  <A76D7D49-E36E-4665-AA4B-D083CCF7D57B@yahoo.com> <a7m8-loy5-wny@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-Nov-16, at 12:58, Jan Beich <jbeich at FreeBSD.org> wrote:

> Mark Millard <marklm at yahoo.com> writes:
>=20
>> Jan Beich jbeich at FreeBSD.org wrote on
>> Fri Nov 16 02:15:57 UTC 2018 :
>>=20
>>> Mark Millard via freebsd-x11 <freebsd-x11 at freebsd.org> writes:
>>>=20
>>>> [Added: The original cross-build via poudriere-devel and =
qemu-user-static
>>>> did not get this problem. I give details later. Sumamry: Looks like =
-O2
>>>> was used for the cross build and -O was used for armv7 native. The
>>>> difference is likely(?) from my materials but not supporting both =
ways of
>>>> building is likely a problem with the port(?).]
>>>=20
>>> x11/pixman builds fine on armv7 even with -O. Tested both Clang/LLD =
6.0
>>> and 7.0 after forcing MACHINE_CPUARCH=3Darm on command line.
> [...]
>> Do you have a log that would show the commands that were used to =
produce
>> the things that were listed in my original report for the "R_ARM_V4BX
>> against local in readonly segment":
>=20
> Build logs:
> - clang/lld 6.0: https://ptpb.pw/5dip (via devel/llvm60)
> - clang/lld 7.0: https://ptpb.pw/wwi9 (via native-xtools)
> - -mcpu=3Dcortex-a7: https://ptpb.pw/_zAP


Thanks.

You tried a cross-build via QEMU_EMULATING=3D1 with
CC=3Dclang60 and links using  -fuse-ld=3D/usr/local/bin/ld.lld60
and -O instead of -O2 . Looks like /nxb-bin/. . . was
not involved. No -mcpu in use.

Using pixman-arm-simd-asm-scaled as an example: I do not see
other differences in the command used to produce
.libs/pixman-arm-simd-asm-scaled.o .

That still leave system clang/llvm vs. devel/llvm60 patch levels
or configuration vs. system clang/llvm and such as possibilities
for variations.

clang/llvm 7 material are definitely more recent than anything
that I've used. Again I do not see any other differences in
command used to produce .libs/pixman-arm-simd-asm-scaled.o .

And nothing when -mcpu=3Dcortex-a7 is in your test either.

So far all tests via amd64->armv7 cross-builds do not report
the problem, yours and mine.

Only a native build on armv7 has generated the messages. So far
I'm the only one that has tried that sort of context in this
investigation as far as I know.

We do have https://bugs.llvm.org/show_bug.cgi?id=3D38303 as a
report from a linux context for cross-building to Android,
specifically for a pixman example for the same problem.
So, whatever the issue is, it is not strictly local to my
context.

But the question is probably more "why was R_ARM_V4BX
relocation record generated at all?" than the messages
produced when the relocation records are discovered by
lld.

Does the llvm60 and llvm70 configuration deal with older
arm's that do not have bx instructions? Might the system
clang/llvm have enabled supporting such so that it
outputs the V_ARM_V4BX relocation records? (Just pondering.)
If yes: This seems to imply lld is then to be avoided,
at least when there may be bx lr code (and so the V_ARM_V4BX
use).

My native armv7 configuration's system clang/llvm was in use and
is still at:

# cc -v
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on =
LLVM 6.0.1)
Target: armv7-unknown-freebsd13.0-gnueabihf
Thread model: posix
InstalledDir: /usr/bin

# ld -v
LLD 6.0.1 (FreeBSD 335540-1300000) (compatible with GNU linkers)

But the cross-build /nxb-bin/. . . was also based on the
building the same sources. The whole buildworlds were
based on the same sources.

I'm still no closer to correctly identifying what makes the
difference for my native build vs. cross building. So far
the effort has just eliminated various ideas for
possibilities.

(It also lead to the poudriere/nxb-bin/ discovery of the
-O2 vs. -O sys.mk code not picking the intended -O for arm*,
including armv6 and armv7.)


=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03FFE5BB-777D-40D3-9AA3-C8C359BE1F2B>