Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2018 13:05:27 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        ports-list freebsd <freebsd-ports@freebsd.org>, freebsd-x11@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:  <5FF705ED-B019-4CB1-B516-796C2E7A6FF9@yahoo.com>
In-Reply-To: <56BE95DD-61E5-43CB-923D-10E968003FE3@yahoo.com>
References:  <56BE95DD-61E5-43CB-923D-10E968003FE3@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[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(?).]

On 2018-Nov-14, at 10:10, Mark Millard <marklmi at yahoo.com> wrote:

> I'll first note:
>=20
> # /usr/bin/ld -v
> LLD 6.0.1 (FreeBSD 335540-1300000) (compatible with GNU linkers)
>=20
> and that I use:
>=20
> CFLAGS.clang+=3D -mcpu=3Dcortex-a7
> CXXFLAGS.clang+=3D -mcpu=3Dcortex-a7
> CPPFLAGS.clang+=3D -mcpu=3Dcortex-a7
>=20
> in the src.conf like =
~/src.configs/src.conf.armv7-clang-bootstrap.armv7-host
> file that I used.
>=20
> The error reports were:
>=20
> --- libpixman-1.la ---
> /bin/sh ../libtool  --tag=3DCC    --mode=3Dlink cc   -O -pipe =
-mcpu=3Dcortex-a7  -g -fno-strict-aliasing  -Wall =
-Wdeclaration-after-statement -Wno-unused-local-typedefs =
-fno-strict-aliasing -fvisibility=3Dhid
> den -version-info 34:0:34  -no-undefined   -pthread       -o  =
libpixman-1.la -rpath /usr/local/lib pixman.lo pixman-access.lo =
pixman-access-accessors.lo  pixman-bits-image.lo pixman-combine32.lo  =
pixm
> an-combine-float.lo pixman-conical-gradient.lo  pixman-filter.lo =
pixman-x86.lo pixman-mips.lo pixman-arm.lo  pixman-ppc.lo pixman-edge.lo =
pixman-edge-accessors.lo  pixman-fast-path.lo pixman-glyph.lo=20
> pixman-general.lo  pixman-gradient-walker.lo pixman-image.lo  =
pixman-implementation.lo pixman-linear-gradient.lo  pixman-matrix.lo =
pixman-noop.lo pixman-radial-gradient.lo  pixman-region16.lo pixman-r
> egion32.lo pixman-solid-fill.lo  pixman-timer.lo pixman-trap.lo =
pixman-utils.lo  -lm   -lm       libpixman-arm-simd.la =
libpixman-arm-neon.la     -lm
> libtool: link: cc -shared  -fPIC -DPIC  .libs/pixman.o =
.libs/pixman-access.o .libs/pixman-access-accessors.o =
.libs/pixman-bits-image.o .libs/pixman-combine32.o =
.libs/pixman-combine-float.o .libs/pixma
> n-conical-gradient.o .libs/pixman-filter.o .libs/pixman-x86.o =
.libs/pixman-mips.o .libs/pixman-arm.o .libs/pixman-ppc.o =
.libs/pixman-edge.o .libs/pixman-edge-accessors.o =
.libs/pixman-fast-path.o .libs
> /pixman-glyph.o .libs/pixman-general.o .libs/pixman-gradient-walker.o =
.libs/pixman-image.o .libs/pixman-implementation.o =
.libs/pixman-linear-gradient.o .libs/pixman-matrix.o .libs/pixman-noop.o =
.libs/
> pixman-radial-gradient.o .libs/pixman-region16.o =
.libs/pixman-region32.o .libs/pixman-solid-fill.o .libs/pixman-timer.o =
.libs/pixman-trap.o .libs/pixman-utils.o  -Wl,--whole-archive =
./.libs/libpixman-
> arm-simd.a ./.libs/libpixman-arm-neon.a -Wl,--no-whole-archive  -lm  =
-O -mcpu=3Dcortex-a7 -g -pthread   -pthread -Wl,-soname =
-Wl,libpixman-1.so.0 -o .libs/libpixman-1.so.0.34.0
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in =
./.libs/libpixman-arm-simd.a(pixman-arm-simd-asm-scaled.o)
>>>> referenced by pixman-arm-simd-asm-scaled.o:(.text+0x1B8) in archive =
./.libs/libpixman-arm-simd.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in =
./.libs/libpixman-arm-simd.a(pixman-arm-simd-asm-scaled.o)
>>>> referenced by pixman-arm-simd-asm-scaled.o:(.text+0x374) in archive =
./.libs/libpixman-arm-simd.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x17AC) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x1814) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x1A38) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x1AFC) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x21C8) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x2294) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x84E0) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x85C4) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x9720) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x9834) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0xA7B0) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0xA8CC) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x105A0) in archive =
./.libs/libpixman-arm-neon.a
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x10DB8) in archive =
./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x11274) in archive =
./.libs/libpixman-arm-neon.a
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in ./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm.o)
>>>> referenced by pixman-arm-neon-asm.o:(.text+0x11808) in archive =
./.libs/libpixman-arm-neon.a
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in =
./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm-bilinear.o)
>>>> referenced by pixman-arm-neon-asm-bilinear.o:(.text+0x4F0) in =
archive ./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against =
local symbol in readonly segment; recompile object files with -fPIC
>>>> defined in =
./.libs/libpixman-arm-neon.a(pixman-arm-neon-asm-bilinear.o)
>>>> referenced by pixman-arm-neon-asm-bilinear.o:(.text+0xABC) in =
archive ./.libs/libpixman-arm-neon.a
>=20
> /usr/bin/ld: error: too many errors emitted, stopping now (use =
-error-limit=3D0 to see all errors)
> cc: error: linker command failed with exit code 1 (use -v to see =
invocation)
> *** [libpixman-1.la] Error code 1
>=20
> make[3]: stopped in =
/wrkdirs/usr/ports/x11/pixman/work/pixman-0.34.0/pixman
> 1 error
>=20
> make[3]: stopped in =
/wrkdirs/usr/ports/x11/pixman/work/pixman-0.34.0/pixman
> *** [all-recursive] Error code 1
>=20
>=20
> FreeBSD context details:
>=20
> # uname -apKU
> FreeBSD OPiP2E 13.0-CURRENT FreeBSD 13.0-CURRENT #5 r340287M: Sat Nov =
10 22:40:25 PST 2018     =
markmi@FBSDFSSD:/usr/obj/armv7_clang/arm.armv7/usr/src/arm.armv7/sys/GENER=
IC-NODBG  arm armv7 1300003 1300003


I went back and looked at the amd64 -> armv7 cross-build
( that used teh poudriere-built /nxb-bin/usr/bin/ ) and it
did not complain:

--- libpixman-1.la ---
/bin/sh ../libtool  --tag=3DCC    --mode=3Dlink /nxb-bin/usr/bin/cc   =
-O2 -pipe -mcpu=3Dcortex-a7  -g -fno-strict-aliasing  -Wall =
-Wdeclaration-after-statement -Wno-unused-local-typedefs =
-fno-strict-aliasing -fvisibility=3Dhidden -version-info 34:0:34  =
-no-undefined  -Wl,--no-threads  -pthread      -Wl,--no-threads -o  =
libpixman-1.la -rpath /usr/local/lib pixman.lo pixman-access.lo =
pixman-access-accessors.lo  pixman-bits-image.lo pixman-combine32.lo  =
pixman-combine-float.lo pixman-conical-gradient.lo  pixman-filter.lo =
pixman-x86.lo pixman-mips.lo pixman-arm.lo  pixman-ppc.lo pixman-edge.lo =
pixman-edge-accessors.lo  pixman-fast-path.lo pixman-glyph.lo =
pixman-general.lo  pixman-gradient-walker.lo pixman-image.lo  =
pixman-implementation.lo pixman-linear-gradient.lo  pixman-matrix.lo =
pixman-noop.lo pixman-radial-gradient.lo  pixman-region16.lo =
pixman-region32.lo pixman-solid-fill.lo  pixman-timer.lo pixman-trap.lo =
pixman-utils.lo  -lm   -lm       libpixman-arm-simd.la =
libpixman-arm-neon.la     -lm
libtool: link: /nxb-bin/usr/bin/cc -shared  -fPIC -DPIC  .libs/pixman.o =
.libs/pixman-access.o .libs/pixman-access-accessors.o =
.libs/pixman-bits-image.o .libs/pixman-combine32.o =
.libs/pixman-combine-float.o .libs/pixman-conical-gradient.o =
.libs/pixman-filter.o .libs/pixman-x86.o .libs/pixman-mips.o =
.libs/pixman-arm.o .libs/pixman-ppc.o .libs/pixman-edge.o =
.libs/pixman-edge-accessors.o .libs/pixman-fast-path.o =
.libs/pixman-glyph.o .libs/pixman-general.o =
.libs/pixman-gradient-walker.o .libs/pixman-image.o =
.libs/pixman-implementation.o .libs/pixman-linear-gradient.o =
.libs/pixman-matrix.o .libs/pixman-noop.o .libs/pixman-radial-gradient.o =
.libs/pixman-region16.o .libs/pixman-region32.o =
.libs/pixman-solid-fill.o .libs/pixman-timer.o .libs/pixman-trap.o =
.libs/pixman-utils.o  -Wl,--whole-archive ./.libs/libpixman-arm-simd.a =
./.libs/libpixman-arm-neon.a -Wl,--no-whole-archive  -lm  -O2 =
-mcpu=3Dcortex-a7 -g -Wl,--no-threads -pthread -Wl,--no-threads   =
-pthread -Wl,-soname -Wl,libpixman-1.so.0 -o .libs/libpixman-1.so.0.34.0
libtool: link: (cd ".libs" && rm -f "libpixman-1.so.0" && ln -s =
"libpixman-1.so.0.34.0" "libpixman-1.so.0")
libtool: link: (cd ".libs" && rm -f "libpixman-1.so" && ln -s =
"libpixman-1.so.0.34.0" "libpixman-1.so")
libtool: link: (cd .libs/libpixman-1.lax/libpixman-arm-simd.a && ar x =
"/wrkdirs/usr/ports/x11/pixman/work/pixman-0.34.0/pixman/./.libs/libpixman=
-arm-simd.a")
libtool: link: (cd .libs/libpixman-1.lax/libpixman-arm-neon.a && ar x =
"/wrkdirs/usr/ports/x11/pixman/work/pixman-0.34.0/pixman/./.libs/libpixman=
-arm-neon.a")
libtool: link: ar cru .libs/libpixman-1.a  pixman.o pixman-access.o =
pixman-access-accessors.o pixman-bits-image.o pixman-combine32.o =
pixman-combine-float.o pixman-conical-gradient.o pixman-filter.o =
pixman-x86.o pixman-mips.o pixman-arm.o pixman-ppc.o pixman-edge.o =
pixman-edge-accessors.o pixman-fast-path.o pixman-glyph.o =
pixman-general.o pixman-gradient-walker.o pixman-image.o =
pixman-implementation.o pixman-linear-gradient.o pixman-matrix.o =
pixman-noop.o pixman-radial-gradient.o pixman-region16.o =
pixman-region32.o pixman-solid-fill.o pixman-timer.o pixman-trap.o =
pixman-utils.o  =
.libs/libpixman-1.lax/libpixman-arm-simd.a/pixman-arm-simd-asm-scaled.o =
.libs/libpixman-1.lax/libpixman-arm-simd.a/pixman-arm-simd-asm.o =
.libs/libpixman-1.lax/libpixman-arm-simd.a/pixman-arm-simd.o  =
.libs/libpixman-1.lax/libpixman-arm-neon.a/pixman-arm-neon-asm-bilinear.o =
.libs/libpixman-1.lax/libpixman-arm-neon.a/pixman-arm-neon-asm.o =
.libs/libpixman-1.lax/libpixman-arm-neon.a/pixman-arm-neon.o=20
libtool: link: ranlib .libs/libpixman-1.a
libtool: link: rm -fr .libs/libpixman-1.lax
libtool: link: ( cd ".libs" && rm -f "libpixman-1.la" && ln -s =
"../libpixman-1.la" "libpixman-1.la" )
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<phas=
e: run-depends    >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<phas=
e: stage          >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
. . .


So I diff'd the logs and found the following (selective extraction):
(- for amd64 -> armv7; + for armv7)

-Poudriere version: 3.2.99.20180601
+Poudriere version: 3.2.99.20181024

This is was expected but may mean that I need to wait
until the armv7 has 3.2.99.20181024 and I try via
it.

-SHELL=3D/bin/csh
-UNAME_p=3Darmv7
-UNAME_m=3Darm
-ABI_FILE=3D/usr/lib/crt1.o
+SHELL=3D/bin/sh

The SHELL's I expected but the other 3 lines I did not.
But the 3 lines may only occur under qemu-user-static
style use.

-QEMU_EMULATING=3D1

Expected.

In CONFIGURE_ENV:

amd64 -> armv7: CCASFLAGS having -O2
armv7:          CCASFLAGS having -O

In MAKE_ENV:

amd64 -> armv7: CFLAGS having -O2
armv7:          CFLAGS having -O


(The -O2 vs. -O context differences may well be important
to the behavior.)

(I'll not list /nxb-bin/. . . path use vs. not.)

Later:

-MACHINE=3Darm
-MACHINE_ARCH=3Darmv7
-ARCH=3D${MACHINE_ARCH}

-.if ${LDFLAGS:M-fuse-ld=3D*lld*} || ${/usr/bin/ld:L:tA} =3D=3D =
/usr/bin/ld.lld
-LDFLAGS+=3D      -Wl,--no-threads
-.endif

(That last was part of an experiment with avoiding a
user-arm-static hangup.)

-_SMP_CPUS=3D28
+_SMP_CPUS=3D4

I'll stop with that. It looks to me like -O2 vs. -O
would be the likely distinction. While my materials
probably caused that difference(?), the port likely
should support both ways of building(?).


=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?5FF705ED-B019-4CB1-B516-796C2E7A6FF9>