Vinson Lee <v...@vmware.com> writes:
> Leopard uses gcc-4.0, which didn't have built-in support for atomic
> variables.
u_atomic.h should probably check for a supported compiler; Jeremy, does
the attached patch produce an understandable error instead of a link
error?
In terms of a solution, Jeremy, you could implement PPC assembly for
the few primitives available there. Looks easy for someone who knows
PPC well. There's a comment in that file that mentions a mutex-based
implementation... but then I don't see one.
Looks like there's some dri radeon code which is using the gcc
primitives directly instead of through the gallium wrapper. I'm not
familiar enough w/ it to know if that's correct or not (.. anyway,
you're probably not building dri/radeon on OS X, right?).
-tom
> ________________________________________
> From: Jeremy Huddleston [jerem...@freedesktop.org]
> Sent: Saturday, April 03, 2010 11:22 AM
> To: mesa3d-...@lists.sf.net
> Subject: [Mesa3d-dev] gallium failing to build on darwin/ppc
>
> Is there any known reason why gallium would fail to build on darwin/ppc? I h
> aven't looked into it myself since I figured there might be an easy answer al
> ready
>
> http://trac.macports.org/ticket/24345
diff --git a/src/gallium/auxiliary/util/u_atomic.h b/src/gallium/auxiliary/util/u_atomic.h
index 3c42477..0dedaa3 100644
--- a/src/gallium/auxiliary/util/u_atomic.h
+++ b/src/gallium/auxiliary/util/u_atomic.h
@@ -89,6 +89,10 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
*/
#if defined(PIPE_ATOMIC_GCC_INTRINSIC)
+#if defined(__GNUC__) && !((__GNUC__ >= 4) && (__GNUC_MINOR__ >= 1))
+# error "gcc atomics not available! Bailing to prevent confusing link error."
+#endif
+
#define PIPE_ATOMIC "GCC Sync Intrinsics"
#ifdef __cplusplus
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev