We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 244

Summary: SDL 1.2.10 fails to build on Solaris 10 AMD64
Product: SDL Reporter: Laurent Blume <laurent>
Component: mainAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2    
Version: 1.2.10   
Hardware: x86   
OS: Solaris   

Description Laurent Blume 2006-05-30 15:05:41 UTC
(Note: since 1.2.10 is not listed above, I put SVN, but I did not actually try against the SVN version)

I tried to build SDL 1.2.10 on Solaris 10 AMD64, using Sun Studio 11, and it fails after doing few files successfully, with the following error:

 cc -fast -xarch=amd64a -I/usr/openwin/include -I./include -D_GNU_SOURCE=1 -DXTHREADS -D_REENTRANT -c ./src/cpuinfo/SDL_cpuinfo.c  -KPIC -DPIC -o build/.libs/SDL_cpuinfo.o
Assembler: SDL_cpuinfo.c
        "/tmp/HAAAxayFL", line 185 : Illegal mnemonic
        Near line: "       pushfl                 "
        "/tmp/HAAAxayFL", line 186 : Illegal mnemonic
        Near line: "    popl    %eax           "
        "/tmp/HAAAxayFL", line 189 : Illegal mnemonic
        Near line: "    pushl   %eax           "
        "/tmp/HAAAxayFL", line 190 : Illegal mnemonic
        Near line: "    popfl                  "
        "/tmp/HAAAxayFL", line 191 : Illegal mnemonic
        Near line: "    pushfl                 "
        "/tmp/HAAAxayFL", line 192 : Illegal mnemonic
        Near line: "    popl    %eax           "
        "/tmp/HAAAxayFL", line 195 : Syntax error
        Near line: "    movl    $1,-8(%ebp)    "
cc: ube failed for ./src/cpuinfo/SDL_cpuinfo.c
*** Error code 1
make: Fatal error: Command failed for target `build/SDL_cpuinfo.lo'

Doing the same command without the amd64a target, the same file builds successfully, so the ASM code there is invalid for that target and compiler:

$  cc -fast  -I/usr/openwin/include -I./include -D_GNU_SOURCE=1 -DXTHREADS -D_REENTRANT -c ./src/cpuinfo/SDL_cpuinfo.c  -KPIC -DPIC -o build/.libs/SDL_cpuinfo.o

Or using Solaris GCC, with a 64 bit target, again no problem:
$ /usr/sfw/bin/gcc -m64  -I/usr/openwin/include -I./include -D_GNU_SOURCE=1 -DXTHREADS -D_REENTRANT -c ./src/cpuinfo/SDL_cpuinfo.c  -o build/.libs/SDL_cpuinfo.o

The ./configure parameters used were:
CPPFLAGS='-I/usr/openwin/include' \
CFLAGS='-fast -xarch=amd64a' \
CXXFLAGS='-fast -xarch=amd64a' \
LDFLAGS='-R/usr/X11/lib/64 -L/usr/openwin/lib/64 -R/usr/openwin/lib/64' \
./configure --prefix=/opt/games/scummvm \
  --enable-static=no \
  --enable-video-x11-xv \
  --enable-oss \
  --enable-esd=no \
  --enable-nas=no \
  --enable-arts=no \
  --enable-sdl-dlopen

They had been used without a problem for SDL 1.2.9, so it seems that non-portable code was introduced in between.

I can do further tests and builds if that can help.
Comment 1 Sam Lantinga 2006-06-20 01:41:06 UTC
If you look in SDL_cpuinfo.c, you'll see there's different code for amd64 and x86.
Can you try the latest code in subversion?  I think I may have fixed the problem.
Comment 2 Laurent Blume 2006-06-20 05:55:52 UTC
I pulled the latest SVN this morning, and tried to build in the same way, using Studio 11 again.
However, it failed with a different (and probably unrelated) error, so I can't confirm the problem is gone.

/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'
Comment 3 Laurent Blume 2006-06-21 05:41:34 UTC
I confirm it works, I just had to comment out the offending line to complete the build. No more errors on assembly with today's SVN. I'm going to open a new bug report for that other build failure, thanks.