diff mbox series

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

Message ID 20220517092616.1272238-2-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series Cross compilation of embedded firmware | expand

Commit Message

Paolo Bonzini May 17, 2022, 9:26 a.m. UTC
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(-)

Comments

Richard Henderson May 17, 2022, 6:07 p.m. UTC | #1
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~
Paolo Bonzini May 17, 2022, 6:47 p.m. UTC | #2
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
diff mbox series

Patch

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","$@")