Welcome, Guest | Home | Search | Login | Register
Author Trying to compile Jabbernaut and need some help! (Read 125143 times)
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #45 on: April 11, 2024, 05:04

So copied over PowerPlant and Universal from CW8 to replace the CW6 equiv in my install...

Went back to the sources I had building (and working) in CW8...

Fixed headers, etc again...

And it builds for PPC, but STILL just quits.  I haven't put in any new debug printfs, but I'd be shocked if it isn't the same file io related issues...

Since I'm using the same Universal and PowerPlant, the most likely difference is MSL...or something more obscure.  I doubt it's the compiler itself...

So, I guess the next try would to build using the CW8 version of MSL.
Jatoba
256 MB
*****
Posts: 270
System 9 Newcomer!
View Profile
Reply #46 on: April 12, 2024, 14:29

Weird question, but is it worth considering trying to compile MSL / PowerPlant with something other than CodeWarrior? Perhaps even move the whole project away from CodeWarrior? Of course, only as a last resource...
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #47 on: April 12, 2024, 17:49

Hmm...hard to say what a good alternative to try would be, maybe Retro68?  (having to create Makefiles, yikes!)  Symantec was always behind CodeWarrior as far as supporting C++ standards...but wouldn't hurt to try.  My gut says that PowerPlant might not build on anything but CodeWarrior...

So, I tried copying the ENTIRE "MacOS Support" and "MSL" folders from CW8 to my CW6 install.  After rebuilding MacHeaders and (FINALLY, THIS TIME!) the precompiled headers Goliath uses (and not just #including everything), the compile is very clean with no changes at all needed...but I still get an app that quits immediately!

I'm going to take my ibook with CW8, where it builds a working version, and put it next to my CW6 machine and compare ALL the compiler settings.  Maybe something important and subtle got lost when I import the xml versions of the CW8 project files?

It'd have to be something like that, because ALL the source and libs are the same now, right?  The only other thing I can think of is that maybe the code CW6 generates for runtime exception handling is just different enough from CW8's to not work.

But first I'll put in debug printf's to make sure it really is the same issue with throws related to (spurious?) EOFs in file handling...
Last Edit: April 12, 2024, 17:51 by lauland
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #48 on: April 12, 2024, 19:08

Ok, same exact problem with exceptions in PowerPlant's LFile as I was getting before using CW8's "MSL" and "MacOS Support".  This is good news in that it means my build using a pure CW6 install was probably ok...and I'll try it again...why?  Because that way an m68k build still might be possible (CW8's MSL removed m68k support).

----

(Building for PPC using CW6 with CW8's "MSL" and "MacOS Support")

I tried commenting out a handful of throws in LFile and it actually starts and seems to work!  Shows the open site dialog, I can type info in and it tries to connect...I think...

Does anyone know a good site to test WebDav on?  I don't know of any off the top of my head, so I can't tell if it is REALLY working!

FYI here's the debug printf's...the names won't mean anything unless you look at the functions, but I wanted to show what was going on.  All the file io it is doing is for its prefs files...which it still doesn't seem to be able to create.

----

Staring mainthread
creating theApp
Going to create preferences
Going to init prefs
populateprefs
usedefaults
savetopreffile
dynbuffertofile
going to opendatafork
opendatafork, going to fspopendf
err is -43
going to throw
end of opendatafork
after opendatafork
got mhandlestream
going to writedatafork
writedatafork
before first throwifoser, err was -51
going to fswrite
before second throwifoserr, err was -22
after writedatafork
going to closedatafork
after prefs init
end of app constructor
Going to run
after run
End of main
Staring mainthread

-----

-43 is file not found...the prefs file doesn't exist yet...
-51 is "Reference number invalid" (so create file failed?)
-22 is "Driver ref num specifies NIL handle in unit table"


Last Edit: April 12, 2024, 19:37 by lauland
Knezzen
Administrator
512 MB
*****
Posts: 608

Village idiot
View Profile System 7 Today
Reply #49 on: April 13, 2024, 10:05

I can hook you up with a test server, lauland. I didn't get back until later on Hotline and you had disconnected.

I'll set it up later today or tomorrow (youngest kids birthday today) and get back to you :)
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #50 on: April 14, 2024, 04:49

Very cool!  (Happy Bday to kid!)

I checked and CW8 uses ppc strut alignment, so rebuilding with that.

So far:

PPC using CW8 MSL and MacOS Support: Builds and runs with (some) throws in LFile.c commented out. Doesn't need patching.

PPC using CW6 MSL and MacOS Support: Builds, but (mostly?) crashes even with equiv throws commented out.  Requires some patching.

M68k using CW8 MSL and MacOS Support: MSL doesn't have m68k version so probably won't work, but haven't tried.

M68k using CW6 MSL and MacOS Support: Compiles, but doesn't link.

----

I think MacOS X Server 10.x maybe supports WebDav.  I've got a mini running 10.4 server so that might be a good test case.


lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #51 on: April 14, 2024, 05:54

Enabled WebDav on my mini server and tested the Goliath build (PPC on CW6 with bits of CW8 as described before) and it works!

I'll try a build using CW6's MSL, and just CW8's PowerPlant next.

(So inching...slowly...towards an m68k build...)
Knezzen
Administrator
512 MB
*****
Posts: 608

Village idiot
View Profile System 7 Today
Reply #52 on: April 14, 2024, 11:58

Very cool!!!!! :D

Which version of Mac OS are you testing it with?
cballero
1024 MB
******
Posts: 1176
System 7, today and forever
View Profile
Reply #53 on: April 14, 2024, 22:31

WooHoo!!

Wow, Lauland, that was genius! You managed to build a perfectly running PPC version of Goliath! Well, just pending your WebDAV test :D
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #54 on: April 14, 2024, 23:37

I've been doing the work in Sheepshaver with 9.0.4, just tested it with actual file transfers and my mini and it completely works.  Extremely strange, it doesn't seem to use PowerPlant's LFile, etc classes for its regular file io, only its preferences files. 

Which STILL are failing with odd errors, so they aren't created.  (I can see it isn't calling LFile once it starts because there are no more debug printf's triggered).  This is so odd because I'm using CW8's PowerPlant and MSL...there's not much room for bugs remaining, other than: Goliath itself using PowerPlant in some weird way, or subtle compiler differences (which you wouldn't think...)

The goal remains: Goliath on m68k!

----

Tried a few other mutant CodeWarrior combos, all still PPC:

1) Just CW8's PowerPlant, but the rest of MacOS Support and MSL from CW6: Doesn't build, CW8 PowerPlant needs things in the newer Universal Headers, etc.

2) CW8's MacOS Support (inc PowerPlant), but CW6's MSL: Strangely gives redefined MSL symbols...going to try again and make sure I'm rebuilding all the predefined headers correctly I may have missed something.

Goliath patches (replaces) parts of PowerPlant, so any build not using CW8's is probably doomed (and required a bunch of patches of my own to even compile) so I'm abandoning those.

----

The idea is to use CW6's MSL, since it includes m68k support.  I'm going to work on those redefined MSL symbols next (#2 above).

Even if I do get that resolved, there's the link issues I ran into on m68k previously (using pure CW6)...the SSL related ones COULD be something goofy I'm doing, but the Unicode and Internet Config may be a problem...  CW8's MacOS Support includes PPC link libs for those but (of course) not m68k...and CW6 doesn't seem to have them either.  I'm thinking if I download the Unicode and Internet Config SDKs they may be there...

...but I seem to remember the Unicode encoder being part of 8.5 so m68k libs may not even exist.  In which case I'd have to REMOVE support in Goliath for an m68k version!  (Then again the Goliath's MG page says "8.1 or higher"?)

I'm going to try an m68k build anyway with CW8's MSL and MacOS Support and see if I get the same errors as with CW6's earlier.  It obviously won't link (no m68k MSL!), but maybe the SSL errors will go away?
Last Edit: April 14, 2024, 23:45 by lauland
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #55 on: April 15, 2024, 01:44

It looks like the problem with redefined symbols only happens with OpenSSL, and not davlib or Goliath itself (there are three projects and parts of building Goliath)...so I did something truly whacky, but it actually worked!

For OpenSSL, I used CW6's MSL and MacOS Support.
For davlib and Goliath itself I used CW8's MacOS Support, with CW6's MSL.

It did require tiny patches to about 4 lines (casting variable types), which I'd done before when trying pure CW6 builds.

And it builds and works!  I thought mixing the two MSL's would surely be a problem, but since OpenSSL is a lib, it was only using MSL's headers...but still...an insane thing to do.  I truly can't believe it worked.

I'm sure which versions of the CodeWarrior parts are being used because I removed MSL and MacOS Support from my CodeWarrior install completely, and instead the Goliath builds have their own (respective) copies in their folders.  I have separate build folders for each combo.

Going to get some dinner and then I'll try an m68k build using the same combo.  If I've been living right, the only problem will be linking missing m68k versions of Internet Config and Unicode Encoder libs...
cballero
1024 MB
******
Posts: 1176
System 7, today and forever
View Profile
Reply #56 on: April 15, 2024, 06:18

This is truly an impressive feat, Lauland :D

To give me some insight to the PPC build objectives (besides aiming for the m68k build of course!) what was missing and/or broken in the original Goliath PPC program? (if I had any clue about Mac programming, I would have seen the answer to my question in all of your detailed notes of your build progress itself!)
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #57 on: April 15, 2024, 15:08

cballero, I'm using the source archive from MG, download #3:
http://macintoshgarden.org/apps/goliath-101

The OpenSSL that it comes with is missing several files.  My guess is they weren't included because of import restrictions on crypto code.  I found the original copy of the same version and copied the files needed.

The original author used CW8, and it indeed builds fine with that.

One of the awesome guys here had said at one point that it'd be great if there was an m68k version of it, so I took up that challenge.

The trick is that CW6 was the last version that can build m68k apps.  So my first goal was to get a PPC build using that compiler.
Last Edit: April 15, 2024, 15:10 by lauland
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #58 on: April 15, 2024, 15:45

Success!  I've got a working m68k version of Goliath building...but it's quite kludgy.

1) The OpenSSL link errors were due to the missing files I had added, that weren't included in the original source archive.  I'd added them to the PPC project, but not the m68k one!

2) Icons are all blank and generic.  I had to add a cast on a dispose of a callback, and it might be wrong and causing this...

3) I disabled Internet Config requirements.  When I just returned false when it checks for it, it says "Internet Config 2.0 required" at launch.  So I always return true, but #ifdef __POWERPC__'d out the actual calls to it.  I have no idea what effect this has, and I'm not returning any dummy values.  I think the m68k linker lib is included in the IC SDK so I could prob try that...

4) I disabled Unicode Converter/Encoder requirements.  A lot of the calls are something like "filename=BlahConvertToSystemEncoding(filename);" and just #ifdef'd out.  Had to remove CDAVTranscodeUtils.*. There's one call where it uses it to go from UTF16 to UTF8 that I haven't replaced it, so it just gets a nulll string.  This is in certificate support, so that is broken, in some way.  Don't know the effect.

5) There's a call to ASN1_STRING_TO_UTF8 in pk12_kiss in OpenSSL that is #ifdef'd out and just gets a null string.  I think that'd only affect use of that particular crypto method.

6) davlib includes its own separate unicode converter functions (ConvertUTF8) and the two missing calls in #4 and #5 can probably use it.  It is probably more limited than the one MacOS (8.5?) comes with.

7) It still can't create its prefs file...but it DOES use PowerPlant's LFile to write files you copy, I can see it in the debug printf's, and it works.  No idea what's up with the prefs.

8 ) I had to use "large" for the memory model, and turn on far for everything possible, or I get "16 bit out of range".  Also 4 byte ints, and m68k 4 byte alignment.

9) It requires OpenTransport. Cw6's PowerPlant has MacTCP support, but CW8's doesn't.

10) Have only tested it in MacOS 9 in SheepShaver.  Tried it in MacOS 7.5.3 Basilisk and it says "Internet Config 2.0" required, so I missed a check someplace!

UPDATE: Installed Internet Config 2.0 and Appearance Manager on Basilisk 7.5.3, and it starts but only shows some debug printfs and then quits.  It MIGHT work on 8.0...

----

I could take the debug printf's out and upload it to MG, as it is (probably?) useful to at least some m68k people as is.  I'd like to fix the issues (especially missing Unicode where its just returning null strings), but now that it builds and actually (at least mostly) works, don't know when I'll get around to it.

Ideally, someone else could finish it and I could move on to other projects, like m68k Jabbernaut, as I've done all the heavy lifting (aka the "fun" part).
Last Edit: April 15, 2024, 17:36 by lauland
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #59 on: April 15, 2024, 16:57

Uploaded to https://github.com/laulandn/goliath_m68k

I did an initial commit of the original cw8 sources, and then all my changes for cw6 on top, so you can see the diffs via those commits ("initial commit" vs "changes for m68k").

Includes "MacOS Support" (cw6 version for openssl and cw8 version for everything else) and "MSL" (cw8) needed to build.  The project files use those, so it will build with an unmodified cw6 install.

https://github.com/laulandn/goliath_m68k/blob/main/goliath_m68k.zip
This is my raw build folder with binaries for the app (in "davgoliath/Output"), the built libs and all CodeWarrior intermediates ("Data") folders.  Everything.
(Zipped on MacOS 10.14, so only use an unzipper that understands that format)

NOTE1: The app in the zip still has all the debug printfs, so it opens an extra window (showing startup and file related function calls), menus will be doubled, and you have to Command-Q twice (to get out of the SIOUX console).  I don't recommend actually using this for ANYTHING except to test it works.

NOTE2: github strips Mac file type/creator and resource forks, so you (probably) can't build it from just the repo.  If you actually want to build it, download the zip.

NOTE3: This is just a snapshot of my work-in-progress and not an "official release" or anything grandiose.
Last Edit: April 15, 2024, 17:19 by lauland
Pages: 1 2 3 [4] 5 6

© 2021 System7Today.com.
The Apple Logo, Macintosh™, Mac OS™, and others property of Apple Computer, Inc.
This site is in no way affiliated with Apple Computer, Inc.