On 28/06/2010 16:14, Jon TURNEY wrote:
On 28/06/2010 15:53, Colin Harrison wrote:
Hi,

Tiago Vignattiw wrote
all right, I do agree. So if WIN32 macro means Xming only then I'd
give my
review for your patch:

I don't quite understand why you are asking that question. This problem could appear on all platforms which don't satisfy the condition to define 'weak' in stubs.h, so I've used the inverse of that condition in my patch, attached.

No that covers all Microsoft Windows builds...but lets hear what the
Cygwin/X people say.

That is not correct. WIN32 is not defined under cygwin

(This is somewhat counter-intuitive since the Win32 API is available,
but see
http://cygwin.com/faq/faq-nochunks.html#faq.programming.preprocessor for
reasoning why)

Their tinderbox build is busted (and Xming) without this. See also
http://lists.x.org/archives/xorg-devel/2010-June/010538.html
So my patch strays a little out of my comfort zone :)

So that patch as it stands is fine with me :-)

I can't just change it to check defined(__MINGW__) ||
defined(__CYGWIN__), as that prevents xfs (and possibly other users of
libXfont) from building on cygwin. I'll look into this some more and try
to propose a solution :-)

On reflection, it seems there are no users of libXfont apart from xserver that we care about on cygwin, so we might as well fix it like that
>From d72230b2664e1f1320a7df291a9423f924f2b666 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <[email protected]>
Date: Mon, 28 Jun 2010 17:56:07 +0100
Subject: [PATCH] Fix for platforms which don't have weak linkage

Since we fix this by removing the serverGeneration symbol, assuming
an external definition will be provided, this means on Windows libXfont
can only be built as a static library (since PE shared libraries cannot
contain undefined symbols).  This produces a libXfont which might only
be useful to the xserver, but the only other user we might care about
is xfs, which is obsolete...

Signed-off-by: Jon TURNEY <[email protected]>
---
 src/stubs/stubs.h   |    1 +
 src/util/miscutil.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/stubs/stubs.h b/src/stubs/stubs.h
index 41cde58..7733dc3 100644
--- a/src/stubs/stubs.h
+++ b/src/stubs/stubs.h
@@ -16,6 +16,7 @@
 #define weak __attribute__((weak))
 #else
 #define weak
+#define NO_WEAK_SYMBOLS
 #endif
 
 extern FontPtr find_old_font ( FSID id );
diff --git a/src/util/miscutil.c b/src/util/miscutil.c
index 1e76b4b..09d0731 100644
--- a/src/util/miscutil.c
+++ b/src/util/miscutil.c
@@ -48,8 +48,10 @@ from The Open Group.
 
 extern void BuiltinRegisterFpeFunctions(void);
 
+#if defined(NO_WEAK_SYMBOLS)
 /* make sure everything initializes themselves at least once */
 weak long serverGeneration = 1;
+#endif
 
 weak void
 register_fpe_functions (void)
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to