Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Sep 2023 17:37:00 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        "Simon J. Gerraty" <sjg@juniper.net>
Cc:        Mike Karels <mike@karels.net>, stevek@juniper.net, dev-commits-src-main@freebsd.org
Subject:   Re: git: f9df60975087 - main - Add support for host32 for DIRDEPS_BUILD
Message-ID:  <053CA2AC-B5D6-4F2C-B89E-53BE8D4FA67B@yahoo.com>
In-Reply-To: <E541DE87-9FEB-428A-940C-36686D5A7B9C@yahoo.com>
References:  <79F167D9-DF7A-4714-92EE-3B9FBB7BF912.ref@yahoo.com> <79F167D9-DF7A-4714-92EE-3B9FBB7BF912@yahoo.com> <2401.1695508551@kaos.jnpr.net> <8033.1695509469@kaos.jnpr.net> <E541DE87-9FEB-428A-940C-36686D5A7B9C@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 23, 2023, at 17:28, Mark Millard <marklmi@yahoo.com> wrote:

> On Sep 23, 2023, at 15:51, Simon J. Gerraty <sjg@juniper.net> wrote:
>=20
>> Simon J. Gerraty <sjg@juniper.net> wrote:
>>>> Looks like this broke lib32 builds via it ending up using
>>>> the default:
>>>>=20
>>>> -target armv7-unknown-freebsd
>>>>=20
>>>> instead of the correct:
>>>>=20
>>>> -target armv7-unknown-freebsd15.0-gnueabihf

In case it was not clear: in the Jenkins build logs,=20
there were commands of the structure:

cc -march=3Darmv7 -m32 -target armv7-unknown-freebsd15.0-gnueabihf . . . =
-target armv7-unknown-freebsd . . .

(So: both styles of target listed in the same command, the
incorrect one listed later.)

>>> Sorry.
>>>=20
>>> That would be easier to fix/control if a separate variable
>>> is used to hold just the -target flag=20
>>>=20
>>> That way bsd.compat.mk could reset that varaible if needed with no =
harm
>>> done.
>>>=20
>>=20
>> Does the following look like it would DTRT for you?
>> Not sure about COMPILER_TYPE vs COMPAT_COMPILER_TYPE
>=20
> I reported strictly based on noticing the official FreeBSD
> Jenkins activity having build failures. My environment is
> currently based on a commit that is a day or two before
> your change, so I'd need to progress in order to be able
> to test anything that fixed the operation.
>=20
> I expect that Mike Karels would be a better one to comment
> on any alternate structuring for having the build environment
> always be explicit for its aarch64 -m32 use, at least based
> on preexisting familiarity with where and how things are used.
>=20
> Last I tried, gcc12 based builds did not work/finish for
> aarch64, even though amd64 was working at the time. It seemed
> that the status was not a surprise to folks. Correctly
> covering gcc12 use for this issue may well still end up with
> a broken/incomplete aarch64+LIB32 build via gcc12 --for other
> reasons.
>=20
> (E-mail has a tendency to not preserve leading whitespace.)
>=20
>> diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk
>> index =
0c387bcb020c67ea6eda8fc1f4956eebf098e2a2..1e82df42391c4cec341ad368cb477fe4=
a14c84b8 100644
>> --- a/share/mk/bsd.compat.mk
>> +++ b/share/mk/bsd.compat.mk
>> @@ -26,16 +26,18 @@ COMPAT_COMPILER_TYPE=3D${COMPILER_TYPE}
>>=20
>> # -------------------------------------------------------------------
>> # 32 bit world
>> +LIB32CPUFLAGS=3D ${LIB32CPUFLAGS.${COMPAT_COMPILER_TYPE}:U}
>> +LIB32CPUFLAGS.clang=3D -target ${CROSS_TARGET.clang}
>> .if ${COMPAT_ARCH} =3D=3D "amd64"
>> HAS_COMPAT+=3D 32
>> .if empty(LIB32CPUTYPE)
>> -LIB32CPUFLAGS=3D -march=3Di686 -mmmx -msse -msse2
>> +LIB32CPUFLAGS+=3D -march=3Di686 -mmmx -msse -msse2
>> .else
>> -LIB32CPUFLAGS=3D -march=3D${LIB32CPUTYPE}
>> +LIB32CPUFLAGS+=3D -march=3D${LIB32CPUTYPE}
>> .endif
>> .if ${COMPAT_COMPILER_TYPE} =3D=3D gcc
>> .else
>> -LIB32CPUFLAGS+=3D -target x86_64-unknown-freebsd${OS_REVISION}
>> +CROSS_TARGET.clang=3D x86_64-unknown-freebsd${OS_REVISION}
>> .endif
>> LIB32CPUFLAGS+=3D -m32
>> LIB32_MACHINE=3D i386
>> @@ -47,15 +49,15 @@ LIB32WMAKEFLAGS=3D \
>> .elif ${COMPAT_ARCH} =3D=3D "powerpc64"
>> HAS_COMPAT+=3D 32
>> .if empty(LIB32CPUTYPE)
>> -LIB32CPUFLAGS=3D -mcpu=3Dpowerpc
>> +LIB32CPUFLAGS+=3D -mcpu=3Dpowerpc
>> .else
>> -LIB32CPUFLAGS=3D -mcpu=3D${LIB32CPUTYPE}
>> +LIB32CPUFLAGS+=3D -mcpu=3D${LIB32CPUTYPE}
>> .endif
>>=20
>> .if ${COMPAT_COMPILER_TYPE} =3D=3D "gcc"
>> LIB32CPUFLAGS+=3D -m32
>> .else
>> -LIB32CPUFLAGS+=3D -target powerpc-unknown-freebsd${OS_REVISION}
>> +CROSS_TARGET.clang=3D powerpc-unknown-freebsd${OS_REVISION}
>> .endif
>>=20
>> LIB32_MACHINE=3D powerpc
>> @@ -66,15 +68,15 @@ LIB32WMAKEFLAGS=3D \
>> .elif ${COMPAT_ARCH} =3D=3D "aarch64"
>> HAS_COMPAT+=3D 32
>> .if empty(LIB32CPUTYPE)
>> -LIB32CPUFLAGS=3D -march=3Darmv7
>> +LIB32CPUFLAGS+=3D -march=3Darmv7
>> .else
>> -LIB32CPUFLAGS=3D -mcpu=3D${LIB32CPUTYPE}
>> +LIB32CPUFLAGS+=3D -mcpu=3D${LIB32CPUTYPE}
>> .endif
>>=20
>> LIB32CPUFLAGS+=3D -m32
>> .if ${COMPAT_COMPILER_TYPE} =3D=3D "gcc"
>> .else
>> -LIB32CPUFLAGS+=3D -target =
armv7-unknown-freebsd${OS_REVISION}-gnueabihf
>> +CROSS_TARGET.clang=3D armv7-unknown-freebsd${OS_REVISION}-gnueabihf
>> .endif
>>=20
>> LIB32_MACHINE=3D arm
>> diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
>> index =
eb21380f051c4ec8434301ed16c881d07a83dddf..dae540261f7961937db9101da32acc8d=
fca20e8f 100644
>> --- a/share/mk/local.sys.mk
>> +++ b/share/mk/local.sys.mk
>> @@ -97,7 +97,9 @@ META_DEPS+=3D ${META_NOPHONY}
>>=20
>> .if ${MACHINE:Nhost*:Ncommon} !=3D "" && ${MACHINE} !=3D =
${HOST_MACHINE}
>> # cross-building
>> -CROSS_TARGET_FLAGS?=3D -target =
${MACHINE_ARCH}-unknown-freebsd${FREEBSD_REVISION}
>> +CROSS_TARGET.clang?=3D =
${MACHINE_ARCH}-unknown-freebsd${FREEBSD_REVISION}
>> +CROSS_TARGET_FLAGS.clang?=3D -target ${CROSS_TARGET.clang}
>> +CROSS_TARGET_FLAGS?=3D ${CROSS_TARGET_FLAGS.${COMPILER_TYPE}}
>> CFLAGS+=3D ${CROSS_TARGET_FLAGS}
>> ACFLAGS+=3D ${CROSS_TARGET_FLAGS}
>> .endif
>=20
> I see that you have since disabled the new share/mk/local.sys.mk
> code unless ${MK_DIRDEPS_BUILD} =3D=3D "yes" --thus giving time
> for considering alternatives.
>=20




=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?053CA2AC-B5D6-4F2C-B89E-53BE8D4FA67B>