| Summary: | Build fails on Solaris 10 because of a redeclared function | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Laurent Blume <laurent> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | svdb+sdl-bugs, tk |
| Version: | HG 1.2 | ||
| Hardware: | Other | ||
| OS: | Solaris | ||
This is fixed in subversion. Could you please specify which SVN revision fixed this? Revision #2450, I think, "fixed" it. But Revision #2548 will disable runtime loading of X11 on platforms without gcc4 (so it dynamically links at build time instead, like the old behaviour) ... loading X11 at runtime is mostly useful for shipping binaries on Linux distributions that may or may not want to supply that dependency...on Solaris, it's probably safe to assume SDL users will have Xlib installed and functioning, so it's not a big deal to abandon the dynamic loading there. Both patches are in SDL 1.2.11, I think. --ryan. *** Bug 500 has been marked as a duplicate of this bug. *** It's now one year later, and SDL 1.2.12 triggers the exact same bug. Is it possible that Solaris moved to gcc4, so it started triggering this again? (Try configuring with --disable-x11-shared too.) --ryan. Oh, I should probably have said that this is no system gcc. I compiled it from source (4.2.1).
But I don't think gcc is at fault; the prototype really is different.
/usr/openwin/include/X11/Xlibint.h contains
extern void _XData32 (Display *dpy, long *data, unsigned long len);
while src/video/x11/SDL_x11sym.h contains
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
(Note that both the return type and the type of the last argument differ.)
I have now changed the latter to
SDL_X11_SYM(void,_XData32,(Display *dpy,register long *data,unsigned long len),(dpy,data,len),return)
and the build completes, and other libraries can link against it. I haven't yet tested an application with the built SDL.
Oh, I see the problem. I'm using Sun Studio's cc rather than gcc. My configure output is: checking for X... libraries /usr/openwin/lib, headers /usr/openwin/include checking whether -R must be followed by a space... no checking for gethostbyname... no checking for gethostbyname in -lnsl... yes checking for connect... no checking for connect in -lsocket... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... yes checking for X11/extensions/Xrandr.h... no checking for X11/extensions/dpms.h... yes Okay, I finally got gcc 4.1.2 compiled on Solaris, but the -fvisibility=hidden stuff doesn't work. I disabled dynamic X11 when gcc doesn't support it, but I'm not sure if that takes care of your environment. Does -fvisibility=hidden work for you? If so, how did you get it working? :) Hmm? Where does -fvisibility-hidden come in? I don't have access to the Solaris machine where I encountered this problem at, at the moment, so I can't test anything right now. The bug would only show up if dynamic X11 is enabled, and it's only enabled if -fvisibility=hidden is supported by the compiler (to avoid symbol collisions between SDL's X11 symbols and the real ones) I'll mark this fixed for now, go ahead and reopen it if it's still active with SDL in subversion (or 1.2.13 release) Thanks! |
The build fails on Solaris, with the long error below. From what I understand, the macro on line 165 of src/video/x11/SDL_x11sym.h redefines _XData32: SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) Which is different from the original in /usr/openwin/include/X11/Xlibint.h: #ifdef LONG64 extern void _XRead32 (Display *dpy, long *data, long len); extern void _XData32 (Display *dpy, long *data, unsigned long len); #define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) #else Build is on Solaris 10 U1 AMD64, using Sun Studio 11. The complete error: /bin/bash ./libtool --mode=compile cc -fast -xarch=amd64a -I/usr/openwin/include -I/usr/X11/include -I./include -D_GNU_SOURCE=1 -DXTHREADS -D_REENTRANT -c ./src/video/x11/SDL_x11dyn.c -o build/SDL_x11dyn.lo cc -fast -xarch=amd64a -I/usr/openwin/include -I/usr/X11/include -I./include -D_GNU_SOURCE=1 -DXTHREADS -D_REENTRANT -c ./src/video/x11/SDL_x11dyn.c -KPIC -DPIC -o build/.libs/SDL_x11dyn.o "src/video/x11/SDL_x11sym.h", line 165: identifier redeclared: _XData32 current : function(pointer to struct _XDisplay {pointer to struct _XExtData {..} ext_data, pointer to struct _XFreeFuncs {..} free_funcs, int fd, int conn_checker, int proto_major_version, int proto_minor_version, pointer to char vendor, unsigned long resource_base, unsigned long resource_mask, unsigned long resource_id, int resource_shift, pointer to function(..) returning unsigned long resource_alloc, int byte_order, int bitmap_unit, int bitmap_pad, int bitmap_bit_order, int nformats, pointer to struct {..} pixmap_format, int vnumber, int release, pointer to struct _XSQEvent {..} head, pointer to struct _XSQEvent {..} tail, int qlen, unsigned long last_request_read, unsigned long request, pointer to char last_req, pointer to char buffer, pointer to char bufptr, pointer to char bufmax, unsigned int max_request_size, pointer to struct _XrmHashBucketRec {..} db, pointer to function(..) returning int synchandler, pointer to char display_name, int default_screen, int nscreens, pointer to struct {..} screens, unsigned long motion_buffer, unsigned long flags, int min_keycode, int max_keycode, pointer to unsigned long keysyms, pointer to struct {..} modifiermap, int keysyms_per_keycode, pointer to char xdefaults, pointer to char scratch_buffer, unsigned long scratch_length, int ext_number, pointer to struct _XExten {..} ext_procs, array[128] of pointer to function(..) returning int event_vec, array[128] of pointer to function(..) returning int wire_vec, unsigned long lock_meaning, pointer to struct _XLockInfo {..} lock, pointer to struct _XInternalAsync {..} async_handlers, unsigned long bigreq_size, pointer to struct _XLockPtrs {..} lock_fns, pointer to function(..) returning void idlist_alloc, pointer to struct _XKeytrans {..} key_bindings, unsigned long cursor_font, pointer to struct _XDisplayAtoms {..} atoms, unsigned int mode_switch, unsigned int num_lock, pointer to struct _XContextDB {..} context_db, pointer to pointer to function(..) returning int error_vec, struct {..} cms, pointer to struct _XIMFilter {..} im_filters, pointer to struct _XSQEvent {..} qfree, unsigned long next_event_serial_num, pointer to struct _XExten {..} flushes, pointer to struct _XConnectionInfo {..} im_fd_info, int im_fd_length, pointer to struct _XConnWatchInfo {..} conn_watchers, int watcher_count, pointer to char filedes, pointer to function(..) returning int savedsynchandler, unsigned long resource_max, int xcmisc_opcode, pointer to struct _XkbInfoRec {..} xkb_info, pointer to struct _XtransConnInfo {..} trans_conn}, pointer to long, unsigned int) returning int previous: function(pointer to struct _XDisplay {pointer to struct _XExtData {..} ext_data, pointer to struct _XFreeFuncs {..} free_funcs, int fd, int conn_checker, int proto_major_version, int proto_minor_version, pointer to char vendor, unsigned long resource_base, unsigned long resource_mask, unsigned long resource_id, int resource_shift, pointer to function(..) returning unsigned long resource_alloc, int byte_order, int bitmap_unit, int bitmap_pad, int bitmap_bit_order, int nformats, pointer to struct {..} pixmap_format, int vnumber, int release, pointer to struct _XSQEvent {..} head, pointer to struct _XSQEvent {..} tail, int qlen, unsigned long last_request_read, unsigned long request, pointer to char last_req, pointer to char buffer, pointer to char bufptr, pointer to char bufmax, unsigned int max_request_size, pointer to struct _XrmHashBucketRec {..} db, pointer to function(..) returning int synchandler, pointer to char display_name, int default_screen, int nscreens, pointer to struct {..} screens, unsigned long motion_buffer, unsigned long flags, int min_keycode, int max_keycode, pointer to unsigned long keysyms, pointer to struct {..} modifiermap, int keysyms_per_keycode, pointer to char xdefaults, pointer to char scratch_buffer, unsigned long scratch_length, int ext_number, pointer to struct _XExten {..} ext_procs, array[128] of pointer to function(..) returning int event_vec, array[128] of pointer to function(..) returning int wire_vec, unsigned long lock_meaning, pointer to struct _XLockInfo {..} lock, pointer to struct _XInternalAsync {..} async_handlers, unsigned long bigreq_size, pointer to struct _XLockPtrs {..} lock_fns, pointer to function(..) returning void idlist_alloc, pointer to struct _XKeytrans {..} key_bindings, unsigned long cursor_font, pointer to struct _XDisplayAtoms {..} atoms, unsigned int mode_switch, unsigned int num_lock, pointer to struct _XContextDB {..} context_db, pointer to pointer to function(..) returning int error_vec, struct {..} cms, pointer to struct _XIMFilter {..} im_filters, pointer to struct _XSQEvent {..} qfree, unsigned long next_event_serial_num, pointer to struct _XExten {..} flushes, pointer to struct _XConnectionInfo {..} im_fd_info, int im_fd_length, pointer to struct _XConnWatchInfo {..} conn_watchers, int watcher_count, pointer to char filedes, pointer to function(..) returning int savedsynchandler, unsigned long resource_max, int xcmisc_opcode, pointer to struct _XkbInfoRec {..} xkb_info, pointer to struct _XtransConnInfo {..} trans_conn}, pointer to long, unsigned long) returning void : "/usr/openwin/include/X11/Xlibint.h", line 441 cc: acomp failed for ./src/video/x11/SDL_x11dyn.c *** Error code 1 make: Fatal error: Command failed for target `build/SDL_x11dyn.lo'