Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2019 17:50:35 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        freebsd-ports@freebsd.org, freebsd-toolchain@freebsd.org, "brooks@freebsd.org" <brooks@FreeBSD.org>, Ed Maste <emaste@freebsd.org>
Subject:   Re: amd64->armv7 cross build: devel/llvm90 build blocked by math/z3 build failure: can't create dynamic relocation R_ARM_MOVW_ABS_NC against symbol: __stack_chk_guard in readonly segment
Message-ID:  <CCCFEBCB-4DC3-4217-97BD-9D4DC85742E0@yahoo.com>
In-Reply-To: <9533FEC7-3B4D-4A88-BD4D-945456B603E4@yahoo.com>
References:  <9533FEC7-3B4D-4A88-BD4D-945456B603E4@yahoo.com>

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


On 2019-Aug-5, at 14:48, Mark Millard <marklmi@yahoo.com> wrote:

[Note: Targeting aarch64 instead did not have this problem.]
>=20
> [00:03:02] [02] [00:00:00] Building math/z3 | z3-4.8.5_1
> . . .
> [00:06:31] [02] [00:03:29] Saved math/z3 | z3-4.8.5_1 wrkdir to: =
/usr/local/poudriere/data/wrkdirs/FBSDFSSDjailArmV7-default/default/z3-4.8=
.5_1.tar
> [00:06:31] [02] [00:03:29] Finished math/z3 | z3-4.8.5_1: Failed: =
build
> . . .
> [00:06:35] [02] [00:03:33] Skipping devel/llvm90 | llvm90-9.0.0.r1: =
Dependent port math/z3 | z3-4.8.5_1 failed
>=20
> The specific first errors for math/z3 were:
>=20
> ld: error: can't create dynamic relocation R_ARM_MOVW_ABS_NC against =
symbol: __stack_chk_guard in readonly segment; recompile object files =
with -fPIC or pass '-Wl,-z,notext' to allow text relocations=20
> in the output
>>>> defined in /lib/libc.so.7
>>>> referenced by install_tactic.cpp:97 =
(../src/api/dll/install_tactic.cpp:97)
>>>>             =
api/dll/install_tactic.o:(install_tactics(tactic_manager&))
>=20
> ld: error: can't create dynamic relocation R_ARM_MOVT_ABS against =
symbol: __stack_chk_guard in readonly segment; recompile object files =
with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the =
output
>>>> defined in /lib/libc.so.7
>>>> referenced by install_tactic.cpp:97 =
(../src/api/dll/install_tactic.cpp:97)
>>>>             =
api/dll/install_tactic.o:(install_tactics(tactic_manager&))
>=20
> ld: error: can't create dynamic relocation R_ARM_MOVW_ABS_NC against =
symbol: .L.str in readonly segment; recompile object files with -fPIC or =
pass '-Wl,-z,notext' to allow text relocations in the output
>>>> defined in api/dll/install_tactic.o
>>>> referenced by install_tactic.cpp:98 =
(../src/api/dll/install_tactic.cpp:98)
>>>>             =
api/dll/install_tactic.o:(install_tactics(tactic_manager&))
>=20
>=20
> Is the default:
>=20
> STATIC=3Don: Build static z3 library
>=20
> inappropriate for armv7?
>=20

Even with:

. . . -Wl,-znotext -Wl,-soname,libz3.so.0

via:

# svnlite diff /usr/ports/math/z3
Index: /usr/ports/math/z3/Makefile
=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
--- /usr/ports/math/z3/Makefile	(revision 508197)
+++ /usr/ports/math/z3/Makefile	(working copy)
@@ -36,6 +36,7 @@
 GMP_LIB_DEPENDS=3D	libgmp.so:math/gmp
=20
 LDFLAGS_i386=3D		-Wl,-znotext
+LDFLAGS_armv7=3D		-Wl,-znotext
 BUILD_WRKSRC=3D		${WRKSRC}/build
 INSTALL_WRKSRC=3D		${WRKSRC}/build
=20

I get some of the errors:

ld: error: relocation R_ARM_MOVW_ABS_NC cannot be used against symbol =
__stack_chk_guard; recompile with -fPIC
>>> defined in /lib/libc.so.7
>>> referenced by install_tactic.cpp:97 =
(../src/api/dll/install_tactic.cpp:97)
>>>               =
api/dll/install_tactic.o:(install_tactics(tactic_manager&))
. . .
ld: error: relocation R_ARM_MOVT_ABS cannot be used against symbol =
__stack_chk_guard; recompile with -fPIC
>>> defined in /lib/libc.so.7
>>> referenced by gparams_register_modules.cpp:93 =
(../src/api/dll/gparams_register_modules.cpp:93)
>>>               =
api/dll/gparams_register_modules.o:(gparams_register_modules())
ld: error: relocation R_ARM_MOVW_ABS_NC cannot be used against symbol =
g_z3_log_enabled; recompile with -fPIC
>>> defined in api/api_log.o
>>> referenced by api_log_macros.h:11 (../src/api/api_log_macros.h:11)
>>>               api/api_algebraic.o:(Z3_algebraic_is_value)
. . .

Currently building llvm90 on/for armv7 is blocked by needing
to build math/z3 first.

(For FreeBSD to switch from clang 8 to clang 9 as the system
compiler might require adding z3 to FreeBSD?)

=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?CCCFEBCB-4DC3-4217-97BD-9D4DC85742E0>