Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 May 2019 17:48:14 +0000
From:      James Shuriff <james@opentech.cc>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        ports-list freebsd <freebsd-ports@freebsd.org>, "bapt@FreeBSD.org" <bapt@FreeBSD.org>, "jhb@FreeBSD.org" <jhb@FreeBSD.org>
Subject:   RE: maintenance of gcc cross ports
Message-ID:  <BN7PR06MB5187D7636971E006E65D3E2CAA050@BN7PR06MB5187.namprd06.prod.outlook.com>
In-Reply-To: <2A90CC78-117B-4988-9022-1687872B6C59@yahoo.com>
References:  <0BDF4BD8-EF07-4226-A2BA-4ACE476CD6FC@yahoo.com> <BN7PR06MB518758AEC18571D655453F05AA050@BN7PR06MB5187.namprd06.prod.outlook.com> <2A90CC78-117B-4988-9022-1687872B6C59@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I have a Raspberry Pi 3 model b. I use the LLVM toolchain to build the syst=
em but the GNU toolchain is required to build U-Boot. U-Boot uses global re=
gister variables and LLVM doesn't support this. sysutils/u-boot-pine64 does=
 use aarch64-none-elf-gcc, for the same reason. The family is allwinner64 a=
nd that's set to use aarch64-none-elf-gcc. Here is an article explaining th=
e feature U-Boot uses that's not in LLVM (the reason GNU is required for bu=
ilding it):

https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html

Aarch64 is a Tier 2 architecture. The toolchain should have an active maint=
ainer (the maintainer is listed as ports@FreeBSD.org). I've opened a bug re=
port for the bugs in the Makefile. We should be using a newer toolchain or =
separate arm-none-eabi and aarch64-none-elf from powerpc64. I am guessing t=
he Makefile bugs occurred because the original designer didn't intend on po=
werpc64-gcc being used for targets like arm-none-eabi and aarch64-none-elf.=
 The patches you pointed out before don't even have any effect on the bare =
metal ports. The arm and aarch64 bare metal ports are the oddballs in the g=
roup. The difference being: powerpc64-gcc, aarch64-gcc, amd64-gcc, i386-gcc=
, mips*-gcc, and sparc64-gcc are all intended for, as you said Mark, altern=
ate toolchain work with FreeBSD. These are not the official toolchains for =
FreeBSD and I can see why they don't have the same level of care as the off=
icial toolchain. But the side effect of this is arm-none-eabi-gcc and aarch=
64-none-elf-gcc receive the same level of support, though they are *require=
d* to build most FreeBSD systems on those platforms.

- James Shuriff

-----Original Message-----
From: Mark Millard <marklmi@yahoo.com>
Sent: Sunday, May 19, 2019 11:46 AM
To: James Shuriff <james@opentech.cc>
Cc: ports-list freebsd <freebsd-ports@freebsd.org>; bapt@FreeBSD.org; jhb@F=
reeBSD.org
Subject: Re: maintenance of gcc cross ports



On 2019-May-19, at 07:40, James Shuriff <james at opentech.cc> wrote:

> I didn't/don't plan on touching binutils. Binutils is okay. I made new pa=
tches as well. What I'm really concerned with bringing up to date is aarch6=
4-none-elf-gcc.

> The GNU toolchain is unfortunately required for building an Aarch64
> system

Are you specifically referencing contexts that need to build u-boot? (My gu=
ess is: yes.)

I've done buildworld buildkernel based on system clang and lld many times i=
n the past, though not very recently. (I currently do not have access to th=
e environment but will again, eventually.)

For aarch64 I'd mostly recently built for and used:

A) a Pine64+ 2GB (needs: sysutils/u-boot-pine64 )
B) an OverDrive 1000 (no u-boot build needed)

I've done amd64->aarch64 cross builds and self hosted ones for/on such. The=
 OverDrive 1000 builds did not involve devel/aarch64-none-elf-gcc at all as=
 far as I can remember.

> and is a prereq for a bunch of sysutils arm ports.

Yep.

Are there sysutils/u-boot-* 's that no longer build under gcc 6.4.0?
Other things?

> At worst we can do something like what's done with the lang ports gcc6, g=
cc7, gcc8. I've CC'd the maintainers so hopefully they can give us some inp=
ut and we can come up with a solution.
>
> As for Makefile issues, this is only an issue for the arm-none-eabi-gcc a=
nd aarch64-none-elf-gcc ports because they have multiple hyphens. It's most=
ly a cosmetic issue. Each port has its own plist because gcc generates diff=
erent headers depending on the platform so the PLIST TARGETARCH regex doesn=
't really affect all that much. There are some clang flags dependent on TAR=
GETARCH but whoever wrote the aarch64-none-elf-gcc port must have known it =
wasn't working in the master because the check is in the bare metal port as=
 well. The stripping out of all hyphens causes things like "gcc version 6.4=
.0 (FreeBSD Ports Collection for aarch64noneelf)". I use ${PKGNAMEPREFIX:C/=
-$//} for the comment and version and ${PKGNAMEPREFIX:C/-.*//} for TARGETAR=
CH. The original regex for all of those is ${PKGNAMEPREFIX:C/-//g} and I'm =
sure you can see how that's a problem when there's multiple hyphens.

Thanks for the notes.

> - James Shuriff
>
> -----Original Message-----
> From: Mark Millard <marklmi@yahoo.com>
> Sent: Sunday, May 19, 2019 1:33 AM
> To: James Shuriff <james@opentech.cc>; ports-list freebsd
> <freebsd-ports@freebsd.org>
> Subject: Re: maintenance of gcc cross ports
>
> James Shuriff james at opentech.cc wrote on Sat May 18 12:29:22 UTC 2019 =
:
>
>> The powerpc64-gcc port and all the ports that use it as a master (aarch6=
4-gcc, aarch64-none-elf-gcc, amd64-gcc, arm-none-eabi-gcc, i386-gcc, mips-g=
cc, mips64-gcc, and sparc64-gcc) are very old and use buggy makefiles. I wo=
uld like to take over maintenance of these ports. Powerpc64-gcc uses an old=
 version of gcc and the makefile is buggy. Certain variables use bad regula=
r expressions thus don't do what they're supposed to do. I've fixed up the =
makefiles and made new plists with a newer version of gcc.
>
> Be aware that:
>
> /[ports]/head/base/binutils depends on devel/binutils via:
>
> MASTERDIR=3D${.CURDIR}/../../devel/binutils
>
> /[ports]/head/base/gcc depends on devel/powerpc64-gcc via:
>
> EXTRA_PATCHES+=3D
> ${.CURDIR}/../../devel/powerpc64-gcc/files/freebsd-format-extensions
> EXTRA_PATCHES+=3D
> ${.CURDIR}/../../devel/powerpc64-gcc/files/freebsd-libdir
> EXTRA_PATCHES+=3D
> ${.CURDIR}/../../devel/powerpc64-gcc/files/patch-gcc-freebsd-mips
>
> The maintainer is listed as: bapt@FreeBSD.org but the activity tends to b=
e jhb@FreeBSD.org . There are other, more overall FreeBSD toolchain efforts=
 that these various ports are tied to. That may constrain what can be done =
when. You would probably need to consult with these folks about any changes=
.
>
> I use these ports for doing alternate toolchain buildworld buildkernel ac=
tivities, including using, say, devel/powerpc64-gcc on a powerpc64 machine =
to self host with more modern tools than gcc 4.2.1 based ones.
> As I understand, being in devel/ instead of lang/ for gcc tools is tied t=
o being constructed for the system-building activities instead of for gener=
al use.
>
> You might want to show your Makefile updates so that that the problems ar=
e fully explicit.
>


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

________________________________
 DISCLAIMER: This message and any attachments are intended solely for the u=
se of the recipient and may contain confidential information. If you have r=
eceived this message in error please delete it and promptly notify the send=
er, James Shuriff (james@opentech.cc<mailto:james@opentech.cc>).



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