qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "J. Mayer" <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <andreas.faerber@web.de>
Subject: Re: [Qemu-devel] Build failure on OS X
Date: Sun, 30 Sep 2007 15:27:34 +0200	[thread overview]
Message-ID: <1191158854.29900.131.camel@rapid> (raw)
In-Reply-To: <5CD94FD2-E210-4C08-8CBA-11B0EFDC0AA4@web.de>

[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]

On Sun, 2007-09-30 at 15:08 +0200, Andreas Färber wrote:
> Am 30.09.2007 um 14:17 schrieb J. Mayer:
> 
> > On Sun, 2007-09-30 at 14:05 +0200, Andreas Färber wrote:
> >> Hi,
> >>
> >> Am 30.09.2007 um 13:45 schrieb J. Mayer:
> >>
> >>>> Anyone any idea what might've caused this build failure? I'm fairly
> >>>> certain I haven't messed with or updated the system headers.
> >>>
> >>> have you just updated your CVS co ?
> >>
> >> Yes.
> >>
> >>> Please try to comment the "always_inline" definition in vl.h /
> >>> exec-all.h.
> >>> If this is what's breaking your build, I'll revert this definition.
> >>
> >> It is, thanks for the pointer! (The source file itself didn't appear
> >> to have been updated.)
> >>
> >>>> With line 284 of math.h reading:
> >>>> 		static __inline__ int __inline_isfinitef	(float      )
> >>>> __MATH_H_ALWAYS_INLINE__;
> >>>
> >>> The fact the error mentions "__attribute__" and ALWAYS_INLINE  
> >>> make me
> >>> think the always_inline defintion is the suspect here....
> >>
> >> I believe Apple's GCC in general has a problem with the __attribute__
> >> notation. The ppc*-softmmu fail to build for some time due to its use
> >> for aliasing in hw/ppc.c. Maybe we could add a configure check for
> >> this feature to have a conditional define? That would allow a more
> >> elegant fix than the one I use locally and had previously suggested.
> >
> > Sorry for introducing this problem...
> > Would this new definition solve the compilation failure ?
> >
> > #ifndef always_inline
> > #if (__GNUC__ < 3) || defined(__APPLE__)
> > #define always_inline inline
> > #else
> > #define always_inline __attribute__ (( always_inline )) inline
> > #endif
> > #endif
> 
> It does.

OK, then I will commit this fixup, even if it may generate slower code
for interrupt processing (which is already something slow...).

> I've updated my patch accordingly with __APPLE__, what do you think?  
> I have no idea what alias does exactly, should we just use a #define  
> on the Mac?

the alias attribute is used to define a new function name that actually
refer to another existant function, this to avoid code duplication. We
can easily avoid using it using an inline function for the actual
implementation and calling it from different places. Please take a look
at this patch.

Regards.

-- 
J. Mayer <l_indien@magic.fr>
Never organized

[-- Attachment #2: ppc_alias.diff --]
[-- Type: text/x-patch, Size: 1883 bytes --]

Index: hw/ppc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ppc.c,v
retrieving revision 1.27
diff -u -d -d -p -r1.27 ppc.c
--- hw/ppc.c	30 Sep 2007 00:38:37 -0000	1.27
+++ hw/ppc.c	30 Sep 2007 13:26:43 -0000
@@ -445,7 +445,7 @@ uint32_t cpu_ppc_load_tbl (CPUState *env
     return tb & 0xFFFFFFFF;
 }
 
-uint32_t cpu_ppc_load_tbu (CPUState *env)
+static inline uint32_t _cpu_ppc_load_tbu (CPUState *env)
 {
     ppc_tb_t *tb_env = env->tb_env;
     uint64_t tb;
@@ -460,6 +460,11 @@ uint32_t cpu_ppc_load_tbu (CPUState *env
     return tb >> 32;
 }
 
+uint32_t cpu_ppc_load_tbu (CPUState *env)
+{
+    return _cpu_ppc_load_tbu(env);
+}
+
 static inline void cpu_ppc_store_tb (ppc_tb_t *tb_env, int64_t *tb_offsetp,
                                      uint64_t value)
 {
@@ -483,7 +488,7 @@ void cpu_ppc_store_tbl (CPUState *env, u
     cpu_ppc_store_tb(tb_env, &tb_env->tb_offset, tb | (uint64_t)value);
 }
 
-void cpu_ppc_store_tbu (CPUState *env, uint32_t value)
+static inline void _cpu_ppc_store_tbu (CPUState *env, uint32_t value)
 {
     ppc_tb_t *tb_env = env->tb_env;
     uint64_t tb;
@@ -494,6 +499,11 @@ void cpu_ppc_store_tbu (CPUState *env, u
                      ((uint64_t)value << 32) | tb);
 }
 
+void cpu_ppc_store_tbu (CPUState *env, uint32_t value)
+{
+    _cpu_ppc_store_tbu(env, value);
+}
+
 uint32_t cpu_ppc_load_atbl (CPUState *env)
 {
     ppc_tb_t *tb_env = env->tb_env;
@@ -738,10 +748,14 @@ clk_setup_cb cpu_ppc601_rtc_init (CPUSta
 }
 
 void cpu_ppc601_store_rtcu (CPUState *env, uint32_t value)
-__attribute__ (( alias ("cpu_ppc_store_tbu") ));
+{
+    _cpu_ppc_store_tbu(env, value);
+}
 
 uint32_t cpu_ppc601_load_rtcu (CPUState *env)
-__attribute__ (( alias ("cpu_ppc_load_tbu") ));
+{
+    return _cpu_ppc_load_tbu(env);
+}
 
 void cpu_ppc601_store_rtcl (CPUState *env, uint32_t value)
 {

  reply	other threads:[~2007-09-30 13:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-30 10:09 [Qemu-devel] Build failure on OS X Andreas Färber
2007-09-30 11:45 ` J. Mayer
2007-09-30 12:05   ` Andreas Färber
2007-09-30 12:17     ` J. Mayer
2007-09-30 13:08       ` Andreas Färber
2007-09-30 13:27         ` J. Mayer [this message]
2007-09-30 14:28           ` Andreas Färber
2007-09-30 14:37             ` J. Mayer
2007-09-30 15:05               ` Andreas Färber
2007-09-30 15:54                 ` Andreas Färber
2007-10-03 11:12                   ` Andreas Färber
2007-10-01  2:36                 ` J. Mayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191158854.29900.131.camel@rapid \
    --to=l_indien@magic.fr \
    --cc=andreas.faerber@web.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).