Skip to content

Commit 3be0303

Browse files
Merge branch 'main' into Bug_579242
2 parents ec2f40e + 2e38e74 commit 3be0303

File tree

40 files changed

+568
-41
lines changed

40 files changed

+568
-41
lines changed

Jenkinsfile

+2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ pipeline {
3636
timeout(activity: true, time: 20) {
3737
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=50.0 -XX:+PrintFlagsFinal']) {
3838
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
39+
// XXX: Issue 684 means that dsf-gdb tests are skipped
3940
sh '''/jipp/tools/apache-maven/latest/bin/mvn \
4041
clean verify -B -V \
42+
-Ddsf-gdb.skip.tests=true \
4143
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
4244
-Dmaven.test.failure.ignore=true \
4345
-DexcludedGroups=flakyTest,slowTest \

NewAndNoteworthy/CDT-11.5.md

+27-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,33 @@ This is the New & Noteworthy page for CDT 11.5 which is part of Eclipse 2024-03
66

77
# Release Notes
88

9-
# CMake
9+
# Build
10+
11+
## Preprocessor activation for GNU assembly language files
12+
13+
The managed build system now invokes `gcc -c` to build GNU assembly language source files rather than invoking `as` directly. The revised behaviour ensures that the GNU preprocessor is active when building `*.S` and `*.sx` files to match user expectations. In the case of existing managed build projects, a new GNU assembler tool command generator applies the `-Wa,` prefix to user-specified assembler flags where appropriate. Users may revert to the previous behaviour by overriding the assembler command within the project properties dialog:
14+
15+
<p align="center"><img src="images/CDT-11.5-gnu-as-command.png" width="80%"></p>
16+
17+
The new behaviour applies to managed build configurations using a _Cross GCC_, _Cygwin GCC_, _Linux GCC_ or _MinGW GCC_ toolchain.
18+
19+
## COFF symbol presentation
20+
21+
A complete set of external symbols is now presented under COFF binary object files within the _Project Explorer_ view:
22+
23+
<p align="center"><img src="images/CDT-11.5-coff-object.png" width="25%"></p>
24+
25+
The revised presentation matches that observed for ELF binary object files.
26+
27+
## GNU archive content presentation
28+
29+
The original locations of object files within a GNU archive are now calculated using path information where available. This enables presentation of source file names and symbols under archive files within the _Project Explorer_ view:
30+
31+
<p align="center"><img src="images/CDT-11.5-archive-content.png" width="25%"></p>
32+
33+
Managed build _Static Library_ projects using a _Cross GCC_, _Cygwin GCC_, _Linux GCC_ or _MinGW GCC_ toolchain now use the `-P` archiver flag by default to generate the necessary path information.
34+
35+
## CMake
1036
The Launch Bar Launch Configuration Build Settings tab has been updated so it can now correctly control the CMake Generator setting. The "Additional CMake arguments" field can also be used to inject CMake defines into the CMakeCache.txt file to populate it with customizable settings for the project. Use the new "Use these settings" checkbox to control whether to use either the operating system defaults or settings from the UI.
1137

1238
When "Use these settings" checkbox is unchecked, the operating system defaults are used during the CMake build.
@@ -17,7 +43,6 @@ When the "Use these settings" checkbox is checked, the UI settings are used duri
1743

1844
<p align="center"><img src="images/CDT-11.5-Build_Settings_Use_these_settings_checked.PNG" width="50%"></p>
1945

20-
2146
# API Changes, current and planned
2247

2348
## Breaking API changes
Loading
23.6 KB
Loading
Loading

build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core.tests; singleton:=true
5-
Bundle-Version: 8.2.300.qualifier
5+
Bundle-Version: 8.2.400.qualifier
66
Bundle-Activator: org.eclipse.cdt.managedbuilder.testplugin.CTestPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/Benchmarks/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ASM_SRCS :=
66
C_SRCS :=
77
OBJ_SRCS :=
88
O_SRCS :=
9+
SX_SRCS :=
910
S_UPPER_SRCS :=
1011
C_DEPS :=
1112
EXECUTABLES :=

build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/Benchmarks/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ASM_SRCS :=
66
C_SRCS :=
77
OBJ_SRCS :=
88
O_SRCS :=
9+
SX_SRCS :=
910
S_UPPER_SRCS :=
1011
C_DEPS :=
1112
EXECUTABLES :=

build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/Benchmarks/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ASM_SRCS :=
66
C_SRCS :=
77
OBJ_SRCS :=
88
O_SRCS :=
9+
SX_SRCS :=
910
S_UPPER_SRCS :=
1011
C_DEPS :=
1112
EXECUTABLES :=

build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/Benchmarks/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CXXM_SRCS :=
1212
CXX_SRCS :=
1313
C_UPPER_SRCS :=
1414
LOG_SRCS :=
15+
SX_SRCS :=
1516
S_UPPER_SRCS :=
1617
TAR_SRCS :=
1718
LOGFILE :=

build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/Benchmarks/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ASM_SRCS :=
66
C_SRCS :=
77
OBJ_SRCS :=
88
O_SRCS :=
9+
SX_SRCS :=
910
S_UPPER_SRCS :=
1011
C_DEPS :=
1112
EXECUTABLES :=

build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ C_SRCS :=
1414
C_UPPER_SRCS :=
1515
OBJ_SRCS :=
1616
O_SRCS :=
17+
SX_SRCS :=
1718
S_UPPER_SRCS :=
1819
C++M_DEPS :=
1920
C++_DEPS :=

build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/sources.mk

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ C_SRCS :=
1414
C_UPPER_SRCS :=
1515
OBJ_SRCS :=
1616
O_SRCS :=
17+
SX_SRCS :=
1718
S_UPPER_SRCS :=
1819
C++M_DEPS :=
1920
C++_DEPS :=

build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
5-
Bundle-Version: 9.6.200.qualifier
5+
Bundle-Version: 9.6.300.qualifier
66
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2006, 2010 Intel Corporation and others.
2+
* Copyright (c) 2006, 2024 Intel Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* Intel Corporation - Initial API and implementation
13+
* John Dallaway - Provide getter for IConfiguration (#666)
1314
*******************************************************************************/
1415

1516
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
@@ -36,6 +37,10 @@ public FileMacroExplicitSubstitutor(IMacroContextInfo contextInfo, IConfiguratio
3637
fBuilder = builder;
3738
}
3839

40+
public IConfiguration getConfiguration() {
41+
return fCfg;
42+
}
43+
3944
/* (non-Javadoc)
4045
* @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#resolveMacro(org.eclipse.cdt.managedbuilder.macros.IBuildMacro)
4146
*/

build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.gnu.ui; singleton:=true
5-
Bundle-Version: 8.6.100.qualifier
5+
Bundle-Version: 8.7.0.qualifier
66
Bundle-Activator: org.eclipse.cdt.managedbuilder.gnu.ui.GnuUIPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@
565565
id="gnu.windres.option.preprocessor.undefined.symbols"/>
566566
</tool-->
567567
<tool
568-
command="as"
568+
command="gcc"
569569
name="%ToolName.assembler.gnu"
570570
outputFlag="-o"
571571
id="cdt.managedbuild.tool.gnu.assembler"
@@ -579,6 +579,8 @@
579579
<option
580580
name="%Option.Gnu.Assembler.Flags"
581581
category="gnu.asm.category.general"
582+
commandGenerator="org.eclipse.cdt.managedbuilder.gnu.ui.GnuAsmFlagsCommandGenerator"
583+
defaultValue="-c"
582584
valueType="string"
583585
id="gnu.both.asm.option.flags">
584586
</option>
@@ -607,7 +609,7 @@
607609
id="cdt.managedbuild.tool.gnu.assembler.input"
608610
languageId="org.eclipse.cdt.core.assembly"
609611
sourceContentType="org.eclipse.cdt.core.asmSource"
610-
sources="s,S">
612+
sources="s,sx,S">
611613
</inputType>
612614
<outputType
613615
outputs="o"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 John Dallaway and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* John Dallaway - initial implementation (#666)
13+
*******************************************************************************/
14+
package org.eclipse.cdt.managedbuilder.gnu.ui;
15+
16+
import java.util.regex.Pattern;
17+
18+
import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
19+
import org.eclipse.cdt.managedbuilder.core.BuildException;
20+
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
21+
import org.eclipse.cdt.managedbuilder.core.IOption;
22+
import org.eclipse.cdt.managedbuilder.core.IOptionCommandGenerator;
23+
import org.eclipse.cdt.managedbuilder.core.ITool;
24+
import org.eclipse.cdt.managedbuilder.internal.buildmodel.FileMacroExplicitSubstitutor;
25+
import org.eclipse.cdt.managedbuilder.internal.macros.BuildfileMacroSubstitutor;
26+
import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
27+
import org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor;
28+
import org.eclipse.core.runtime.Platform;
29+
import org.eclipse.core.runtime.Status;
30+
31+
/**
32+
* Assembler flags command generator.
33+
* This command generator supports managed build projects that were
34+
* created using older versions of the GNU toolchain build description
35+
* where assembly files were built by invoking the GNU "as" tool directly.
36+
* @noextend This class is not intended to be subclassed by clients.
37+
* @noinstantiate This class is not intended to be instantiated by clients.
38+
* @since 8.7
39+
*/
40+
public class GnuAsmFlagsCommandGenerator implements IOptionCommandGenerator {
41+
42+
private static final String DO_NOT_LINK_FLAG = "-c"; //$NON-NLS-1$
43+
private static final Pattern DO_NOT_LINK_PATTERN = Pattern.compile("(^|\\s)-c($|\\s)"); //$NON-NLS-1$
44+
private static final Pattern ASM_FLAG_PATTERN = Pattern.compile("(?<=^|\\s)-[aDKLR]\\S*"); //$NON-NLS-1$
45+
46+
@Override
47+
public String generateCommand(IOption option, IVariableSubstitutor macroSubstitutor) {
48+
String toolCommand = getToolCommand(option, macroSubstitutor);
49+
try {
50+
if (null != toolCommand && IOption.STRING == option.getValueType() && option.getCommand().isEmpty()) {
51+
String optionValue = option.getStringValue();
52+
if (toolCommand.equals("gcc")) { //$NON-NLS-1$
53+
// if the default assembler tool command has not been overridden
54+
String command = CdtVariableResolver.resolveToString(optionValue, macroSubstitutor);
55+
if (!DO_NOT_LINK_PATTERN.matcher(command).find()) {
56+
// if the "-c" flag is not already present on the command line we
57+
// assume the flags target the GNU "as" command line rather than the
58+
// "gcc" command line so we add the "-c" flag and apply the "-Wa,"
59+
// prefix to those flags that are intended only for the assembler
60+
return DO_NOT_LINK_FLAG + " " + ASM_FLAG_PATTERN.matcher(command).replaceAll("-Wa,$0"); //$NON-NLS-1$ //$NON-NLS-2$
61+
}
62+
} else if (toolCommand.endsWith("as") && optionValue.equals(DO_NOT_LINK_FLAG)) { //$NON-NLS-1$
63+
// if GNU "as" is called directly and the default assembler flags have
64+
// not been overridden we remove the "-c" flag
65+
return ""; //$NON-NLS-1$
66+
}
67+
}
68+
} catch (BuildException | CdtVariableException e) {
69+
Platform.getLog(getClass()).log(Status.error("Error generating GNU assembler command", e)); //$NON-NLS-1$
70+
}
71+
return null; // fallback to default command generator
72+
}
73+
74+
private static String getToolCommand(IOption option, IVariableSubstitutor macroSubstitutor) {
75+
// the option holder may be a super class of the assembler tool so we must
76+
// locate the tool from the build configuration to obtain the correct tool command
77+
IConfiguration config = getConfiguration(macroSubstitutor);
78+
if (config != null) {
79+
String optionHolderId = option.getOptionHolder().getId();
80+
ITool[] tools = config.getToolsBySuperClassId(optionHolderId);
81+
if (1 == tools.length) {
82+
return tools[0].getToolCommand();
83+
}
84+
}
85+
return null;
86+
}
87+
88+
private static IConfiguration getConfiguration(IVariableSubstitutor macroSubstitutor) {
89+
if (macroSubstitutor instanceof BuildfileMacroSubstitutor bms) { // case ToolSettingsPrefStore
90+
return bms.getConfiguration();
91+
} else if (macroSubstitutor instanceof FileMacroExplicitSubstitutor fmes) { // case BuildStep
92+
return fmes.getConfiguration();
93+
}
94+
return null;
95+
}
96+
97+
}

codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.cdt.codan.checkers;singleton:=true
5-
Bundle-Version: 3.5.400.qualifier
5+
Bundle-Version: 3.5.500.qualifier
66
Bundle-Activator: org.eclipse.cdt.codan.checkers.CodanCheckersActivator
77
Require-Bundle: org.eclipse.core.runtime,
88
org.eclipse.core.resources,

codan/org.eclipse.cdt.codan.checkers/OSGI-INF/l10n/bundle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ problem.name.12 = Field cannot be resolved
116116
problem.description.13 = Name resolution problem found by the indexer
117117
problem.messagePattern.13 = Structured binding initializer expression refers to introduced name ''{0}''
118118
problem.name.13 = Invalid structured binding declaration
119+
problem.description.14 = Name resolution problem found by the indexer
120+
problem.messagePattern.14 = Cannot instantiate template function ''{0}''
121+
problem.name.14 = Function cannot be instantiated
119122
checker.name.AbstractClassCreation = Abstract class cannot be instantiated
120123
problem.name.AbstractClassCreation = Abstract class cannot be instantiated
121124
problem.messagePattern.AbstractClassCreation = The type ''{0}'' must implement the inherited pure virtual method ''{1}''\u0020

codan/org.eclipse.cdt.codan.checkers/plugin.xml

+10
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@
253253
messagePattern="%problem.messagePattern.10"
254254
name="%problem.name.10">
255255
</problem>
256+
<problem
257+
category="org.eclipse.cdt.codan.core.categories.CompilerErrors"
258+
defaultEnabled="true"
259+
defaultSeverity="Error"
260+
description="%problem.description.14"
261+
id="org.eclipse.cdt.codan.internal.checkers.TemplateInstantiationProblem"
262+
markerType="org.eclipse.cdt.codan.core.codanSemanticProblem"
263+
messagePattern="%problem.messagePattern.14"
264+
name="%problem.name.14">
265+
</problem>
256266
<problem
257267
category="org.eclipse.cdt.codan.core.categories.CompilerErrors"
258268
defaultEnabled="true"

codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java

+9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
6666
public static String ERR_ID_VariableResolutionProblem = "org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem"; //$NON-NLS-1$
6767
public static String ERR_ID_Candidates = "org.eclipse.cdt.codan.internal.checkers.Candidates"; //$NON-NLS-1$
6868
public static String ERR_ID_StructuredBindingDeclarationProblem = "org.eclipse.cdt.codan.internal.checkers.StructuredBindingDeclarationProblem"; //$NON-NLS-1$
69+
public static String ERR_ID_TemplateInstantiationProblem = "org.eclipse.cdt.codan.internal.checkers.TemplateInstantiationProblem"; //$NON-NLS-1$
6970

7071
@Override
7172
public boolean runInEditor() {
@@ -175,6 +176,14 @@ public int visit(IASTName name) {
175176
contextFlagsString);
176177
return PROCESS_CONTINUE;
177178
}
179+
if (id == IProblemBinding.SEMANTIC_INVALID_TEMPLATE_INSTANTIATION) {
180+
if (isFunctionCall(name, parentNode)) {
181+
reportProblem(ERR_ID_TemplateInstantiationProblem, name.getLastName(),
182+
getCandidatesString(problemBinding), contextFlagsString);
183+
}
184+
return PROCESS_CONTINUE;
185+
}
186+
178187
// From this point, we'll deal only with NAME_NOT_FOUND problems.
179188
// If it's something else continue because we don't want to give bad messages.
180189
if (id != IProblemBinding.SEMANTIC_NAME_NOT_FOUND) {

0 commit comments

Comments
 (0)