Message ID | 20240909110329.84512-2-frediano.ziglio@cloud.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [v3,1/2] x86/boot: Optimise 32 bit C source code | expand |
On 09.09.2024 13:03, Frediano Ziglio wrote: > --- a/xen/arch/x86/boot/Makefile > +++ b/xen/arch/x86/boot/Makefile > @@ -15,7 +15,7 @@ CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS)) > $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS)) > CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3 > CFLAGS_x86_32 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS)) > -CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) > +CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__ Any reason not to similarly make this -D% as a filter expression? Jan
On Mon, Sep 9, 2024 at 12:21 PM Jan Beulich <jbeulich@suse.com> wrote: > On 09.09.2024 13:03, Frediano Ziglio wrote: > > --- a/xen/arch/x86/boot/Makefile > > +++ b/xen/arch/x86/boot/Makefile > > @@ -15,7 +15,7 @@ CFLAGS_x86_32 := $(subst -m64,-m32 > -march=i686,$(XEN_TREEWIDE_CFLAGS)) > > $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS)) > > CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3 > > CFLAGS_x86_32 += -nostdinc -include $(filter > %/include/xen/config.h,$(XEN_CFLAGS)) > > -CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) > > +CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__ > > Any reason not to similarly make this -D% as a filter expression? > > Jan > I saw that a lot of defines are about processor support which do not make sense for 32 bit. Do you want me to add a comment in the commit? Frediano
On 09.09.2024 14:04, Frediano Ziglio wrote: > On Mon, Sep 9, 2024 at 12:21 PM Jan Beulich <jbeulich@suse.com> wrote: > >> On 09.09.2024 13:03, Frediano Ziglio wrote: >>> --- a/xen/arch/x86/boot/Makefile >>> +++ b/xen/arch/x86/boot/Makefile >>> @@ -15,7 +15,7 @@ CFLAGS_x86_32 := $(subst -m64,-m32 >> -march=i686,$(XEN_TREEWIDE_CFLAGS)) >>> $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS)) >>> CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3 >>> CFLAGS_x86_32 += -nostdinc -include $(filter >> %/include/xen/config.h,$(XEN_CFLAGS)) >>> -CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) >>> +CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__ >> >> Any reason not to similarly make this -D% as a filter expression? > > I saw that a lot of defines are about processor support which do not make > sense for 32 bit. > > Do you want me to add a comment in the commit? Since we're being deliberately selective then - yes, please. Jan
diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index dfe3cb7034..ff0f965876 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -15,7 +15,7 @@ CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS)) $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS)) CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3 CFLAGS_x86_32 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS)) -CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) +CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__ # override for 32bit binaries $(head-bin-objs): CFLAGS_stack_boundary :=
We are compiling Xen source code so we should define __XEN__ macro. Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com> --- xen/arch/x86/boot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)