Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Dec 2011 13:59:11 +0100
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        Daniel Kalchev <daniel@digsys.bg>
Cc:        Kostik Belousov <kostikbel@gmail.com>, freebsd-current@freebsd.org, Ports FreeBSD <freebsd-ports@FreeBSD.org>
Subject:   Re: lang/lua: /usr/bin/ld: lapi.o: relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC
Message-ID:  <4EFC641F.4050900@zedat.fu-berlin.de>
In-Reply-To: <4EFC5E72.806@digsys.bg>
References:  <4EFAF3FC.60002@zedat.fu-berlin.de> <20111228135808.GW50300@deviant.kiev.zoral.com.ua> <4EFB2344.3000302@zedat.fu-berlin.de> <20111228142957.GX50300@deviant.kiev.zoral.com.ua> <4EFB447D.3000808@gwdg.de> <20111228181054.GF1895@hoeg.nl> <4EFB5E0C.90302@zedat.fu-berlin.de> <20111228183132.GB50300@deviant.kiev.zoral.com.ua> <4EFC4579.6060608@gwdg.de> <4EFC4CCC.3050507@zedat.fu-berlin.de> <20111229115904.GH50300@deviant.kiev.zoral.com.ua> <4EFC5ACD.5010701@zedat.fu-berlin.de> <4EFC5E72.806@digsys.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig462B8D7C2E1809F44A62F02C
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Am 12/29/11 13:34, schrieb Daniel Kalchev:
>=20
>=20
> On 29.12.11 14:19, O. Hartmann wrote:
>> Am 12/29/11 12:59, schrieb Kostik Belousov:
>>> On Thu, Dec 29, 2011 at 12:19:40PM +0100, O. Hartmann wrote:
>>>> [...]
>>>> /usr/bin/ld: lapi.o: relocation R_X86_64_32 against `luaO_nilobject_=
'
>>>> can not be used when making a shared object; recompile with -fPIC
>>>> lapi.o: could not read symbols: Bad value
>>>> clang: error: linker command failed with exit code 1 (use -v to see
>>>> invocation)
>>>> *** Error code 1
>>>>
>>>> Stop in /usr/ports/lang/lua/work/lua-5.1.4/src.
>>>> *** Error code 1
>>>>
>>>> Stop in /usr/ports/lang/lua/work/lua-5.1.4/src.
>>>> *** Error code 1
>>>>
>>>> Stop in /usr/ports/lang/lua/work/lua-5.1.4.
>>>> *** Error code 1
>>>>
>>>> Stop in /usr/ports/lang/lua.
>>>>
>>>> =3D=3D=3D>>>  make failed for lang/lua
>>>> =3D=3D=3D>>>  Aborting update
>>>>
>>>> Terminated
>>>> Terminated
>>>>
>>>> This is very strange!
>>> What is strange ? It is exactly the same problem as in the first mess=
age
>>> started this thread. You must use -fPIC flag for compiler when compil=
ing
>>> objects that shall be later linked into dso. So, for lua case, -fPIC
>>> must be present on the cc -c command line.
>> This therefore strange, since this problem with lua occurs on machines=
,
>> where I've set "CFLAGS=3D" and "COPTFLAGS=3D" as in
>> /usr/share/examples/etc/make.conf and on one box, one box I accidental=
ly
>> set those flags to "CFLAGS+=3D" and "COPTFLAGS+=3D" and there it works=
 and
>> the -fPIC flag is set by the FreeBSD's port framework.
>>
>> So I guess there is a bug introduced with one of the last Mk-files
>> updates.
>>
>=20
> As suggested by the "howto" for using newer GCC versions,
> http://www.freebsd.org/doc/en/articles/custom-gcc/article.html you are
> supposed to use CFLAGS+=3D to add additional compile flags.

Just for the record I'd like to repeat, that the error above mentioned
is also with the legacy FreeBSD's gcc 4.2.X compiler.

As Kostik Belousov made clear in his last posting, the error occurs due
to a missing -fPIC - which is now clear to me.

People not sleeping with their OS, like myself, would simply copy the
make.conf from /usr/share/examples/etc/ and set some additional flags.
Then the problem will occur again. Maybe it would be wise to reflect
this issue by some additional words in make.conf?
>=20
> By the way, "-O2 -fno-strict-aliasing -pipe" are the default flags, tha=
t
> are used when CFLAGS is not set by the user.
>=20
> COPTFLAGS is used only to build the kernel and doing it with non-system=

> GCC is not likely to be safe.
>=20
> Daniel


Oliver


--------------enig462B8D7C2E1809F44A62F02C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iQEcBAEBAgAGBQJO/GQfAAoJEOgBcD7A/5N8kgwH/0xKqHoUJ7/UXokd+cqYQlXw
emm2odCZRtsTIyjFQfZuJzOoh0mpiP0UXxD5vh+U95YjTClKwOY1KnINlxNKsunS
IDY/fBg0a+5e6GucIuTPRqrZF1hEzAgr2xAUbMiZK08P+WA3ZVuN/4KqCBeWdjvO
aPb5wZcIJOR3IZpNksZpdv9inpiTsu9EJHH5d/o0x7IgW/GfjDOf7Jg3/oRza+JL
TDK+UXL5VizherRe6FDvpghaDk+pzC81PzN5Wjs4Cm/2FjO+HCZJb1GC7kQfsFYx
IHCkqahV8ttmtVn2kVNL27dLL/sVVqOhq06Hxflm45GQXGP1xXjFM9WOMyU+vps=
=6rDG
-----END PGP SIGNATURE-----

--------------enig462B8D7C2E1809F44A62F02C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EFC641F.4050900>