Skip to contentSkip to conversation

toolchain-external wrapper: don't pass march/mcpu if mtune is on cmdline

PATCH New Thomas De Schampheleire 3 participants 3 messages Jul 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 toolchain-external wrapper: don't pass march/mcpu if mtune is on cmdline

From: Thomas De Schampheleire <[email protected]>

Before commit 5715d2dcf48a39c16a3f3e41c97109613fed121d, the external toolchain wrapper would not pass its own march/mcpu/mtune flags to the real compiler if at least one of them was passed on the wrapper command-line.

The mentioned commit intended to remove the passing of an mtune parameter coming from Buildroot, which was always empty after some other refactoring, but the changes have the side-effect that march/mcpu is now also passed when mtune is already given on the command-line. In that case, only mtune should be passed to the real compiler.

Restore part of the original toolchain wrapper code to check the presence of mtune on the command-line.

---
v2: do not unnecessarily increase EXCLUSIVE_ARGS (Yann)

 toolchain/toolchain-external/ext-toolchain-wrapper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
toolchain/toolchain-external/ext-toolchain-wrapper.c +3 -2
index e2d01dc..b3b02d8 100644
@@ -177,11 +177,12 @@ int main(int argc, char **argv)
 
 #if defined(BR_ARCH) || \
     defined(BR_CPU)
-	/* Add our -march/cpu/abi flags, but only if none are
-	 * already specified on the commandline
+	/* Add our -march/cpu flags, but only if none of
+	 * -march/mtune/mcpu are already specified on the commandline
 	 */
 	for (i = 1; i < argc; i++) {
 		if (!strncmp(argv[i], "-march=", strlen("-march=")) ||
+		    !strncmp(argv[i], "-mtune=", strlen("-mtune=")) ||
 		    !strncmp(argv[i], "-mcpu=",  strlen("-mcpu=" )))
 			break;
 	}
Signature · 1 line
1.8.5.1
#1 lore raw

PATCH v2 1/1 toolchain-external wrapper: don't pass march/mcpu if mtune is on cmdline

Thomas, All,

On 2015-07-26 12:53 +0200, Thomas De Schampheleire spake thusly:

Quoted 12 lines

From: Thomas De Schampheleire <[email protected]>

Before commit 5715d2dcf48a39c16a3f3e41c97109613fed121d, the external toolchain wrapper would not pass its own march/mcpu/mtune flags to the real compiler if at least one of them was passed on the wrapper command-line.

The mentioned commit intended to remove the passing of an mtune parameter coming from Buildroot, which was always empty after some other refactoring, but the changes have the side-effect that march/mcpu is now also passed when mtune is already given on the command-line. In that case, only mtune should be passed to the real compiler.

Quoted 4 lines

Restore part of the original toolchain wrapper code to check the presence of mtune on the command-line.

Regards,
Yann E. MORIN.

Quoted 29 lines

---
v2: do not unnecessarily increase EXCLUSIVE_ARGS (Yann)

 toolchain/toolchain-external/ext-toolchain-wrapper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
toolchain/toolchain-external/ext-toolchain-wrapper.c +3 -2
index e2d01dc..b3b02d8 100644
@@ -177,11 +177,12 @@ int main(int argc, char **argv)
 
 #if defined(BR_ARCH) || \
     defined(BR_CPU)
-	/* Add our -march/cpu/abi flags, but only if none are
-	 * already specified on the commandline
+	/* Add our -march/cpu flags, but only if none of
+	 * -march/mtune/mcpu are already specified on the commandline
 	 */
 	for (i = 1; i < argc; i++) {
 		if (!strncmp(argv[i], "-march=", strlen("-march=")) ||
+		    !strncmp(argv[i], "-mtune=", strlen("-mtune=")) ||
 		    !strncmp(argv[i], "-mcpu=",  strlen("-mcpu=" )))
 			break;
 	}
Signature · 1 line
1.8.5.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v2 1/1 toolchain-external wrapper: don't pass march/mcpu if mtune is on cmdline

In reply to Thomas De Schampheleire

Dear Thomas De Schampheleire,

Quoted 12 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

Before commit 5715d2dcf48a39c16a3f3e41c97109613fed121d, the external toolchain wrapper would not pass its own march/mcpu/mtune flags to the real compiler if at least one of them was passed on the wrapper command-line.

The mentioned commit intended to remove the passing of an mtune parameter coming from Buildroot, which was always empty after some other refactoring, but the changes have the side-effect that march/mcpu is now also passed when mtune is already given on the command-line. In that case, only mtune should be passed to the real compiler.

Quoted 6 lines

Restore part of the original toolchain wrapper code to check the presence of mtune on the command-line.

---
v2: do not unnecessarily increase EXCLUSIVE_ARGS (Yann)

Applied, thanks. I'm wondering if there will be any nasty side effect of this, but oh well, let's see what happens :-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com