Menu

#245 AdvanceMAME doesn't build under Haiku

other
closed-fixed
nobody
5
2015-11-06
2015-05-01
No

I've just tried compiling the latest git verrsion of AM under Haiku 49132 using GCC 4.8.4, SDL 1.2.15 and nasm 2.11.08. It gets further into the build process than any regular MAME version I've tried but only gets as far as:

obj/menu/generic/blend/blit/blit.o
In file included from advance/blit/blit.c:146:0:
advance/blit/icopy.h: In function 'internal_copy8_step_mmx':
advance/blit/icopy.h:195:2: error: inconsistent operand constraints in an 'asm'
asm volatile(
^
make: *** [obj/menu/generic/blend/blit/blit.o] Error 1

Thanks for your help!

Discussion

  • Daniel MacDonald

    If I compile it with GCC 2.95.3 instead:

    obj/menu/generic/blend/blit/blit.o
    /boot/home/src/advancemame/advance/blit/icopy.h: In function video_line_stretchx8_11_mmx': In file included from /boot/home/src/advancemame/advance/blit/blit.c:232: /boot/home/src/advancemame/advance/blit/icopy.h:244:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/icopy.h: In function video_line_stretchx16_11_mmx': /boot/home/src/advancemame/advance/blit/icopy.h:300:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/icopy.h: In function video_line_stretchx32_11_mmx': /boot/home/src/advancemame/advance/blit/icopy.h:346:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette8to16_step1_mmx': In file included from /boot/home/src/advancemame/advance/blit/blit.c:240: /boot/home/src/advancemame/advance/blit/vpalette.h:113:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette16to8_step2_mmx': /boot/home/src/advancemame/advance/blit/vpalette.h:259:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette16to8_mmx': /boot/home/src/advancemame/advance/blit/vpalette.h:348:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette16to16_step2_mmx': /boot/home/src/advancemame/advance/blit/vpalette.h:424:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette16to16_mmx': /boot/home/src/advancemame/advance/blit/vpalette.h:490:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette16to32_step2_mmx': /boot/home/src/advancemame/advance/blit/vpalette.h:554:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/vpalette.h: In function video_line_palette16to32_mmx': /boot/home/src/advancemame/advance/blit/vpalette.h:606:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/icopy.h: In function internal_copy8_step_mmx': /boot/home/src/advancemame/advance/blit/icopy.h:244:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/icopy.h: In function internal_copy16_step_mmx': /boot/home/src/advancemame/advance/blit/icopy.h:300:asm' needs too many reloads
    /boot/home/src/advancemame/advance/blit/icopy.h: In function internal_copy32_step_mmx': /boot/home/src/advancemame/advance/blit/icopy.h:346:asm' needs too many reloads
    make: *** [obj/menu/generic/blend/blit/blit.o] Error 1

     
  • Andrea Mazzoleni

    Hi,

    The "inconsistent operand constraints in an 'asm'" error seems related at the EBX use in the asm when this register is already used by the compiler.

    Are you maybe compiling with -fPIC ? This could cause this error.

    Ciao,
    Andrea

     
  • Andrea Mazzoleni

    Please also try with latest git update.

    Thanks,
    Andrea

     
  • Daniel MacDonald

    Hi Andrea

    The latest git version does get further through the build process but now its complaing about the missing maths (m) lib, which Haiku doesn't use. I've also included the uname output in case you need to modify the autoconf files to support Haiku:

    obj/s/generic/blend/advs
    /boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/4.8.4/../../../../i586-pc-haiku/bin/ld: cannot find -lm
    collect2: error: ld returned 1 exit status
    make: *** [obj/s/generic/blend/advs] Error 1
    ~/src/advancemame> uname
    Haiku
    ~/src/advancemame> uname -a
    Haiku shredder 1 hrev49132 Apr 30 2015 03:20:00 BePC x86 Haiku
    ~/src/advancemame>

    Here is an explanation of how Haiku differs from regular UNIX including how it handles the maths library:

    http://ports.haiku-files.org/wiki/CommonProblems

    Thanks!

     
  • Andrea Mazzoleni

    Please retry now.

    The new configure script should now handle the missing math library.

    Ensure to regenerate it using autoconf, or autogen.sh.

    Ciao,
    Andrea

     
  • Daniel MacDonald

    ~/src/advancemame> ./autogen.sh
    Generating build information using autoconf
    This may take a while ...
    Now you are ready to run ./configure
    ~/src/advancemame> ./configure
    configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
    ~/src/advancemame>

     
  • Andrea Mazzoleni

    Try again now.

    autogen.sh should give some errors, but create the missing install-sh file.

    Otherwise, you can pick missing files from the latest .tar.gz.

    Ciao,
    Andrea

     
  • Daniel MacDonald

    Hi Andrea

    configure is working again now but I'm still getting

    obj/s/generic/blend/advs
    /boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/4.8.4/../../../../i586-pc-haiku/bin/ld: cannot find -lm
    collect2: error: ld returned 1 exit status

    Unfortunately.

     
  • Andrea Mazzoleni

    Please try again with latest git changes.

    We should be near now :)

     
  • Daniel MacDonald

    I think so! :)

    obj/m/generic/blend/linux/os.o
    obj/m/generic/blend/linux/mraw.o
    obj/m/generic/blend/advm
    obj/d2/unix/advd2 txt < doc/authors.d > doc/authors.txt
    /bin/sh: obj/d2/unix/advd2: No such file or directory
    make: *** [doc/authors.txt] Error 127

     
  • Andrea Mazzoleni

    advd2 is the tool used for doc. To build you can use "make d2".

    Or use the latest changes from git, that should build it automatically.

    Ciao,
    Andrea

     
  • Daniel MacDonald

    The good news is that something has built successfully but its not what I expected. Please correct me if I'm wrong but I thought AdvanceMAME was a full port of MAME, not just a menu system for it? I thought that was called Advancemenu, not AdvanceMAME?

    Maybe I'm not configuring it correctly but I don't see an advmame binary and nor did I see 100's of game objects get built. I've attached the list of files that compiled with the default configure options.

    You'll have to excuse me for the moment if this is a MAME menu app as there is currently no working MAME for Haiku so I'm unable to test it just yet if thats the case.

    Thanks for your help Andrea!

     
  • Daniel MacDonald

    There used to be a Haiku port of MAME a few years ago but Haiku has changed quite a lot since and now the port needs to be updated. One of the main Haiku devs is working on updating the Haiku MAME recipe (port) but its not ready yet. I believe he (PulkoMandy) is porting the official MAME.

     
  • Daniel MacDonald

    The git version doesn't have the BUILD instructions file nor does it include the src dir that contains all the MAME game data so I downloaded advmame 1.2 and copied its src dir into the advancemame git dir then I configured it like this:

    ./configure --with-emu=mame

    and now make dies here:

    obj/mame/generic/blend/advance/osd/emu.o
    In file included from /boot/home/src/advancemame/advance/osd/osd_cpu.h:34,
    from /boot/home/src/advancemame/src/mamecore.h:18,
    from /boot/home/src/advancemame/src/video.h:15,
    from /boot/home/src/advancemame/advance/osd/glue.h:34,
    from /boot/home/src/advancemame/advance/osd/emu.h:34,
    from /boot/home/src/advancemame/advance/osd/emu.c:33:
    /boot/home/src/advancemame/advance/osd/osdutils.h:85: conflicting types for strlwr' /boot/system/develop/headers/posix/string.h:70: previous declaration ofstrlwr'
    /boot/home/src/advancemame/advance/osd/osdutils.h:95: conflicting types for strupr' /boot/system/develop/headers/posix/string.h:71: previous declaration ofstrupr'
    make: *** [obj/mame/generic/blend/advance/osd/emu.o] Error 1

     
  • Andrea Mazzoleni

    Hi Daniel,

    Try with the latest change. Bit it's better if you download the full archive from: http://advancemame.sourceforge.net/beta/

    The advancemame-1.3.tar.gz contains also the patched MAME source.

    Ciao,
    Andrea

     
  • Andrea Mazzoleni

    Some questions

    When you run ./configure, does it recognize the SDL library ?

    How did you installed SDL to make it working ? I tried building SDL 1.2.15 from source, but it's not recognized by the AdvanceMAME configure.

    Ciao,
    Andrea

     
  • Daniel MacDonald

    Hi Andrea!

    Yes, it recognizes SDL. I installed SDL via the Haiku package manager, HaikuDepot. If it doesn't work with 1.2.15, I'll try building it with SDL2.

    We are at the very last hurdle now, I'm sure. I'll prob be able to fix this myself with a little messing now..

    obj/mame/generic/blend/advance/libexpat.a
    obj/mame/generic/blend/advmame
    /boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/4.8.4/../../../../i586-pc-haiku/bin/ld: cannot find -lm
    collect2: error: ld returned 1 exit status
    make: *** [obj/mame/generic/blend/advmame] Error 1

     
  • Daniel MacDonald

    If you can't shrink your existing OS install to make room for Haiku or install Haiku on its own disk it is supposed to run well under VirtualBox.

    However, I don't think you experience it properly that way. It might sound funny but it has the fastest VESA graphics of any OS ever and it seems as good as or better than when using a proper driver for 2D (under Linux or Windows). It installs faster than any other modern OS, its super responsive and using other things feels slow in comparison.

    Something I discovered yesterday about Haiku that has really impressed me is that when I play a full HD h264 video under (Arch) Linux and Windows (7) w/o using hardware decoding, its takes about 15% of my CPU to play. Playing the same file under Haiku (without a proper gfx driver) takes 1.5% CPU making Haiku 10X better at software video decoding than Linux or Windows!

     

    Last edit: Daniel MacDonald 2015-05-06
  • Daniel MacDonald

    I used VLC under Windows and Linux and the native Haiku media player to perform that comparison because it seems the Haiku version of VLC is too old to play full HD H264 files or that feature is just broke. The version of VLC in the Haiku repos is still at 0.8.6 but I'm perfectly happy with its native video player anyway.

     
  • Daniel MacDonald

    Back on topic - should I be able to compile (Advance)MESS with this too when you've fixed the Haiku build process?

     
  • Andrea Mazzoleni

    Hi Daniel,

    Success here! I can run it in VirtualBox!

    Try getting the latest .tar.gz from the beta/ dir and run:

    ./configure --prefix=/boot/apps/advance
    make
    make install
    /boot/apps/advance/bin/advmame robby

    Ciao
    Andrea

     
  • Daniel MacDonald

    Hi Andrea

    You did it! advmame is running great under my Haiku install now - or it will be when I've configured my joypad which is obviously working OK.

    It didn't stop advmame from building so I'd close this ticket now but I did still get this error at the end:

    obj/d2/unix/advd2 man < doc/advj.d > doc/advj.1
    obj/d2/unix/advd2 man < doc/advm.d > doc/advm.1
    make: *** No rule to make target support/history.dat', needed byall'. Stop.

    Thanks v.much for all your effort in porting AdvanceMAME to Haiku, which has suddenly become much more fun now! You can add another OS to the list of platforms AdvanceMAME supports.

     
  • Andrea Mazzoleni

    Hi Daniel,

    That support/ and contrib/ dir are only in the .tar.gz files and not in git.
    Just copy such dirs from that packages.

    Anyway, I've also added MESS support. You can get advancemess-1.3.tar.gz from http://advancemame.sourceforge.net/beta/

    Ciao,
    Andrea

     
  • Daniel MacDonald

    Hi Andrea

    I just tried building MESS under Haiku using the latest advancemame git w/ advancemess 1.3 sources but it only got as far as:

    obj/mess/generic/blend/sound/dac.o
    make: *** No rule to make target src/sound/discrete.c', needed byobj/mess/generic/blend/sound/discrete.o'. Stop.

    I shall want no more for emus under Haiku when MESS works!

     
  • Andrea Mazzoleni

    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB