Patchwork optionrom: build with discrete CPP and AS steps

login
register
mail settings
Submitter Blue Swirl
Date Jan. 6, 2013, 10:19 a.m.
Message ID <b2f72d9182a138d2bcd68a0db817227ed99bcf59.1357467579.git.blauwirbel@gmail.com>
Download mbox | patch
Permalink /patch/209734/
State New
Headers show

Comments

Blue Swirl - Jan. 6, 2013, 10:19 a.m.
Build option ROM .S files with separate preprocessor and
assembler steps because the C compiler could be unsuitable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 configure |    7 ++++++-
 rules.mak |    7 +++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
Brad - Jan. 9, 2013, 8:52 a.m.
On Sun, Jan 06, 2013 at 10:19:56AM +0000, Blue Swirl wrote:
> Build option ROM .S files with separate preprocessor and
> assembler steps because the C compiler could be unsuitable.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

Can this please be commited?

> ---
>  configure |    7 ++++++-
>  rules.mak |    7 +++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index fe18ed2..8169a00 100755
> --- a/configure
> +++ b/configure
> @@ -264,6 +264,8 @@ else
>  fi
>  
>  ar="${AR-${cross_prefix}ar}"
> +as="${AS-${cross_prefix}as}"
> +cpp="${CPP-$cc -E}"
>  objcopy="${OBJCOPY-${cross_prefix}objcopy}"
>  ld="${LD-${cross_prefix}ld}"
>  libtool="${LIBTOOL-${cross_prefix}libtool}"
> @@ -3726,6 +3728,8 @@ echo "CC_I386=$cc_i386" >> $config_host_mak
>  echo "HOST_CC=$host_cc" >> $config_host_mak
>  echo "OBJCC=$objcc" >> $config_host_mak
>  echo "AR=$ar" >> $config_host_mak
> +echo "AS=$as" >> $config_host_mak
> +echo "CPP=$cpp" >> $config_host_mak
>  echo "OBJCOPY=$objcopy" >> $config_host_mak
>  echo "LD=$ld" >> $config_host_mak
>  echo "WINDRES=$windres" >> $config_host_mak
> @@ -4277,9 +4281,10 @@ for rom in seabios vgabios ; do
>      config_mak=roms/$rom/config.mak
>      echo "# Automatically generated by configure - do not modify" > $config_mak
>      echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
> +    echo "AS=$as" >> $config_mak
>      echo "CC=$cc" >> $config_mak
>      echo "BCC=bcc" >> $config_mak
> -    echo "CPP=${cross_prefix}cpp" >> $config_mak
> +    echo "CPP=$cpp" >> $config_mak
>      echo "OBJCOPY=objcopy" >> $config_mak
>      echo "IASL=iasl" >> $config_mak
>      echo "LD=$ld" >> $config_mak
> diff --git a/rules.mak b/rules.mak
> index 8448b94..fe0c881 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -28,8 +28,11 @@ else
>  	$(call quiet-command,$(LIBTOOL) --mode=compile --quiet --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  lt CC $@")
>  endif
>  
> -%.o: %.S
> -	$(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  AS    $(TARGET_DIR)$@")
> +%.asm: %.S
> +	$(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -o $@ $<,"  CPP   $(TARGET_DIR)$@")
> +
> +%.o: %.asm
> +	$(call quiet-command,$(AS) $(ASFLAGS) -o $@ $<,"  AS    $(TARGET_DIR)$@")
>  
>  %.o: %.m
>  	$(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  OBJC  $(TARGET_DIR)$@")
> -- 
> 1.7.2.5

Patch

diff --git a/configure b/configure
index fe18ed2..8169a00 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,8 @@  else
 fi
 
 ar="${AR-${cross_prefix}ar}"
+as="${AS-${cross_prefix}as}"
+cpp="${CPP-$cc -E}"
 objcopy="${OBJCOPY-${cross_prefix}objcopy}"
 ld="${LD-${cross_prefix}ld}"
 libtool="${LIBTOOL-${cross_prefix}libtool}"
@@ -3726,6 +3728,8 @@  echo "CC_I386=$cc_i386" >> $config_host_mak
 echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
+echo "AS=$as" >> $config_host_mak
+echo "CPP=$cpp" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
 echo "LD=$ld" >> $config_host_mak
 echo "WINDRES=$windres" >> $config_host_mak
@@ -4277,9 +4281,10 @@  for rom in seabios vgabios ; do
     config_mak=roms/$rom/config.mak
     echo "# Automatically generated by configure - do not modify" > $config_mak
     echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
+    echo "AS=$as" >> $config_mak
     echo "CC=$cc" >> $config_mak
     echo "BCC=bcc" >> $config_mak
-    echo "CPP=${cross_prefix}cpp" >> $config_mak
+    echo "CPP=$cpp" >> $config_mak
     echo "OBJCOPY=objcopy" >> $config_mak
     echo "IASL=iasl" >> $config_mak
     echo "LD=$ld" >> $config_mak
diff --git a/rules.mak b/rules.mak
index 8448b94..fe0c881 100644
--- a/rules.mak
+++ b/rules.mak
@@ -28,8 +28,11 @@  else
 	$(call quiet-command,$(LIBTOOL) --mode=compile --quiet --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  lt CC $@")
 endif
 
-%.o: %.S
-	$(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  AS    $(TARGET_DIR)$@")
+%.asm: %.S
+	$(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -o $@ $<,"  CPP   $(TARGET_DIR)$@")
+
+%.o: %.asm
+	$(call quiet-command,$(AS) $(ASFLAGS) -o $@ $<,"  AS    $(TARGET_DIR)$@")
 
 %.o: %.m
 	$(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  OBJC  $(TARGET_DIR)$@")