Bug 8565

Summary: compile failure for 2.4.1 on solaris 10 with gcc
Product: fontconfig Reporter: mark
Component: libraryAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: 2.4   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 12917    
Attachments: patch again as an attachment

Description mark 2006-10-09 04:59:26 UTC
compiling fontconfig 2.4.1 on solaris 10 using the gcc3.4 from /usr/sfw
fails with:
 ld: fatal: relocation error: R_386_GOTOFF: file .libs/fccache.o: symbol  
FcDebugVal: relocation must bind locally
 collect2: ld returned 1 exit status

This patch fixes build:
--- src/fcint.h.orig    2006-10-09 23:26:05.064812000 +1300
+++ src/fcint.h
@@ -111,7 +111,7 @@
 #define FC_BANK_LANGS      0xfcfcfcfc

 /* slim_internal.h */
-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && 
defined(__ELF__)
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && 
defined(__ELF__) && !defined(__sun)
 #define FcPrivate              __attribute__((__visibility__("hidden")))
 #define HAVE_GNUC_ATTRIBUTE 1
 #include "fcalias.h"
Comment 1 mark 2006-10-09 05:01:45 UTC
Created attachment 7302 [details] [review]
patch again as an attachment
Comment 2 Keith Packard 2006-10-09 07:40:44 UTC
Your patch just disables the ELF options designed to improve performance in
several ways; it looks like there is just a single symbol which is causing
trouble, can we just fix that somehow and keep the rest of the performance
improvements?
Comment 3 mark 2006-10-09 16:59:37 UTC
The part that I neglected to say previously was that you also get lots of 
warnings during the build:

../src/fccharset.c: In function `FcCharSetFindLeafCreate':
../src/fccharset.c:211: warning: visibility attribute not supported in this 
conf
iguration; ignored
../src/fccharset.c: In function `FcNameParseCharSet':
../src/fccharset.c:885: warning: visibility attribute not supported in this 
conf
iguration; ignored
../src/fccharset.c: In function `FcNameUnparseCharSet':
../src/fccharset.c:958: warning: visibility attribute not supported in this 
conf
iguration; ignored
     [...]

I've also seen this problem in cairo and glitz.
Comment 4 Behdad Esfahbod 2007-10-25 08:34:33 UTC
Easy fix.  We already did it in cairo.
Comment 5 Keith Packard 2007-10-25 14:36:51 UTC
ok, I guess we just disable the visibility stuff on solaris when building with gcc. That's what cairo does...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.