mk: pass EXTRA_CFLAGS to AUTO_CPUFLAGS to enable local modifications
PATCH v2 1/1 mk: pass EXTRA_CFLAGS to AUTO_CPUFLAGS to enable local modifications
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
The patch passes EXTRA_CFLAGS to the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.
---
ChangeLog:
v2:
* Put EXTRA_CFLAGS after MACHINE_CFLAGS to enable overriding values
mk/rte.cpuflags.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.cpuflags.mk +1 -1
@@ -33,7 +33,7 @@ # used to set the RTE_CPUFLAG_* environment variables giving details # of what instruction sets the target cpu supports. -AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) -dM -E - < /dev/null) +AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) # adding flags to CPUFLAGS
Signature · 1 line
1.9.1
Hi Olivier!
Does this commit look OK now with the changes you proposed?
Thanks,
// Simon
Quoted 33 lines · Simon Kagstrom
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
The patch passes
EXTRA_CFLAGSto the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.Signed-off-by Simon Kagstrom <[email protected]>---
ChangeLog:v2:
* PutEXTRA_CFLAGSafterMACHINE_CFLAGSto enable overriding valuesmk/rte.cpuflags.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mk/rte.cpuflags.mk +1
-1@@ -33,7 +33,7 @@ # used to set the RTE_CPUFLAG_* environment variables giving details # of what instruction sets the target cpu supports. -AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) -dM -E - < /dev/null) +AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) # adding flags to CPUFLAGS
Olivier MATZ
Acked-byHi Simon,
Quoted 35 lines · Simon Kågström
Hi Olivier!
Does this commit look OK now with the changes you proposed?
Thanks,
// SimonQuoted 27 lines · Simon Kagstrom
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
The patch passes
EXTRA_CFLAGSto the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.Signed-off-by Simon Kagstrom <[email protected]>---
ChangeLog:v2:
* PutEXTRA_CFLAGSafterMACHINE_CFLAGSto enable overriding valuesmk/rte.cpuflags.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mk/rte.cpuflags.mk +0
-0@@ -33,7 +33,7 @@ # used to set the RTE_CPUFLAG_* environment variables giving details # of what instruction sets the target cpu supports.
Quoted 6 lines
mk/rte.cpuflags.mk line 39
Quoted 6 lines
mk/rte.cpuflags.mk +1
-1-AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) -dM -E - < /dev/null) +AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) # adding flags to CPUFLAGS
Thomas Monjalon
AppliedQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
The patch passes
EXTRA_CFLAGSto the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.Signed-off-by Simon Kagstrom <[email protected]>Acked-by Olivier Matz <[email protected]>
Applied, thanks
Quoted 9 lines · Thomas Monjalon
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
The patch passes
EXTRA_CFLAGSto the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Simon Kagstrom <[email protected]>Acked-by Olivier Matz <[email protected]>Applied, thanks
This causes some complications on Fedora/RHEL due to fairly complex interactions with -Werror, -Wall and -Wformat-security mixup between upstream- and distro default compiler flags.
More specifically, when EXTRA_CFLAGS contains warning flag manipulation this patch can cause mismatch between other options that are okay elsewhere in dpdk make. A simple fix is to pass WERROR_FLAGS to AUTO_CPUFLAGS too to counter this, ie
mk/rte.cpuflags.mk +1 -1
@@ -33,7 +33,7 @@ # used to set the RTE_CPUFLAG_* environment variables giving details # of what instruction sets the target cpu supports. -AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) +AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(WERROR_FLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) # adding flags to CPUFLAGS
I can send an official patch if this seems acceptable.
- Panu -
Quoted 20 lines · Panu Matilainen
Quoted 8 lines · Thomas Monjalon
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
The patch passes
EXTRA_CFLAGSto the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.More specifically, when
EXTRA_CFLAGScontains warning flag manipulation this patch can cause mismatch between other options that are okay elsewhere in dpdk make. A simple fix is to passWERROR_FLAGStoAUTO_CPUFLAGStoo to counter this, iemk/rte.cpuflags.mk +0
-0
mk/rte.cpuflags.mk line 37
Quoted 7 lines
mk/rte.cpuflags.mk +1
-2@@ -33,7 +33,7 @@ # used to set the RTE_CPUFLAG_* environment variables giving details # of what instruction sets the target cpu supports. -AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) +AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(WERROR_FLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null)
Looks fine to me at least.
// Simon
2015-12-07 10:33, Panu Matilainen:
Quoted 42 lines · Thomas Monjalon
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
We have encountered a CPU where the AES-NI instruction set is disabled due to export restrictions. Since the build machine and target machine is different, using -native configs doesn't work, and on this CPU, the application refuses to run due to the AES CPU flags being amiss.
The patch passes
EXTRA_CFLAGSto the figure-out-cpu-flags helper, which allows us to add -mno-aes to the compile flags and resolve this problem.Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Simon Kagstrom <[email protected]>Acked-by Olivier Matz <[email protected]>Applied, thanks
This causes some complications on Fedora/RHEL due to fairly complex interactions with -Werror, -Wall and -Wformat-security mixup between upstream- and distro default compiler flags.
More specifically, when
EXTRA_CFLAGScontains warning flag manipulation this patch can cause mismatch between other options that are okay elsewhere in dpdk make. A simple fix is to passWERROR_FLAGStoAUTO_CPUFLAGStoo to counter this, iemk/rte.cpuflags.mk +1
-2@@ -33,7 +33,7 @@ # used to set the RTE_CPUFLAG_* environment variables giving details # of what instruction sets the target cpu supports. -AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) +AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(WERROR_FLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) # adding flags to CPUFLAGS
Quoted 1 line
I can send an official patch if this seems acceptable.
Yes this is acceptable.
Please explain the error you see in the commit message.