VOGONS


First post, by kahuna0k

User metadata
Rank Newbie
Rank
Newbie

Hello,

My compilation of DOSbox (both 0.74 and latest trunk from SVN) crash when setting the core to dynamic, I know this is an indication of a x86_64 build, but I am quite sure I have build a i386 binary, lipo -info reports:

Non-fat file: src/dosbox is architecture: i386

I have compiled against SDL 1.2.15, everything compiled with "-arch i386 -m32", and I have tried several options, (no_pic, -g, ...) always with the same result, DOSbox start without problem but as soon as I change to dynamic (either manually or running a DOS4GW program) it crashes. I have attached the backtrace from gdb.

I am compiling in Mountain Lion 10.8.2 with xcode 4.5.1 on a rMBP, I have tried also exporting CC=llvm-gcc CXX=llvm-g++ (as suggested http://trac.macports.org/ticket/35354#comment:6) without success. Official binary (the .dmg provided one) works without problems with the exactly same configuration.

I have no more ideas to test, so if you have any suggestion, I would be very grateful.

Regards,

Attachments

  • Filename
    back.txt
    File size
    1.86 KiB
    Downloads
    97 downloads
    File license
    Fair use/fair dealing exception

Reply 1 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

somewhere a 64bit crept in...
This is how I compile Dosbox on OS X 10.8 (and I did the official 0.74.1 release of Dosbox)

OPT=' -arch i386 -m32 -O2 -msse -msse2 -force_cpusubtype_ALL '
SDK=' -w -isysroot /Developer-old/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I/Developer-old/SDKs/MacOSX10.5.sdk/usr/X11R6/include/ '
export MACOSX_DEPLOYMENT_TARGET=10.5
export PATH=/opt/exult.i386/bin/:/developer-old/usr/bin:/developer-old/usr/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/developer-old/usr/bin/gcc-4.2 -arch i386"
export CXX="/developer-old/usr/bin/g++-4.2 -arch i386"
export GCOV="/developer-old/usr/bin/gcov-4.2 -arch i386"
export CPPFLAGS='-I/opt/exult.i386/include '$SDK
export CFLAGS='-I/opt/exult.i386/include '$SDK' '$OPT
export CXXFLAGS='-I/opt/exult.i386/include '$SDK' '$OPT
export LDFLAGS='-L/opt/exult.i386/lib '$SDK' '$OPT
export PKG_CONFIG_PATH="/opt/exult.i386/lib/pkgconfig"
./autogen.sh
./configure $CONF_OPT --prefix=/opt/exult.i386

/opt/exult.i386 is my prefix I use to store all 32bit only libs
and I'm using the old Xcode gcc things to have a true gcc to buil Dosbox, not the llvm or clang one (clang doesn't cleanly compile dosbox yet)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 3 of 11, by kahuna0k

User metadata
Rank Newbie
Rank
Newbie

Well, use a Snow Leopard virtual machine I have in parallels with XCode 3.2.6 and I make it work without problem, even when linking dynamically to official latest SDL framework. Clearly, Snow Leopard was the latest good cat 😁

Regards and thank you for your help!

Reply 4 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Apparently macports manages to do it with newest xcode on 10.8 as well 😉
So it should work for you as well on 10.8

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 5 of 11, by kahuna0k

User metadata
Rank Newbie
Rank
Newbie

I've tried to follow the same options they use and get the same crash as before, maybe that the --enable-debug option makes a difference on the dynamic core behaviour, is the only difference.

Edit: Compiled again with enable-debug and got the same crash ... maybe I have a defective Xcode installation ... that's the only thing left. I have updated to latest 4.5.2 and still crash .. so out of ideas, anyway my snow leopard compilation will do just fine.

Reply 6 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Give me your exact exports and other stuff you do before running autogen and configure. I'm usually able to figure things out 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 7 of 11, by kahuna0k

User metadata
Rank Newbie
Rank
Newbie

Well, I was able to find it myself, really strange when setting

CXX="g++ -arch i386"

it does work, I though that CXXFLAGS was enough, but it seems that it is not, maybe some assembling don't use the CXXFLAGS??... anyway mystery solved.

Great thanks for your support and also for your patience 😁

Reply 8 of 11, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

Apparently macports manages to do it with newest xcode on 10.8 as well ;)
So it should work for you as well on 10.8

This is certainly true, but if you want to run the resulting build on earlier versions, then it's safest to build under Snow Leopard (following your build instructions, of course, because I could never have done this without your help).

Reply 9 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

As long as you use the 10.5 SDK and 10.5 as target you can still compile on 10.8, BUT you really need old xcode dev stuff for that. My snapshots are all built on 10.8

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 11, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

As long as you use the 10.5 SDK and 10.5 as target you can still compile on 10.8, BUT you really need old xcode dev stuff for that. My snapshots are all built on 10.8

Ah - I didn't realize that. Thank you. I'll try to get my system set up that way, as it's presumably easier than building in a VMware Fusion virtual 10.5 system - which is what I've been doing recently.

Reply 11 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'll see about giving pointers when you need them 😉
From the script I pasted above you can see that I have the xcode 3.x stuff in /developers-old. Copy the xcode 3.x stuff from your vm into that.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper