Bug 6110 - HP-UX cc doesn't understand __alignof__
Summary: HP-UX cc doesn't understand __alignof__
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.3
Hardware: x86 (IA32) HP-UX
: high normal
Assignee: Dom Lachowicz
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-03 22:30 UTC by Christoph Bauer
Modified: 2006-04-08 06:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch to implement __alignof__ portably (3.89 KB, patch)
2006-04-08 01:50 UTC, Dom Lachowicz
Details | Splinter Review
missed 2 __alignof__ in fcint.h (4.23 KB, patch)
2006-04-08 02:30 UTC, Dom Lachowicz
Details | Splinter Review
patch to check for 'inline' in configure.in (2.03 KB, patch)
2006-04-08 02:34 UTC, Dom Lachowicz
Details | Splinter Review

Description Christoph Bauer 2006-03-03 22:30:53 UTC
HP-UX cc doesn't understand __alignof__

I tried to write some macros  by myself with sizeof, but 
I just get some Core dumps (BUS Signal) :-(

with gcc it seems to work, but gcc builds only a static library.
Comment 1 Dom Lachowicz 2006-04-08 01:47:08 UTC
A few approaches to simulate alignof are documented here:

http://www.m17n.org/martin/writings/alignof.html

The following macro would work for fontconfig's uses, and would also go toward
fixing bug 6099.

#define fc_alignof(type) offsetof (struct { char c; type member; }, member)

Patch forthcoming.
Comment 2 Dom Lachowicz 2006-04-08 01:50:57 UTC
Created attachment 5219 [details] [review]
patch to implement __alignof__ portably
Comment 3 Christoph Bauer 2006-04-08 02:12:03 UTC
First problem: fcint.h uses HAVE_INTTYPES_H before config.h is included.
Comment 4 Christoph Bauer 2006-04-08 02:16:05 UTC
HP-UX doesn't understand __inline__ to :-(
So I set CFLAGS to -D__inline__=

cc: "fcint.h", line 486: error 1000: Unexpected symbol: "int".
cc: "fcint.h", line 626: error 1000: Unexpected symbol: "int".
cc: "fcint.h", line 626: error 1586: Redefinition of function "__inline__".
cc: "fcint.h", line 626: error 1711: Inconsistent parameter list declaration 
for "__inline__".
cc: "fcint.h", line 833: error 1000: Unexpected symbol: "int".
cc: "fcint.h", line 833: error 1586: Redefinition of function "__inline__".
cc: "fcint.h", line 833: error 1711: Inconsistent parameter list declaration 
for "__inline__".
cc: "fcint.h", line 901: error 1000: Unexpected symbol: "FcValueList".
cc: "fcint.h", line 905: warning 604: Pointers are not assignment-compatible.
cc: "fcint.h", line 907: warning 604: Pointers are not assignment-compatible.
cc: "fcint.h", line 910: error 1000: Unexpected symbol: "FcPatternElt".
cc: "fcint.h", line 914: warning 604: Pointers are not assignment-compatible.
cc: "fcint.h", line 916: warning 604: Pointers are not assignment-compatible.
Comment 5 Christoph Bauer 2006-04-08 02:24:00 UTC
in fcint.h is a macro ALIGN. It has to be fixed, too.
Comment 6 Dom Lachowicz 2006-04-08 02:30:10 UTC
Created attachment 5222 [details] [review]
missed 2 __alignof__ in fcint.h

This catches another __alignof__ use in fcint.h.

There is a patch in bug 6171 to handle the stdint/inttypes problem.
Comment 7 Dom Lachowicz 2006-04-08 02:34:01 UTC
Created attachment 5223 [details] [review]
patch to check for 'inline' in configure.in

Uses AC_C_INLINE, which should expand to inline/__inline__/__inline/nothing as
appropriate.
Comment 8 Patrick Lam 2006-04-08 03:28:25 UTC
I've committed these patches.  Please REOPEN if it doesn't work.
Comment 9 Christoph Bauer 2006-04-08 21:07:57 UTC
config.h includes now a definition for inline:

/* Define to `__inline__' or `__inline' if that's what the C compiler
   calls it, or to nothing if 'inline' is not supported under any name.  */
#ifndef __cplusplus
#define inline __inline
#endif

But now I get this error

cc  -O -Ae +DAportable  -Wl,+vshlibunsats -Wl,-z -Wl,+s -Wl,-B,immediate -o
fc-case  fc-case.o  
/usr/ccs/bin/ld: Unsatisfied symbols:
   _fcValueLists (first referenced in fc-case.o) (data)
   _fcPatternElts (first referenced in fc-case.o) (data)
   FcDebugVal (first referenced in fc-case.o) (data)

Should I make a new bug report or reopen this one?
Comment 10 Christoph Bauer 2006-04-08 21:09:52 UTC
BTW, many thanks Dom & Patrick for your support so far.
Comment 11 Dom Lachowicz 2006-04-08 23:31:53 UTC
New bug report, please. Thanks.


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.