From: Charles S. <bas...@ch...> - 2012-06-28 01:13:40
|
I actually got past that point since I wrote that, and I’ve incidentally managed to get SheepShaver to compile on Lion in a form that would run, although via a decidedly kludgey method. I was going to post on the list, but haven’t gotten around to it; sorry about that. Here’s what I've found: 1. As you surmised, the shmat problem is related to the pagezero test not working, which is indeed caused by changes in Lion. I was able to work around this by adding -mmacosx-version-min=10.6 to CFLAGS, CXXFLAGS, and LDFLAGS. 2. With the default settings you get from configure, dyngen will choke on a bunch of extra symbols from functions that are supposed to be inlined. This is fixed by adding -O2 to the flags; easy enough. 3. MacPorts contains port files for the latest stable version of GCC (gcc47), as well as the last version of GCC that Apple shipped with Xcode (apple-gcc42), so there’s no need to have an old version of the Apple dev tools around. However, each has its own problems: 3a. Vanilla gcc47 doesn’t have Apple’s non-standard blocks implementation, so all the code that imports, for example, <Foundation/Foundation.h> will choke on all the ^ characters. The workaround for this is to either create your own hacked Frameworks folder with the block-using APIs removed from the headers or to pull the Mac OS X 10.5 SDK from an earlier version of Xcode (as blocks weren’t introduced until 10.6), and then add '-iframework /path/to/my/Frameworks’ to CFLAGS and CXXFLAGS. 3b. Applying all the above results in a binary that compiles, and gets past the shmat stuff, but then spits out an "Invalid thread_state flavor = 0. Not forwarding” and promptly crashes. I never was able to figure out what was causing this. 4. Using apple-gcc42 from MacPorts solves the above problems, but it introduces a wrinkle of its own: api::__cxa_demangle doesn’t work, failing every time with status -2, even if the symbol name is valid, for no reason I can discover, which causes dyngen to choke with a bunch of “unexpected external symbol _ZL11foov” type errors. Libiberty’s demangling doesn’t seem to work either. This, also, I haven’t been able to figure out. I kludged it into working by doing the follows: 1. I made a quick-and-dirty demangle app which takes a symbol name on the command line and outputs the demangled name. I compiled this with vanilla gcc 4.7 and put it in /usr/local/bin. 2. I hacked src/kpx_cpu/src/cpu/jit/cxxdemangle.cpp so that it would fork/exec my demangle tool and use the output from that instead of trying to call api::__cxa_demangle itself. 3. I compiled the rest of the project using these settings: CC=/opt/local/bin/gcc-apple-4.2; export CC CPP="$CC -E"; export CPP CXX=/opt/local/bin/g++-apple-4.2; export CXX CFLAGS="-O2 -mmacosx-version-min=10.6"; export CFLAGS CXXFLAGS=$CFLAGS; export CXXFLAGS LDFLAGS="-mmacosx-version-min=10.6"; export LDFLAGS NO_CONFIGURE=1 ACLOCAL_FLAGS="-I m4" ./autogen.sh ./configure --enable-sdl-framework --enable-sdl-audio --enable-sdl-video --disable-vosf make What do you know, it compiles, and it works. Not the most convenient thing in the world, but better than nothing. Charles On Jun 27, 2012, at 7:30 PM, C.W. Betts wrote: > I think it chokes on another point of code, not the registers. Some type of cast, IIRC. > > I don't know if this is relevant, but Lion's linker does position independent executable which I think messes up the pagezero test (when running configure, the pagezero test app crashes.) > On Jun 18, 2012, at 10:55 PM, Charles Srstka wrote: > >> On Jun 18, 2012, at 11:18 PM, Gwenole Beauchesne wrote: >> >>> The JIT based on dyngen needs to be built with GCC. You can select the GCC compiler to be used, see DYNGEN_CC variable. >> >> Unfortunately, the latest version of the dev tools no longer includes GCC. It does have LLVM-GCC, which is the GCC interface on the LLVM back-end, and this chokes on the global registers, same as Clang. >> >> I’ve managed to get SheepShaver to compile using GCC 4.7 from MacPorts, but it’s currently quitting on launch — the shmat call at main_unix.cpp line 1172 is failing with ENOMEM. >> >> Charles >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >> basilisk-devel mailing list >> bas...@li... >> https://lists.sourceforge.net/lists/listinfo/basilisk-devel > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > basilisk-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basilisk-devel |