Recover support x86 and PowerPC Darwin

Bug #2033287 reported by Kirill A. Korinskiy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

Hi,

Here is a work I did with the support and help of Sergey Fedorov with the aim of bringing back support for PowerPC and x86 Darwin.

Originally it was made for 2.3.6, and was rebased to 2.3.7 and 2.3.8

This patch series mainly reverts things, but it also includes some fixes and introduced a compatibility with old Darwin.

For bootstrap I've used the last available SBCL:
 - 1.0.47 for ppc;
 - 1.1.6 for x86

Summary of changes:
1. Avoid using `clock_get_time` on macOS before 10.12;
2. Avoid using dispatch semaphores before 10.6 and on PowerPC;
3. Use libc `nanosleep` before 10.6 and on PowerPC;
4. fix thread support on PowerPC;
5. A few minor fixes like fixing a typo, skipping some tests, etc.

All of this allows to build SBCL with `--fancy` on macOS 10.5 and 10.6 as i386 and PowerPC.

Tests on i386 were done by me, and Sergey did the PowerPC part.

Threads is fully functional and allows pass https://github.com/sionescu/bordeaux-threads/ unit tests on target platforms.

I'm co-maintainer of SBCL port at MacPorts and ready to support changes in terms of testing and fixing if nessary, and Serey actively uses his PowerPC in real life and I hope that he is ready to test SBCL on PowerPC on Darwin.

P.S. This patch is already part of MacPorts port for PowerPC and i386, and MacPorts community has some active guys who really use their PowerPC in 2023.

Old discussion was started at github here https://github.com/sbcl/sbcl/pull/54.

Tags: patch review
Revision history for this message
Kirill A. Korinskiy (catap) wrote :

This is series of required patches as one single files which was produced via git format-patch --stdout

Revision history for this message
Charles (karlosz) wrote :

Hi,

Thanks for all the work on this. Our CI bootstraps on other hosts other than SBCL to check that things bootstrap right. I was unable to bootstrap with these changes on non-SBCL hosts;

On CLISP I get:

*** - SYSTEM::MAP-SYMBOLS: There is no package with name "SB-EXT"

Revision history for this message
Kirill A. Korinskiy (catap) wrote :

Charles,

I'm using very old SBCL to bootstrap it inside MacPorts.

I doubt that CLISP can be used to bootstrap SBCL. I've tried and it requires a lot of work inside both codebases I guess.

Revision history for this message
Charles (karlosz) wrote (last edit ):

I don't think I expressed myself clearly.

What I'm saying is that we use different hosts to bootstrap SBCL, and it is possible, since that's one of the things we check doesn't regress. I was going to merge your patches as is on master because they look good but the CI on github.com/sbcl/sbcl won't pass if this isn't fixed, as CLISP, CCL, and CMU CL are all tested as bootstrap hosts. You can build with any of these via ./make.sh clisp or ./make.sh ccl. The fix is fairly simple: Don't add any references to sb-ext: (or guard with #+sbcl).

One of the goals of SBCL is that it can be bootstrapped from other build hosts, not just from SBCL.

Revision history for this message
Charles (karlosz) wrote :

I think this is the only part of your change that prevents it from being bootstrappable from other hosts:

+;; The last available build of SBCL for PowerPC is 1.0.47
+;; and sb-ext:map-directory were introduced at 1.1.5
+(if (not (apropos-list "map-directory" 'sb-ext))
+ (quit))
+

This needs to be moved into the code block guarded by #+sbcl. You can see that there's a case for #+ecl above, becuase we build on other hosts too.

Revision history for this message
Kirill A. Korinskiy (catap) wrote :

Here the updated version of whole series.

I've added dedicated #+sbcl to this if, otherwise old SBCL will fail because (progn .. ) uses symbols which may not be available

Revision history for this message
Charles (karlosz) wrote :

OK, so after doing a cursory glance at the patches and checking it passes the CI, I've merged these to prevent further divergence. We can add any further commits on top if needed later.

Thanks for the contribution!

Revision history for this message
Charles (karlosz) wrote :

There is already some post-commit feedback on sbcl-devel. It would be great if you could follow any comments there and address them.

Revision history for this message
Kirill A. Korinskiy (catap) wrote :

Thanks for merging it.

Shall we close this bug?

Charles (karlosz)
Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.