[PATCH 01/16] configure: do not define or use the CPP variable

Paolo Bonzini posted 16 patches 3 years, 8 months ago
[PATCH 01/16] configure: do not define or use the CPP variable
Posted by Paolo Bonzini 3 years, 8 months ago
Just hardcode $(CC) -E, it should be enough.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                  | 3 ---
 pc-bios/optionrom/Makefile | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/configure b/configure
index 0cc8c876f7..4c8954feea 100755
--- a/configure
+++ b/configure
@@ -378,7 +378,6 @@ fi
 ar="${AR-${cross_prefix}ar}"
 as="${AS-${cross_prefix}as}"
 ccas="${CCAS-$cc}"
-cpp="${CPP-$cc -E}"
 objcopy="${OBJCOPY-${cross_prefix}objcopy}"
 ld="${LD-${cross_prefix}ld}"
 ranlib="${RANLIB-${cross_prefix}ranlib}"
@@ -2030,7 +2029,6 @@ echo "CC=$cc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
 echo "AS=$as" >> $config_host_mak
 echo "CCAS=$ccas" >> $config_host_mak
-echo "CPP=$cpp" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
 echo "LD=$ld" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
@@ -2273,7 +2271,6 @@ preserve_env() {
 preserve_env AR
 preserve_env AS
 preserve_env CC
-preserve_env CPP
 preserve_env CFLAGS
 preserve_env CXX
 preserve_env CXXFLAGS
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 2494ad9c25..17ccc76241 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -50,7 +50,7 @@ override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds
 pvh.img: pvh.o pvh_main.o
 
 %.o: %.S
-	$(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@")
+	$(call quiet-command,$(CC) $(CPPFLAGS) -E -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@")
 
 %.o: %.c
 	$(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@")
-- 
2.36.0
Re: [PATCH 01/16] configure: do not define or use the CPP variable
Posted by Richard Henderson 3 years, 8 months ago
On 5/17/22 02:26, Paolo Bonzini wrote:
> Just hardcode $(CC) -E, it should be enough.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   configure                  | 3 ---
>   pc-bios/optionrom/Makefile | 2 +-
>   2 files changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

>   %.o: %.S
> -	$(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@")
> +	$(call quiet-command,$(CC) $(CPPFLAGS) -E -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@")

Although I'm surprised we need to do this pipe thing. Surely just rely on the 
assembler-with-cpp rule built into the compiler driver.  Are we using a custom AS in this 
case?


r~
Re: [PATCH 01/16] configure: do not define or use the CPP variable
Posted by Paolo Bonzini 3 years, 8 months ago
On 5/17/22 20:07, Richard Henderson wrote:
> Although I'm surprised we need to do this pipe thing. Surely just rely 
> on the assembler-with-cpp rule built into the compiler driver.  Are we 
> using a custom AS in this case?

No, I don't think so.  I'm also surprised, but decided to change as 
little as possible.

Paolo