Skip to content

Commit dd54358

Browse files
committed
Enhance legacy GNU assembler flag detection
1 parent 233c6d8 commit dd54358

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

NewAndNoteworthy/CDT-11.5.md

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

77
# Release Notes
88

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.
918

1019
# API Changes, current and planned
1120

Loading

build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GnuAsmFlagsCommandGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class GnuAsmFlagsCommandGenerator implements IOptionCommandGenerator {
4141

4242
private static final String DO_NOT_LINK_FLAG = "-c"; //$NON-NLS-1$
4343
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("-[aDKLR]\\S*"); //$NON-NLS-1$
44+
private static final Pattern ASM_FLAG_PATTERN = Pattern.compile("(?<=^|\\s)-[aDKLR]\\S*"); //$NON-NLS-1$
4545

4646
@Override
4747
public String generateCommand(IOption option, IVariableSubstitutor macroSubstitutor) {

0 commit comments

Comments
 (0)