Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2020 08:38:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        powerpc@FreeBSD.org
Subject:   [Bug 243182] java/openjdk11: add bootstrap and fix compilation for powerpc64 elfv2
Message-ID:  <bug-243182-25139-Sptg7QMmxq@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-243182-25139@https.bugs.freebsd.org/bugzilla/>
References:  <bug-243182-25139@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243182

--- Comment #12 from Piotr Kubaj <pkubaj@FreeBSD.org> ---
(In reply to Greg Lewis from comment #11)
Sure, GCC supports ELFv2 since 4.8.3
(https://www.gnu.org/software/gcc/gcc-4.8/changes.html). But FreeBSD/powerp=
c64
with ELFv2 uses Clang.
>From java/openjdk11/Makefile:
.if ${COMPILER_TYPE} =3D=3D gcc
USE_GCC=3D        yes
CONFIGURE_ARGS+=3D=20=20=20=20=20=20=20
--with-extra-ldflags=3D"-Wl,-rpath=3D${LOCALBASE}/lib/gcc${GCC_DEFAULT}
-L${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
--with-extra-cflags=3D"-Wl,-rpath=3D${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
--with-extra-cxxflags=3D"-Wl,-rpath=3D${LOCALBASE}/lib/gcc${GCC_DEFAULT}"
.else
MAKE_ENV+=3D      USE_CLANG=3Dtrue
.endif

So new GCC from ports (able to use ELFv2) will be used only when GCC is use=
d in
the first place (base GCC, which only does ELFv1).

If Clang is used (only on ELFv2), you don't switch to GCC.

You definitely could build FreeBSD without Clang and use external GCC on EL=
Fv2,
or use Clang with GNU ld.bfd on ELFv1 (ldd doesn't support ELFv1, in fact M=
ark
Millard played with Clang + ld.bfd on ELFv1), but this is entirely unsuppor=
ted
use-case and I doubt anyone does this anymore (even if someone does, it's
unsupported).

There are of course other ports that need to use GCC from ports on powerpc6=
4,
because Clang can't compile them (it's still pretty immature on POWER compa=
red
to GCC 9 and has some bugs), but it can definitely build OpenJDK.

That's why there's this assumption: that GCC means ELFv1 and Clang means EL=
Fv2.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-243182-25139-Sptg7QMmxq>