All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] build: Use $(CC) for compiling .S files
@ 2016-06-18  6:47 Richard Henderson
  2016-06-20 13:43 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2016-06-18  6:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

We fail to pass to AS all of the different flags that
may be required for a given set of CFLAGS.  Rather than
figuring out the host-specific mapping, it's better to
allow the compiler driver to do that.

This fixes e.g. ../configure --cpu=i686, but would also
be required for ppc and sparc.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 rules.mak | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/rules.mak b/rules.mak
index 72c5955..f16598b 100644
--- a/rules.mak
+++ b/rules.mak
@@ -68,11 +68,8 @@ LINK = $(call quiet-command, $(LINKPROG) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o
        $(call process-archive-undefs, $1) \
        $(version-obj-y) $(call extract-libs,$1) $(LIBS),"  LINK  $(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: %.S
+	$(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  AS    $(TARGET_DIR)$@")
 
 %.o: %.cc
 	$(call quiet-command,$(CXX) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<,"  CXX   $(TARGET_DIR)$@")
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] build: Use $(CC) for compiling .S files
  2016-06-18  6:47 [Qemu-devel] [PATCH] build: Use $(CC) for compiling .S files Richard Henderson
@ 2016-06-20 13:43 ` Peter Maydell
  2016-06-20 14:52   ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2016-06-20 13:43 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 18 June 2016 at 07:47, Richard Henderson <rth@twiddle.net> wrote:
> We fail to pass to AS all of the different flags that
> may be required for a given set of CFLAGS.  Rather than
> figuring out the host-specific mapping, it's better to
> allow the compiler driver to do that.
>
> This fixes e.g. ../configure --cpu=i686, but would also
> be required for ppc and sparc.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>

This is basically reverting commit 3dd46c78525a30e98c68 from
2013, which explicitly switched to using separate CPP and
AS steps "because the C compiler could be unsuitable", by
which I think it means the failure described here:
https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg00558.html
where if the compiler is clang it might not be able to
handle some of the code we use in the optionrom assembly
even though 'as' can.

Does that no longer apply ?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] build: Use $(CC) for compiling .S files
  2016-06-20 13:43 ` Peter Maydell
@ 2016-06-20 14:52   ` Richard Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2016-06-20 14:52 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 06/20/2016 06:43 AM, Peter Maydell wrote:
> On 18 June 2016 at 07:47, Richard Henderson <rth@twiddle.net> wrote:
>> We fail to pass to AS all of the different flags that
>> may be required for a given set of CFLAGS.  Rather than
>> figuring out the host-specific mapping, it's better to
>> allow the compiler driver to do that.
>>
>> This fixes e.g. ../configure --cpu=i686, but would also
>> be required for ppc and sparc.
>>
>> Signed-off-by: Richard Henderson <rth@twiddle.net>
>
> This is basically reverting commit 3dd46c78525a30e98c68 from
> 2013, which explicitly switched to using separate CPP and
> AS steps "because the C compiler could be unsuitable", by
> which I think it means the failure described here:
> https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg00558.html
> where if the compiler is clang it might not be able to
> handle some of the code we use in the optionrom assembly
> even though 'as' can.
>
> Does that no longer apply ?

Ah, well, no.

But that report is for building ROMs, where AS plus all of the options are 
easily controllable.  Whereas this current problem is where we are linking 
assembly (safe-syscall.S) into the qemu executable.

These are two completely different usages, and ought to be treated as such.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-20 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-18  6:47 [Qemu-devel] [PATCH] build: Use $(CC) for compiling .S files Richard Henderson
2016-06-20 13:43 ` Peter Maydell
2016-06-20 14:52   ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.