diff mbox series

[4/5] xen: build: add support for CFLAGS_REMOVE variable

Message ID 20241129014850.2852844-5-volodymyr_babchuk@epam.com (mailing list archive)
State New
Headers show
Series aarch64, common: improve clang and llvm support | expand

Commit Message

Volodymyr Babchuk Nov. 29, 2024, 1:49 a.m. UTC
This variable can be used in cases when we need to remove certain
CFLAGS for particular object file. One such case is
-mgeneral-regs-only flags that should be omitted when we are building
an object file that uses not only general registers.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich Nov. 29, 2024, 8:10 a.m. UTC | #1
On 29.11.2024 02:49, Volodymyr Babchuk wrote:
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -179,7 +179,7 @@ cpp_flags = $(filter-out -Wa$(comma)% -flto,$(1))
>  # Calculation of flags, first the generic flags, then the arch specific flags,
>  # and last the flags modified for a target or a directory.
>  
> -c_flags = -MMD -MP -MF $(depfile) $(XEN_CFLAGS)
> +c_flags = -MMD -MP -MF $(depfile) $(filter-out $(CFLAGS_REMOVE),$(XEN_CFLAGS))

This looks rather fragile to me. Plus see the comment on the next patch,
where this is actually used.

Jan
diff mbox series

Patch

diff --git a/xen/Rules.mk b/xen/Rules.mk
index d759cccee3..478318537f 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -179,7 +179,7 @@  cpp_flags = $(filter-out -Wa$(comma)% -flto,$(1))
 # Calculation of flags, first the generic flags, then the arch specific flags,
 # and last the flags modified for a target or a directory.
 
-c_flags = -MMD -MP -MF $(depfile) $(XEN_CFLAGS)
+c_flags = -MMD -MP -MF $(depfile) $(filter-out $(CFLAGS_REMOVE),$(XEN_CFLAGS))
 a_flags = -MMD -MP -MF $(depfile) $(XEN_AFLAGS)
 
 include $(srctree)/arch/$(SRCARCH)/Rules.mk