Building Sunfish
Phil Pemberton (7989) 71 posts |
Has anyone succeeded in building Sunfish from source code? I’ve had a bunch of issues with the Perl side of things refusing to run inside Make (ran those build commands and the CMHG ones manually), which were easy to work around. Now I’m having an issue where portmapper-calls.c fails to compile because there are conflicting definitions of EDOM, ERANGE, EILSEQ, EOVERFLOW and EFBIG. I’ve also been unable to use the version of Subversion available through Packman to check the code out — it complains about the URL scheme for the server URL being unsupported (URL is http://svn.cp15.org/NFS/) My goal is to get this building and see if I can figure out why it keeps crashing on my Pi. Cheers, |
Chris Mahoney (1684) 2165 posts |
Try this one. It’s the previous version of Subversion (which at least works with my local server), patched for ARMv8 using PatchSWP. |
Tristan M. (2946) 1039 posts |
If you get it built, please post how! I feel every person and their pet had their own variant on a build system. |
Chris Gransden (337) 1207 posts |
I just tried building the Sunfish front end with the GCCSDK autobuilder and it still built OK. It’s only the Sunfish front end that has problems. I tracked it down to a bug in the RTK library the Sunfish front end uses. It’s in C++ so couldn’t work out how to fix it. !MoonFish and the SunFish module seem to work fine on RISC OS 5. |
Chris Gransden (337) 1207 posts |
It’s always the same stack trace.
|
Phil Pemberton (7989) 71 posts |
Ahh, I’ve been trying to build it natively on a Raspberry Pi, not the GCCSDK builder. I have no idea what kind of environment the autobuilder even provides. Seems like adding some debug to RTK might be the way to go. |
Chris Gransden (337) 1207 posts |
I managed to get everything to build natively. I’ve created a zip file with everything needed to get it to build including the RTK library. I can make it available for download if you are still interested. |
Phil Pemberton (7989) 71 posts |
@Chris – very much so! Please let me know where it’s available, either here or by email (philpem at gmail). Cheers! |
Tristan M. (2946) 1039 posts |
Chris, I saw your modification in the autobuilder script. tbqh the only reason I saw is it it refuses to download your patch because of an invalid certificate. Hopefully whatever is causing that passes.. |
David Pitt (3386) 1248 posts |
Resolving <a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a> (<a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a>)... 107.170.139.70 Connecting to <a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a> (<a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a>)|107.170.139.70|:80... connected. HTTP request sent, awaiting response... 302 Found Location: <a href="https://www.cgransden.co.uk//sunfish.zip">https://www.cgransden.co.uk//sunfish.zip</a> [following] --2020-04-26 06:56:24-- <a href="https://www.cgransden.co.uk//sunfish.zip">https://www.cgransden.co.uk//sunfish.zip</a> Connecting to <a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a> (<a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a>)|107.170.139.70|:443... connected. ERROR: no certificate subject alternative name matches requested host name ‘<a href="http://www.cgransden.co.uk’">www.cgransden.co.uk’</a>. To connect to <a href="http://www.cgransden.co.uk">www.cgransden.co.uk</a> insecurely, use `--no-check-certificate'. Package Sunfish: ***Failure*** Build for package "Sunfish" failed The `—no-check-certificate’ suggestion given works. In SetVars PATCH_URL="http://www.cgransden.co.uk/${PATCH_ZIP} --no-check-certificate" The build completes successfully but !Sunfish crashes as described. |
Chris Gransden (337) 1207 posts |
I’ve updated the setvars file so there is no longer a certificate error. |
Tristan M. (2946) 1039 posts |
So that was the magic place to add —no-check-certificate. |
Dave Higton (1515) 3526 posts |
I get shedloads of ZeroPain errors from the Moonfish module (offset 00025344). It would be nice to stop them. I can’t understand the makefiles – they look far too clever for their own good. I’ve discovered that perl on Ubuntu will execute the required commands (although I don’t understand them, they populate the ‘auto’ directory, albeit with /c and /h suffixed filenames). |
Dave Higton (1515) 3526 posts |
Has anyone looked at the ZeroPain errors that appear when a remote client reads a file served up by Moonfish? The error is caused by the middle of these three instructions: CMP R0,#0 LDR R12,[R0,#32] CMNNE R1,#1 Check if R0 is 0, then load from R0 + 32, then do something conditionally on the result of checking R0? What is this? The ZeroPain error occurs because R0 is 0 at the time. I can only see one assembly language file with any code in it, and the above code isn’t from it – it’s nowhere near it in the module. It has to be compiler-generated. |
Colin (478) 2433 posts |
Does the module have function names embedded in it? If so you can dump the file in stronged and search for What does it compile with? In AcornC/C++ if the CModule makefile is used you need
before including CModule to embed function names in the code. The |
Dave Higton (1515) 3526 posts |
Yes! I didn’t realise. It’s in state_getlockrange. Two of the parameters are uint64_t. How are they passed in?
In theory it compiles with either Acorn C/C++ or GCC, but AFAIK no-one in recent history has managed to compile it. If you manage it, you might well make a lot of people happy. |
Dave Higton (1515) 3526 posts |
Here are the first few lines of function state_checklocks: struct lock_stateid *current = file->lock_stateids; struct lock_owner *lock_owner = NULL; if ((file == NULL) || (stateid == STATEID_ANY)) return NFS_OK; So it can be called with file == NULL, but it has already referenced file→lock_stateids. There are some function labels in the file, but not all: the previous and the next functions’ labels are there, but state_checklocks’s label isn’t. |
David J. Ruck (33) 1635 posts |
I’m having same problem with Perl from the as Phil in the first post. I managed to get Sunfish to build a couple of months ago (with the intention of making it worked for untyped files, so my backups work properly), but then got distracted by other things, and updated a lot of software. I now can’t get it to build anymore. AMU starts by running the Perl script which hangs (even left overnight), the same as if I run it from a TaskWindow. That’s using Perl 5.14.2 on my ARMx6 RO 5.27rc16, which otherwise works properly (at least for all my crusty Perl code), athough it wont run on a Pi 3B, so I suspect there is something wrong with it. I’ve tried 5.8.8 and 5.8.8-1 and they fail immediately with “UnixLib detected recursion of signal SIGSEGV”. Any ideas? |
Dave Higton (1515) 3526 posts |
I used Perl on a Linux box to do the processing. It happened very quickly. My best suggestion is to do the same, copy the processed files over, and remove the Perl steps from the makefiles. Looking at the source files and the processed results, I don’t understand why there was an indirect step in the build process. I’d have expected to just provide the processed files as source. |
Chris Gransden (337) 1207 posts |
It’s built with an old UnixLib that contains the SWP instruction which causes it to hang. I can rebuild it with current UnixLib. |
David J. Ruck (33) 1635 posts |
That would be great, and please remove the spurious !Perl.perl as !Perl.bin.perl is the copy of the interpreter which is actually run. When that is patched to removed SWPs, it does run on the Pi 3B and 3B+. |
David J. Ruck (33) 1635 posts |
I’m not having any luck trying to build this on RISC OS.
This was only supposed to be a mornings job, but its taken days to find the right Perl, and lots of buggering around an uncooperative makefile. |
David J. Ruck (33) 1635 posts |
Right finally got the modules to build. I had to:-
That wasn’t much fun. |
Dave Higton (1515) 3526 posts |
Well done! That’s an important success to chalk up. Once you’ve caught your breath, I hope you have equal success on the front ends. |
Tristan M. (2946) 1039 posts |
Careful. Solving this might unravel the fabric of the universe. Is it just me or are so many RO programs protected by obfuscated build procedures? This is great news. No pressure, but I hope it leads to a build of Sunfish that is somewhat less explodey. |