From 636a82af5034dfbf1414528966d82d66342420f6 Mon Sep 17 00:00:00 2001 From: Rakeshwar Reddy Kambaiahgari Date: Fri, 10 Apr 2026 13:06:27 -0700 Subject: [PATCH 1/4] Gcc15Workaround --- .../VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs | 12 ++++++++++++ .../SPECcpu/vc-linux-arm64-jemalloc.cfg | 4 ++++ .../VirtualClient.Actions/SPECcpu/vc-linux-arm64.cfg | 4 ++++ .../SPECcpu/vc-linux-x64-jemalloc.cfg | 6 +++++- .../VirtualClient.Actions/SPECcpu/vc-linux-x64.cfg | 4 ++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs index bdc2a74bba..700d3486bd 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs @@ -489,6 +489,11 @@ private async Task WriteSpecCpuConfigAsync(CancellationToken cancellationToken) SpecCpuConfigPlaceHolder.Gcc10Workaround, Convert.ToInt32(compilerVersion) >= 10 ? SpecCpuConfigPlaceHolder.Gcc10WorkaroundContent : string.Empty, StringComparison.OrdinalIgnoreCase); + + templateText = templateText.Replace( + SpecCpuConfigPlaceHolder.Gcc15Workaround, + Convert.ToInt32(compilerVersion) >= 15 ? SpecCpuConfigPlaceHolder.Gcc15WorkaroundContent : string.Empty, + StringComparison.OrdinalIgnoreCase); } else { @@ -501,6 +506,11 @@ private async Task WriteSpecCpuConfigAsync(CancellationToken cancellationToken) SpecCpuConfigPlaceHolder.Gcc10Workaround, SpecCpuConfigPlaceHolder.Gcc10WorkaroundContent, StringComparison.OrdinalIgnoreCase); + + templateText = templateText.Replace( + SpecCpuConfigPlaceHolder.Gcc15Workaround, + SpecCpuConfigPlaceHolder.Gcc15WorkaroundContent, + StringComparison.OrdinalIgnoreCase); } templateText = templateText.Replace( @@ -572,6 +582,8 @@ private static class SpecCpuConfigPlaceHolder public const string PeakOptimizingFlags = "$PeakOptimizingFlags$"; public const string Gcc10Workaround = "$Gcc10Workaround$"; public const string Gcc10WorkaroundContent = "%define GCCge10"; + public const string Gcc15Workaround = "$Gcc15Workaround$"; + public const string Gcc15WorkaroundContent = "%define GCCge15"; } } } \ No newline at end of file diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc.cfg index 0df8e515fc..e4fadac2dc 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc.cfg @@ -164,6 +164,7 @@ default: # line to avoid compile errors for several FP benchmarks # %define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later +%define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later # EDIT if needed: the preENV line adds library directories to the runtime # path. You can adjust it, or add lines for other environment variables. @@ -318,6 +319,9 @@ default: # data model applies to all benchmarks # default=base: # flags for all base OPTIMIZE = -g -O3 -mcpu=native +% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later) + EXTRA_CXXFLAGS = -Wno-error=template-body +% endif #-------- Peak Tuning Flags ---------------------------------------------- diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64.cfg index 7bf22fa800..ee005f77b1 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64.cfg @@ -164,6 +164,7 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later +$Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime # path. You can adjust it, or add lines for other environment variables. @@ -314,6 +315,9 @@ default: # data model applies to all benchmarks # default=base: # flags for all base OPTIMIZE = $BaseOptimizingFlags$ +% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later) + EXTRA_CXXFLAGS = -Wno-error=template-body +% endif #-------- Peak Tuning Flags ---------------------------------------------- diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc.cfg index 9ecb11dc07..6d54238ce3 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc.cfg @@ -158,6 +158,7 @@ default: # line to avoid compile errors for several FP benchmarks # %define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later +%define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later # EDIT if needed: the preENV line adds library directories to the runtime # path. You can adjust it, or add lines for other environment variables. @@ -300,7 +301,10 @@ fpspeed: # the -march=native. See topic "Older GCC" above. # default=base: # flags for all base - OPTIMIZE = -g -O3 -march=native + OPTIMIZE = -g -O3 -march=native +% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later) + EXTRA_CXXFLAGS = -Wno-error=template-body +% endif #-------- Peak Tuning Flags ---------------------------------------------- diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64.cfg index d342539e05..73e1608624 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64.cfg @@ -158,6 +158,7 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later +$Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime # path. You can adjust it, or add lines for other environment variables. @@ -297,6 +298,9 @@ fpspeed: # default=base: # flags for all base OPTIMIZE = $BaseOptimizingFlags$ +% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later) + EXTRA_CXXFLAGS = -Wno-error=template-body +% endif #-------- Peak Tuning Flags ---------------------------------------------- From 81441cd3b612313f6469053fb5920ad9d6bdf7f8 Mon Sep 17 00:00:00 2001 From: Rakeshwar Reddy Kambaiahgari Date: Wed, 15 Apr 2026 11:11:41 -0700 Subject: [PATCH 2/4] up version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d19cf84f9e..29cec99e71 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.17 +3.0.18 From 59f8cc0d6c1f6bb593cdbcbea63ce536732bf2fa Mon Sep 17 00:00:00 2001 From: Rakeshwar Reddy Kambaiahgari Date: Wed, 15 Apr 2026 11:53:23 -0700 Subject: [PATCH 3/4] added tests --- .../SPEC/SpecCpuExecutorTests.cs | 90 +++++++++++++++++++ .../SPEC/mockspeccpu.cfg | 1 + 2 files changed, 91 insertions(+) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs index 90712b9df5..d40b34ecb6 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs @@ -427,6 +427,96 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithDifferentProfiles Assert.IsTrue(commandCalled); } + [Test] + public async Task SpecCpuExecutorAppliesGcc15WorkaroundWhenGccVersionIs15OrGreaterOnLinux() + { + this.SetupLinux(); + + string writtenConfigText = null; + this.mockFixture.File.Setup(f => f.WriteAllTextAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((path, content, token) => writtenConfigText = content) + .Returns(Task.CompletedTask); + + this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => + { + if (exe == "sudo" && arguments == "gcc -dumpversion") + { + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, + StandardOutput = new ConcurrentBuffer(new StringBuilder("15")), + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + } + + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + }; + + using (TestSpecCpuExecutor specCpuExecutor = new TestSpecCpuExecutor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) + { + await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + } + + Assert.IsNotNull(writtenConfigText); + Assert.IsTrue(writtenConfigText.Contains("%define GCCge15"), "Config should contain '%define GCCge15' when GCC version is 15 or greater."); + Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should also contain '%define GCCge10' when GCC version is 15 or greater."); + Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced."); + Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced."); + } + + [Test] + public async Task SpecCpuExecutorDoesNotApplyGcc15WorkaroundWhenGccVersionIsLessThan15OnLinux() + { + this.SetupLinux(); + + string writtenConfigText = null; + this.mockFixture.File.Setup(f => f.WriteAllTextAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((path, content, token) => writtenConfigText = content) + .Returns(Task.CompletedTask); + + this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => + { + if (exe == "sudo" && arguments == "gcc -dumpversion") + { + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, + StandardOutput = new ConcurrentBuffer(new StringBuilder("10")), + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + } + + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + }; + + using (TestSpecCpuExecutor specCpuExecutor = new TestSpecCpuExecutor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) + { + await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + } + + Assert.IsNotNull(writtenConfigText); + Assert.IsFalse(writtenConfigText.Contains("%define GCCge15"), "Config should NOT contain '%define GCCge15' when GCC version is less than 15."); + Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should contain '%define GCCge10' when GCC version is 10."); + Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced."); + Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced."); + } + private void SetupLinux() { this.mockFixture = new MockFixture(); diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg index d342539e05..fe69c4a805 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg @@ -158,6 +158,7 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later +$Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime # path. You can adjust it, or add lines for other environment variables. From 618436e2951b2ed2bf5350ffd8061e6ebf8b596a Mon Sep 17 00:00:00 2001 From: Rakeshwar Reddy Kambaiahgari Date: Thu, 30 Apr 2026 14:06:52 -0700 Subject: [PATCH 4/4] upversion --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a4f52a5dbb..0444f32076 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 \ No newline at end of file +3.2.1 \ No newline at end of file