Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 11 tools can't build CCL #271

Closed
xrme opened this issue Dec 31, 2019 · 4 comments
Closed

Xcode 11 tools can't build CCL #271

xrme opened this issue Dec 31, 2019 · 4 comments

Comments

@xrme
Copy link
Member

xrme commented Dec 31, 2019

The Xcode 11 developer tools can't build CCL. The problem seems to be regressions in the assembler.

Steps to reproduce:

cd lisp-kernel/darwinx8664
make clean
make
      ../x86-spentry64.s:1184:suffix or operands invalid for `movq'
      ../x86-spentry64.s:1184:4294967291 shortened to 251
      ../x86-spentry64.s:1190:suffix or operands invalid for `movq'
      ../x86-spentry64.s:1190:4294967291 shortened to 251
      ../x86-spentry64.s:1205:suffix or operands invalid for `movq'
      ../x86-spentry64.s:1205:4294967291 shortened to 251
      ../x86-spentry64.s:1211:suffix or operands invalid for `movq'

Bruce O'Neel made a small test case that shows the problem:

/* assemble with as -Q -g -arch x86_64 bus.s */
  
/* fails with assembler included with Xcode 11 -- Xcode 11.1.2 at least */

/* works on Xcode 10.3 or earler */

        node_size = 8
        dnode_size = 16
        num_subtag_bits = 8
        subtag_shift = num_subtag_bits
        ntagbits = 4
        fulltag_misc = 13
        misc_bias = fulltag_misc
        fulltag_nodeheader_0 = 5
        subtag_catch_frame = (fulltag_nodeheader_0 | (2 << ntagbits))
misc_header_offset = -fulltag_misc
misc_header_offset_neg = fulltag_misc
misc_data_offset = misc_header_offset+node_size /* first word of data    */
misc_subtag_offset = misc_header_offset       /* low byte of header   */

        .text
        .align 2
        .p2align 3

        .globl junk
junk:
        /* movq %rax,misc_data_offset(%rsi) */
        /* should all be the same */
        movq %rax,-5(%rsi)
        movq %rax,-13+8(%rsi)
        movq %rax,-13+node_size(%rsi)
        movq %rax,-fulltag_misc+node_size(%rsi)
        movq %rax,misc_header_offset_neg+node_size(%rsi)
        movq %rax,-misc_header_offset_neg+node_size(%rsi)
        movq %rax,node_size+misc_header_offset(%rsi)
        /* fails */
        movq %rax,misc_header_offset+node_size(%rsi)
        ret

I submitted a bug report to Apple on https://feedbackassistant.apple.com: FB7464217. Bruce submitted one also: FB7515029.

In the long term, CCL needs to change so that the LLVM assembler can be used, but this is a clear bug/regression in the older GNU assembler (which is what as -Q gives you).

As a workaround, you can install an earlier version of Xcode (such as 10.2). Move it to /Applications as Xcode-10.2.app (you can safely have multiple versions of Xcode installed), and select it with xcode-select -s /Applications/Xcode-10.2. The Xcode 10.2 tools can build the CCL lisp kernel.

@tomio-arisaka
Copy link

Xcode 11.3.1 assembler does not support the ccl assembly code.
But if you use MacPorts, you can assemble the ccl assembly code.
https://www.macports.org

$ sudo port install clang-9.0
$ sudo port install cctools

$ which as
/opt/local/bin/as
$ 
$ /opt/local/bin/as --version
clang version 9.0.1 
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-9.0/bin
$ 

After that, you can build CCL on macOS Catalina 10.15.3.

tomio-arisaka added a commit to tomio-arisaka/macports-ports that referenced this issue Feb 24, 2020
* Update to version 1.11.8.
  <https://github.com/Clozure/ccl/releases>
* Add the 'ide' variant on macOS. It builds the Clozure CL IDE.
  (/Applications/MacPorts/Clozure CL64.app)
  <https://ccl.clozure.com/docs/ccl.html#the-clozure-cl-ide>
* Avoid an issue of the some versions of Xcode (later than 10.2).
  <Clozure/ccl#271>
* Avoid an error which occurs due to (ccl:rebuild-ccl :full t)
  on macOS Catalina.
* Fix two issues on macOS Catalina.
  <Clozure/ccl#278>

Closes: https://trac.macports.org/ticket/57680
Closes: https://trac.macports.org/ticket/59870
@xrme
Copy link
Member Author

xrme commented Mar 26, 2020

Xcode 11.4 just came out. It appears to include a fixed assembler, because the included developer tools can now build CCL.

@xrme xrme closed this as completed Mar 26, 2020
@easye
Copy link

easye commented Apr 7, 2020

Xcode 11.4 just came out. It appears to include a fixed assembler, because the included developer tools can now build CCL.

Xcode 11.4 doesn't support Mojave? A point release dropping support for the previous version of macOS? Very unhappy with AAPL…

@eschaton
Copy link

eschaton commented Apr 7, 2020

For much of the past decade, the spring release of Xcode is where support for running on the previous OS is dropped. There are significant technical reasons that things are this way and it happens every year so it shouldn’t be unexpected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants