Skip to content

Commit dd48b36

Browse files
committed
universe: Permit requesting a specific version of GCC
If USE_GCC_TOOLCHAINS is set to a value matching the pattern 'gcc*', use that as the GCC version. For example, USE_GCC_TOOLCHAINS=gcc16 would use amd64-gcc16 for amd64, etc. If the variable is set to a value that doesn't match that pattern, use the default version. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48418 (cherry picked from commit 550137e)
1 parent 00df124 commit dd48b36

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Makefile

+10-8
Original file line numberDiff line numberDiff line change
@@ -551,14 +551,16 @@ TARGET_ARCHES_${target}= ${MACHINE_ARCH_LIST_${target}}
551551
.endfor
552552

553553
.if defined(USE_GCC_TOOLCHAINS)
554-
TOOLCHAINS_amd64= amd64-gcc12
555-
TOOLCHAINS_arm= armv6-gcc12 armv7-gcc12
556-
TOOLCHAIN_armv7= armv7-gcc12
557-
TOOLCHAINS_arm64= aarch64-gcc12
558-
TOOLCHAINS_i386= i386-gcc12
559-
TOOLCHAINS_powerpc= powerpc-gcc12 powerpc64-gcc12
560-
TOOLCHAIN_powerpc64= powerpc64-gcc12
561-
TOOLCHAINS_riscv= riscv64-gcc12
554+
_DEFAULT_GCC_VERSION= gcc12
555+
_GCC_VERSION= ${"${USE_GCC_TOOLCHAINS:Mgcc*}" != "":?${USE_GCC_TOOLCHAINS}:${_DEFAULT_GCC_VERSION}}
556+
TOOLCHAINS_amd64= amd64-${_GCC_VERSION}
557+
TOOLCHAINS_arm= armv6-${_GCC_VERSION} armv7-${_GCC_VERSION}
558+
TOOLCHAIN_armv7= armv7-${_GCC_VERSION}
559+
TOOLCHAINS_arm64= aarch64-${_GCC_VERSION}
560+
TOOLCHAINS_i386= i386-${_GCC_VERSION}
561+
TOOLCHAINS_powerpc= powerpc-${_GCC_VERSION} powerpc64-${_GCC_VERSION}
562+
TOOLCHAIN_powerpc64= powerpc64-${_GCC_VERSION}
563+
TOOLCHAINS_riscv= riscv64-${_GCC_VERSION}
562564
.endif
563565

564566
# If a target is using an external toolchain, set MAKE_PARAMS to enable use

share/man/man7/build.7

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2626
.\" SUCH DAMAGE.
2727
.\"
28-
.Dd November 13, 2024
28+
.Dd January 10, 2025
2929
.Dt BUILD 7
3030
.Os
3131
.Sh NAME
@@ -879,6 +879,11 @@ This variable implies
879879
Use external GCC toolchains to build the requested targets.
880880
If the required toolchain package for a supported architecture is not installed,
881881
the build for that architecture is skipped.
882+
.Pp
883+
A specific version of GCC can be used by setting the value of this variable
884+
to the desired version
885+
.Pq for example, Dq gcc14 ;
886+
otherwise a default version of GCC is used.
882887
.It Va TARGETS
883888
Only build the listed targets instead of each supported architecture.
884889
.It Va EXTRA_TARGETS

0 commit comments

Comments
 (0)