Skip to content

Commit

Permalink
Merge branch 'main' into Bug_579242
Browse files Browse the repository at this point in the history
  • Loading branch information
betamaxbandit authored Feb 5, 2024
2 parents ec2f40e + 2e38e74 commit 3be0303
Show file tree
Hide file tree
Showing 40 changed files with 568 additions and 41 deletions.
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ pipeline {
timeout(activity: true, time: 20) {
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=50.0 -XX:+PrintFlagsFinal']) {
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
// XXX: Issue 684 means that dsf-gdb tests are skipped
sh '''/jipp/tools/apache-maven/latest/bin/mvn \
clean verify -B -V \
-Ddsf-gdb.skip.tests=true \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dmaven.test.failure.ignore=true \
-DexcludedGroups=flakyTest,slowTest \
Expand Down
29 changes: 27 additions & 2 deletions NewAndNoteworthy/CDT-11.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,33 @@ This is the New & Noteworthy page for CDT 11.5 which is part of Eclipse 2024-03

# Release Notes

# CMake
# Build

## Preprocessor activation for GNU assembly language files

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:

<p align="center"><img src="images/CDT-11.5-gnu-as-command.png" width="80%"></p>

The new behaviour applies to managed build configurations using a _Cross GCC_, _Cygwin GCC_, _Linux GCC_ or _MinGW GCC_ toolchain.

## COFF symbol presentation

A complete set of external symbols is now presented under COFF binary object files within the _Project Explorer_ view:

<p align="center"><img src="images/CDT-11.5-coff-object.png" width="25%"></p>

The revised presentation matches that observed for ELF binary object files.

## GNU archive content presentation

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:

<p align="center"><img src="images/CDT-11.5-archive-content.png" width="25%"></p>

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.

## CMake
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.

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

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


# API Changes, current and planned

## Breaking API changes
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added NewAndNoteworthy/images/CDT-11.5-coff-object.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core.tests; singleton:=true
Bundle-Version: 8.2.300.qualifier
Bundle-Version: 8.2.400.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.testplugin.CTestPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ASM_SRCS :=
C_SRCS :=
OBJ_SRCS :=
O_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
C_DEPS :=
EXECUTABLES :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ASM_SRCS :=
C_SRCS :=
OBJ_SRCS :=
O_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
C_DEPS :=
EXECUTABLES :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ASM_SRCS :=
C_SRCS :=
OBJ_SRCS :=
O_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
C_DEPS :=
EXECUTABLES :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CXXM_SRCS :=
CXX_SRCS :=
C_UPPER_SRCS :=
LOG_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
TAR_SRCS :=
LOGFILE :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ASM_SRCS :=
C_SRCS :=
OBJ_SRCS :=
O_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
C_DEPS :=
EXECUTABLES :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ C_SRCS :=
C_UPPER_SRCS :=
OBJ_SRCS :=
O_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
C++M_DEPS :=
C++_DEPS :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ C_SRCS :=
C_UPPER_SRCS :=
OBJ_SRCS :=
O_SRCS :=
SX_SRCS :=
S_UPPER_SRCS :=
C++M_DEPS :=
C++_DEPS :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
Bundle-Version: 9.6.200.qualifier
Bundle-Version: 9.6.300.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2010 Intel Corporation and others.
* Copyright (c) 2006, 2024 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,6 +10,7 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
* John Dallaway - Provide getter for IConfiguration (#666)
*******************************************************************************/

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

public IConfiguration getConfiguration() {
return fCfg;
}

/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#resolveMacro(org.eclipse.cdt.managedbuilder.macros.IBuildMacro)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.gnu.ui; singleton:=true
Bundle-Version: 8.6.100.qualifier
Bundle-Version: 8.7.0.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.gnu.ui.GnuUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
6 changes: 4 additions & 2 deletions build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
id="gnu.windres.option.preprocessor.undefined.symbols"/>
</tool-->
<tool
command="as"
command="gcc"
name="%ToolName.assembler.gnu"
outputFlag="-o"
id="cdt.managedbuild.tool.gnu.assembler"
Expand All @@ -579,6 +579,8 @@
<option
name="%Option.Gnu.Assembler.Flags"
category="gnu.asm.category.general"
commandGenerator="org.eclipse.cdt.managedbuilder.gnu.ui.GnuAsmFlagsCommandGenerator"
defaultValue="-c"
valueType="string"
id="gnu.both.asm.option.flags">
</option>
Expand Down Expand Up @@ -607,7 +609,7 @@
id="cdt.managedbuild.tool.gnu.assembler.input"
languageId="org.eclipse.cdt.core.assembly"
sourceContentType="org.eclipse.cdt.core.asmSource"
sources="s,S">
sources="s,sx,S">
</inputType>
<outputType
outputs="o"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*******************************************************************************
* Copyright (c) 2024 John Dallaway and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* John Dallaway - initial implementation (#666)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.gnu.ui;

import java.util.regex.Pattern;

import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionCommandGenerator;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.FileMacroExplicitSubstitutor;
import org.eclipse.cdt.managedbuilder.internal.macros.BuildfileMacroSubstitutor;
import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;

/**
* Assembler flags command generator.
* This command generator supports managed build projects that were
* created using older versions of the GNU toolchain build description
* where assembly files were built by invoking the GNU "as" tool directly.
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
* @since 8.7
*/
public class GnuAsmFlagsCommandGenerator implements IOptionCommandGenerator {

private static final String DO_NOT_LINK_FLAG = "-c"; //$NON-NLS-1$
private static final Pattern DO_NOT_LINK_PATTERN = Pattern.compile("(^|\\s)-c($|\\s)"); //$NON-NLS-1$
private static final Pattern ASM_FLAG_PATTERN = Pattern.compile("(?<=^|\\s)-[aDKLR]\\S*"); //$NON-NLS-1$

@Override
public String generateCommand(IOption option, IVariableSubstitutor macroSubstitutor) {
String toolCommand = getToolCommand(option, macroSubstitutor);
try {
if (null != toolCommand && IOption.STRING == option.getValueType() && option.getCommand().isEmpty()) {
String optionValue = option.getStringValue();
if (toolCommand.equals("gcc")) { //$NON-NLS-1$
// if the default assembler tool command has not been overridden
String command = CdtVariableResolver.resolveToString(optionValue, macroSubstitutor);
if (!DO_NOT_LINK_PATTERN.matcher(command).find()) {
// if the "-c" flag is not already present on the command line we
// assume the flags target the GNU "as" command line rather than the
// "gcc" command line so we add the "-c" flag and apply the "-Wa,"
// prefix to those flags that are intended only for the assembler
return DO_NOT_LINK_FLAG + " " + ASM_FLAG_PATTERN.matcher(command).replaceAll("-Wa,$0"); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if (toolCommand.endsWith("as") && optionValue.equals(DO_NOT_LINK_FLAG)) { //$NON-NLS-1$
// if GNU "as" is called directly and the default assembler flags have
// not been overridden we remove the "-c" flag
return ""; //$NON-NLS-1$
}
}
} catch (BuildException | CdtVariableException e) {
Platform.getLog(getClass()).log(Status.error("Error generating GNU assembler command", e)); //$NON-NLS-1$
}
return null; // fallback to default command generator
}

private static String getToolCommand(IOption option, IVariableSubstitutor macroSubstitutor) {
// the option holder may be a super class of the assembler tool so we must
// locate the tool from the build configuration to obtain the correct tool command
IConfiguration config = getConfiguration(macroSubstitutor);
if (config != null) {
String optionHolderId = option.getOptionHolder().getId();
ITool[] tools = config.getToolsBySuperClassId(optionHolderId);
if (1 == tools.length) {
return tools[0].getToolCommand();
}
}
return null;
}

private static IConfiguration getConfiguration(IVariableSubstitutor macroSubstitutor) {
if (macroSubstitutor instanceof BuildfileMacroSubstitutor bms) { // case ToolSettingsPrefStore
return bms.getConfiguration();
} else if (macroSubstitutor instanceof FileMacroExplicitSubstitutor fmes) { // case BuildStep
return fmes.getConfiguration();
}
return null;
}

}
2 changes: 1 addition & 1 deletion codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.codan.checkers;singleton:=true
Bundle-Version: 3.5.400.qualifier
Bundle-Version: 3.5.500.qualifier
Bundle-Activator: org.eclipse.cdt.codan.checkers.CodanCheckersActivator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ problem.name.12 = Field cannot be resolved
problem.description.13 = Name resolution problem found by the indexer
problem.messagePattern.13 = Structured binding initializer expression refers to introduced name ''{0}''
problem.name.13 = Invalid structured binding declaration
problem.description.14 = Name resolution problem found by the indexer
problem.messagePattern.14 = Cannot instantiate template function ''{0}''
problem.name.14 = Function cannot be instantiated
checker.name.AbstractClassCreation = Abstract class cannot be instantiated
problem.name.AbstractClassCreation = Abstract class cannot be instantiated
problem.messagePattern.AbstractClassCreation = The type ''{0}'' must implement the inherited pure virtual method ''{1}''\u0020
Expand Down
10 changes: 10 additions & 0 deletions codan/org.eclipse.cdt.codan.checkers/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@
messagePattern="%problem.messagePattern.10"
name="%problem.name.10">
</problem>
<problem
category="org.eclipse.cdt.codan.core.categories.CompilerErrors"
defaultEnabled="true"
defaultSeverity="Error"
description="%problem.description.14"
id="org.eclipse.cdt.codan.internal.checkers.TemplateInstantiationProblem"
markerType="org.eclipse.cdt.codan.core.codanSemanticProblem"
messagePattern="%problem.messagePattern.14"
name="%problem.name.14">
</problem>
<problem
category="org.eclipse.cdt.codan.core.categories.CompilerErrors"
defaultEnabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
public static String ERR_ID_VariableResolutionProblem = "org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem"; //$NON-NLS-1$
public static String ERR_ID_Candidates = "org.eclipse.cdt.codan.internal.checkers.Candidates"; //$NON-NLS-1$
public static String ERR_ID_StructuredBindingDeclarationProblem = "org.eclipse.cdt.codan.internal.checkers.StructuredBindingDeclarationProblem"; //$NON-NLS-1$
public static String ERR_ID_TemplateInstantiationProblem = "org.eclipse.cdt.codan.internal.checkers.TemplateInstantiationProblem"; //$NON-NLS-1$

@Override
public boolean runInEditor() {
Expand Down Expand Up @@ -175,6 +176,14 @@ public int visit(IASTName name) {
contextFlagsString);
return PROCESS_CONTINUE;
}
if (id == IProblemBinding.SEMANTIC_INVALID_TEMPLATE_INSTANTIATION) {
if (isFunctionCall(name, parentNode)) {
reportProblem(ERR_ID_TemplateInstantiationProblem, name.getLastName(),
getCandidatesString(problemBinding), contextFlagsString);
}
return PROCESS_CONTINUE;
}

// From this point, we'll deal only with NAME_NOT_FOUND problems.
// If it's something else continue because we don't want to give bad messages.
if (id != IProblemBinding.SEMANTIC_NAME_NOT_FOUND) {
Expand Down
Loading

0 comments on commit 3be0303

Please sign in to comment.