Date: Tue, 3 May 2022 16:15:05 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: Alfredo Dal'Ava Junior <alfredo@FreeBSD.org> Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: f9ee4156741a - main - build target triple variable from sys/conf/newvers.sh Message-ID: <6BD23371-3545-4E21-B110-9FF218132596@freebsd.org> In-Reply-To: <202205031116.243BGSpf047743@gitrepo.freebsd.org> References: <202205031116.243BGSpf047743@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 3 May 2022, at 12:16, Alfredo Dal'Ava Junior <alfredo@FreeBSD.org> = wrote: >=20 > The branch main has been updated by alfredo: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df9ee4156741a205c93ae947595b5c487= 17107d9e >=20 > commit f9ee4156741a205c93ae947595b5c48717107d9e > Author: Alfredo Dal'Ava Junior <alfredo@FreeBSD.org> > AuthorDate: 2022-05-03 11:09:38 +0000 > Commit: Alfredo Dal'Ava Junior <alfredo@FreeBSD.org> > CommitDate: 2022-05-03 11:09:38 +0000 >=20 > build target triple variable from sys/conf/newvers.sh >=20 > Retrieve FreeBSD revision number directly from sys/conf/newvers.sh > when building the compiler target triple value, avoiding manual > intervention on other files every new release. >=20 > Reviewed by: imp > MFC after: 2 months > Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) > Differential Revision: https://reviews.freebsd.org/D34429 > --- > Makefile.inc1 | 4 ++-- > lib/clang/llvm.build.mk | 9 ++++++--- > share/mk/bsd.compat.mk | 4 ++-- > share/mk/src.sys.env.mk | 5 +++++ > 4 files changed, 15 insertions(+), 7 deletions(-) >=20 > diff --git a/Makefile.inc1 b/Makefile.inc1 > index 2b913e4e51f8..e3081594ec77 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -138,9 +138,9 @@ TARGET_ABI=3D gnueabi > .endif > .endif > MACHINE_ABI?=3D unknown > = -MACHINE_TRIPLE?=3D${MACHINE_ARCH:S/amd64/x86_64/:C/sf$//}-${MACHINE_ABI}-= freebsd14.0 > = +MACHINE_TRIPLE?=3D${MACHINE_ARCH:S/amd64/x86_64/:C/sf$//}-${MACHINE_ABI}-= freebsd${OS_REVISION} > TARGET_ABI?=3D unknown > -TARGET_TRIPLE?=3D = ${TARGET_ARCH:S/amd64/x86_64/:C/sf$//}-${TARGET_ABI}-freebsd14.0 > +TARGET_TRIPLE?=3D = ${TARGET_ARCH:S/amd64/x86_64/:C/sf$//}-${TARGET_ABI}-freebsd${OS_REVISION}= > KNOWN_ARCHES?=3D aarch64/arm64 \ > amd64 \ > armv6/arm \ > diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk > index 5aff7081fb76..dd54bf7312d9 100644 > --- a/lib/clang/llvm.build.mk > +++ b/lib/clang/llvm.build.mk > @@ -14,6 +14,10 @@ > .error Please define SRCDIR before including this file > .endif >=20 > +.ifndef OS_REVISION > +.error Please define OS_REVISION before including this file > +.endif > + > .PATH: ${LLVM_BASE}/${SRCDIR} >=20 > CFLAGS+=3D -I${SRCTOP}/lib/clang/include > @@ -40,10 +44,9 @@ TARGET_ABI=3D -gnueabi > TARGET_ABI=3D > .endif > VENDOR=3D unknown > -OS_VERSION=3D freebsd14.0 >=20 > -LLVM_TARGET_TRIPLE?=3D = ${TARGET_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-${OS= _VERSION}${TARGET_ABI} > -LLVM_BUILD_TRIPLE?=3D = ${BUILD_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-${OS_= VERSION} > +LLVM_TARGET_TRIPLE?=3D = ${TARGET_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-free= bsd${OS_REVISION}${TARGET_ABI} > +LLVM_BUILD_TRIPLE?=3D = ${BUILD_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freeb= sd${OS_REVISION} >=20 > CFLAGS+=3D -DLLVM_DEFAULT_TARGET_TRIPLE=3D\"${LLVM_TARGET_TRIPLE}\" > CFLAGS+=3D -DLLVM_HOST_TRIPLE=3D\"${LLVM_BUILD_TRIPLE}\" > diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk > index 6a7d3d3c7e80..e99281775b84 100644 > --- a/share/mk/bsd.compat.mk > +++ b/share/mk/bsd.compat.mk > @@ -30,7 +30,7 @@ LIB32CPUFLAGS=3D -march=3D${COMPAT_CPUTYPE} > .endif > .if ${COMPAT_COMPILER_TYPE} =3D=3D gcc > .else > -LIB32CPUFLAGS+=3D -target x86_64-unknown-freebsd14.0 > +LIB32CPUFLAGS+=3D -target x86_64-unknown-freebsd${OS_REVISION} > .endif > LIB32CPUFLAGS+=3D -m32 > LIB32_MACHINE=3D i386 > @@ -51,7 +51,7 @@ LIB32CPUFLAGS=3D -mcpu=3D${COMPAT_CPUTYPE} > .if ${COMPAT_COMPILER_TYPE} =3D=3D "gcc" > LIB32CPUFLAGS+=3D -m32 > .else > -LIB32CPUFLAGS+=3D -target powerpc-unknown-freebsd14.0 > +LIB32CPUFLAGS+=3D -target powerpc-unknown-freebsd${OS_REVISION} > .endif >=20 > LIB32_MACHINE=3D powerpc > diff --git a/share/mk/src.sys.env.mk b/share/mk/src.sys.env.mk > index 6f11489bfd2f..86f739414230 100644 > --- a/share/mk/src.sys.env.mk > +++ b/share/mk/src.sys.env.mk > @@ -23,6 +23,11 @@ RELTOP?=3D ${RELDIR:C,[^/]+,..,g} > RELOBJTOP?=3D ${RELTOP} > RELSRCTOP?=3D ${RELTOP} >=20 > +.if !defined(OS_REVISION) > +OS_REVISION!=3Deval `sh ${SRCTOP}/sys/conf/newvers.sh -V REVISION` && = echo $$REVISION || echo In what situation would you ever want the version to silently be omitted on error, rather than stopping the build? Jess > +.export OS_REVISION > +.endif > + > # site customizations that do not depend on anything! >=20 > # Save MAKEOBJDIRPREFIX and don't let src-env.conf modify it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6BD23371-3545-4E21-B110-9FF218132596>