Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Solaris 10 because of a redeclared function #171

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Build fails on Solaris 10 because of a redeclared function #171

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Solaris, Other

Comments on the original bug report:

On 2006-06-21 05:49:51 +0000, Laurent Blume wrote:

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'

On 2006-06-23 21:12:29 +0000, Sam Lantinga wrote:

This is fixed in subversion.

On 2006-10-26 15:36:31 +0000, Thomas Klausner wrote:

Could you please specify which SVN revision fixed this?

On 2006-10-26 17:51:26 +0000, Ryan C. Gordon wrote:

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.

On 2007-10-06 13:58:37 +0000, Serge van den Boom wrote:

*** Bug 500 has been marked as a duplicate of this bug. ***

On 2007-10-06 14:00:48 +0000, Serge van den Boom wrote:

It's now one year later, and SDL 1.2.12 triggers the exact same bug.

On 2007-10-06 16:40:26 +0000, Ryan C. Gordon wrote:

Is it possible that Solaris moved to gcc4, so it started triggering this again?

(Try configuring with --disable-x11-shared too.)

--ryan.

On 2007-10-06 16:52:32 +0000, Serge van den Boom wrote:

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.

On 2007-12-29 14:34:55 +0000, Sam Lantinga wrote:

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

On 2007-12-30 10:50:31 +0000, Sam Lantinga wrote:

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? :)

On 2007-12-30 11:20:55 +0000, Serge van den Boom wrote:

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.

On 2007-12-30 11:41:29 +0000, Sam Lantinga wrote:

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant