Building 64-bit SheepShaver

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

I have a problem that hopefully someone can shed some light on.

Our member emendelson can consistently build a working SheepShaver from the source code by kanjitalk755: https://github.com/kanjitalk755/macemu
In fact, he uses the source code he downloaded in december: https://www.dropbox.com/s/borrlu8j9i4jf ... 7.zip?dl=1
He opens the Xcode8 project in the source: SheepShaver/src/MacOSX/SheepShaver_Xcode8.xcodeproj
And he builds for 64-bit architecture only, like this: https://imgur.com/a/CjfvGbD

I try to do the same, with the same source and the same settings, but I get a 64-bit SheepShaver application that will quit on launch. I tried several times and the result is always a non-working application. Also emendelson tried again today and, again, his result is a working 64-bit SheepShaver.

Same source, same settings, same Xcode project, both in High Sierra.

The only difference seems to be that emendelson uses Xcode 9.2 and I use Xcode 9.4. Could that make the difference? Or do we overlook some other factor?
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Building 64-bit SheepShaver

Post by adespoton »

Are there any warnings generated by either of you when compiling?

Are the xcode configs set the same for both of you? Any automatic optimizations happening on your side that aren't happening in 9.2?

I'll give the code a whir myself when I get a chance; hopefully later this week.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Building 64-bit SheepShaver

Post by emendelson »

I'm afraid I have no idea of how I got it to build successfully. I thought it might have something to do with the fact that I built in Xcode 9.2, not the current 9.4. So I used a fairly new Mac with a fresh High Sierra system, installed both Xcode 9.2 and 9.4, and installed the SDL framework in /Library/Frameworks - and built in both 9.2 and 9.4 - and, in each case, got exactly the same result that Ronald got. SheepShaver starts up but never gets past the happy Mac icon.

So I have no idea of how I got this to build on my own system. But the thread on GitHub where I reported progress last year might have something relevant:

https://github.com/cebix/macemu/issues/143
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Building 64-bit SheepShaver

Post by adespoton »

emendelson wrote:I'm afraid I have no idea of how I got it to build successfully. I thought it might have something to do with the fact that I built in Xcode 9.2, not the current 9.4. So I used a fairly new Mac with a fresh High Sierra system, installed both Xcode 9.2 and 9.4, and installed the SDL framework in /Library/Frameworks - and built in both 9.2 and 9.4 - and, in each case, got exactly the same result that Ronald got. SheepShaver starts up but never gets past the happy Mac icon.

So I have no idea of how I got this to build on my own system. But the thread on GitHub where I reported progress last year might have something relevant:

https://github.com/cebix/macemu/issues/143
This is the bit that I was wondering about:
EDIT: And now I think I see where I went wrong. I clicked on the Xcode warning that said I should update the project settings to the current environment. I did this, and I think this is where everything went wrong and produced an executable that wouldn't start. That's a guess, but it seems right.
This is where I'd guess the problem is. Maybe we need to compare project settings files....
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Building 64-bit SheepShaver

Post by emendelson »

Wait - it turns out that a 64-bit build made in Xcode 9.4 on this new machine DOES run successfully. At first I couldn't make it start, then I kept making changes in the prefs file, and it finally runs.

For a while, it seemed that it needed Mac OS ROM in the same folder with SheepShaver.app, but that doesn't seem to be the case. Here is the .sheepshaver_prefs file that works for me:

Code: Select all

disk /Users/edward/Desktop/Macdisk.dsk
cdrom /dev/poll/cdrom
extfs /Users/edward/Desktop
screen win/1024/768
windowmodes 0
screenmodes 0
seriala 
serialb /dev/null
rom /Users/edward/Desktop/ROM
bootdrive 0
bootdriver 0
ramsize 134217728
frameskip 8
gfxaccel true
nocdrom true
nonet false
nosound false
nogui false
noclipconversion false
ignoresegv true
ignoreillegal true
jit true
jit68k false
keyboardtype 5
ether 
keycodes false
keycodefile 
mousewheelmode 1
mousewheellines 3
dsp /dev/dsp
mixer /dev/mixer
ignoresegv true
idlewait true
Ronald, I did nothing to the code before building it and making it work, but it does work. (And no, I never updated the project settings.)
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Building 64-bit SheepShaver

Post by emendelson »

As an experiment, I made a copy of the project file, opened it in Xcode, and updated the project settings. This caused an error when building, and I fixed the error by opening the project folder, editing the project.pbxproj file in a text editor and changing every instance of

CLANG_ENABLE_OBJC_WEAK = YES;

so that they read:

CLANG_ENABLE_OBJC_WEAK = NO;

The resulting build runs normally.

If there's a way to set this in the Xcode GUI, I'd be glad to hear about it...

And, by the way, every build produces hundreds of warnings, but the application certainly runs.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

Here the building process proceeds and succeeds as expected. Indeed a lot of warnings, but that has always been so when building SheepShaver with Xcode.

The resulting SheepShaver application is 64-bit only, but immediately quits on launch. And, yes, that happens when placed in the same folder where emendelson's 64-bit build runs fine. So the prefs settings should match.

I never updated the Xcode project settings either. In fact, I never got a message (like apparently emendelson got) that the settings needed updating.

I opened a copy of the project.pbxproj file in BBEdit and searched for the string "CLANG_ENABLE_OBJC_WEAK". Found no such string.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

Cat_7 just sent me a working 64-bit SheepShaver build from kanjitalk755/macemu source that he built successfully with Xcode 9.2 after he let Xcode update the settings. Mystery, mystery.
Last edited by Ronald P. Regensburg on Thu Jun 07, 2018 7:41 am, edited 1 time in total.
Reason:  
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Building 64-bit SheepShaver

Post by emendelson »

KanjiTalk755 has fixed the clipboard problem, and we now have a working 64-bit SheepShaver:

viewtopic.php?f=20&t=9613&p=59891#p59890
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Building 64-bit SheepShaver

Post by adespoton »

Wow! Good work everyone...

Just a reminder to those not following this progress, the 64-bit builds do not include working JIT, so if you have JIT enabled in your prefs, it will fail to run.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Building 64-bit SheepShaver

Post by Cat_7 »

I believe the jit works? It doesn't crash when enabled at my place.

I just built the latest code with the clipboard fix. I do notice one thing, though: when I set colours to 256 I sometimes have a black screen flash when I hover over the colour options in the control strip or when I move the mouse in the apple menu and the entry has a submenu.

And one funny thing: in the preferences editor the screen width (when above 1000) is displayed as 1.024. This can lead to boots with a width of only 1. Perhaps this is an incompatibility between the stand-alone prefs editor and the built-in one.

Testbuild here:
http://www.open.ou.nl/hsp/downloads3/Sh ... 062018.zip

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Building 64-bit SheepShaver

Post by emendelson »

JIT works here too.

Was the warning about JIT based on actual experience with this new build, or an assumption based on other builds that aren't relevant to this thread?
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Building 64-bit SheepShaver

Post by adespoton »

It was based on the older KanjiTalk builds. If JIT is working on this build, that's impressive.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

Cat_7 wrote:And one funny thing: in the preferences editor the screen width (when above 1000) is displayed as 1.024. This can lead to boots with a width of only 1. Perhaps this is an incompatibility between the stand-alone prefs editor and the built-in one.
I noticed that too. The notation 1.024 is certainly not normal, also not for the built-in prefs editor. It happens only with these builds. I use width 1280. In the preferences window it appears as 1.280 instead of 1280. If I then save the settings, the width is saved in the prefs file as "1". "screen win/1280/800" becomes "screen win/1/800"

In the meantime, whatever I try, I cannot build a functional SheepShaver. Either the build fails or the resulting application quits on launch. I really do not know what I could be doing wrong. Maybe someone can give me a step by step how to build from kanjitalk755 source with Xcode 9.4.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Building 64-bit SheepShaver

Post by emendelson »

This sounds counter-intuitive, but try this:

In Xcode, Preferences, Locations, make sure that the Command Line Tools are actually installed.

I've seen odd problems result when they aren't.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

It says: Command Line Tools: Xcode 9.4 (9F1027a)
and below that in light grey: /Applications/Xcode.app
Nothing more shows up when I click the up and down arrows. Should it show more?

(After each Xcode update I am asked to do additional installs that I allow to proceed.)
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

Well, I finally succeeded in building a 64-bit SheepShaver. As always, I started routinely with:
cd into the SheepShaver folder and do "make links"
Apparently I should not do that now (anymore?).

I find two issues with the build from kanjitalk755/macemu source :

1. The issue, mentioned above, where in preferences editor a window size of 1000 and larger is displayed as, e.g., 1.280 which results in a window size of one pixel when saved to the prefs file.

2, An issue that was solved with the last commit in cebix/macemu :
"Mac GUI: don't show /dev/poll/cdrom if it is configured as cdrom"
https://github.com/cebix/macemu/commit/ ... 5a9beac83f
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Building 64-bit SheepShaver

Post by kanjitalk755 »

Cat_7 wrote:I just built the latest code with the clipboard fix. I do notice one thing, though: when I set colours to 256 I sometimes have a black screen flash when I hover over the colour options in the control strip or when I move the mouse in the apple menu and the entry has a submenu.
This problem didn't reproduce on my environment.
It might be SDL1.2 issue.
Cat_7 wrote:And one funny thing: in the preferences editor the screen width (when above 1000) is displayed as 1.024. This can lead to boots with a width of only 1. Perhaps this is an incompatibility between the stand-alone prefs editor and the built-in one.
Fixed.
Ronald P. Regensburg wrote: 2, An issue that was solved with the last commit in cebix/macemu :
"Mac GUI: don't show /dev/poll/cdrom if it is configured as cdrom"
Merged upstream. Fixed.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

Nice! Thanks for the quick responses. If it's OK with you, I will post a 64-bit build from your source as a new test build, after making a couple of appropriate edits to the Info.pist file.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Building 64-bit SheepShaver

Post by kanjitalk755 »

OK, please publish the build.
Evertype
Student Driver
Posts: 16
Joined: Tue Sep 08, 2009 7:54 am
Location: Dundee

Re: Building 64-bit SheepShaver

Post by Evertype »

A small request. Can version numbering be used more precisely? If I get info on the 01 February 2014 build, it says in the Get Info box that the version is 2.4 (2014-02-01). Within the app in About Sheepshaver it says Version 2.4.20140201 (2.4).

If I get info on the Februayi 2014 build with SDL patch, in Get Info the version is "--". Within the app in About Sheepshaver it says Version 2.4.20140201 (2.4).

Can't that be 2.4.1? Or 2.4.20140201.1 ?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Building 64-bit SheepShaver

Post by Ronald P. Regensburg »

A agree it is confusing. The source code is version 2.4 since many years and through various feature improvements. I am not the person to change that. To be able to discern the builds, I add the build date to the version number. Both builds you mention were built on February 1st, 2014. Short version number: 2.4.20140201, Get info version: 2.4 (2014-02-01). The one with the SDL patch is still the same build with the very same executable inside, but with the SDL framework replaced manually inside the application package. They should both show the same version Info. If Finder Info shows "--", it is because the Finder has not yet picked up the Get Info string.

Others do not usually add something to the version number, all their builds are just version 2.4.

You will see that my newer builds have a more recent build date added to the version number.
Last edited by Ronald P. Regensburg on Sun Jun 10, 2018 7:44 pm, edited 1 time in total.
Reason:  
Post Reply