Repository navigation
Intel macos support - #407
Merged
Merged
Conversation
The x86-64 .s kernels used ELF-only directives, so the library did not build on Intel Macs. Select Mach-O directives with .ifdef BEMAN_BIG_INT_MACHO, defined by CMake for Apple targets. ELF output is unchanged.
Member
|
In principle this seems fine. Once the CI cycles I can look into what the two segfaults are (assuming they appear in the CI). |
Member
|
I see what you're saying now; I thought you meant segfault as though we had failing tests due to bad behavior. It's instead an ICE with these old versions of Clang. I think it's best if we just skip these tests on Intel Macs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The x86_64
.sassembly is written for ELF only, will not build on Intel Macs (Mach-O)To allow building on my Intel-based Mac:
CMakeLists.txtpasses an assembler symbolBEMAN_BIG_INT_MACHOon Apple targets.ifdefand.ifndefguards insrc/*_x86_64_*.susingBEMAN_BIG_INT_MACHOfor Mach-O vs ELF.type,.size,.note.GNU-stackand.section .textbeman_big_int_multiply_long_runtime_generic->_beman_big_int_multiply_long_runtime_generic.section .rodata->.section __TEXT,__conston Mach-O (IFMA files)jmp sym@PLT->jmp _symon Mach-O (square IFMA tail call)a small handful of other changes:
.align->.balign.alignmeans different things on x86_64 ELF vs x86_64 Mach-O, whereas.balignalways means byte align.align 64is 64 bytes on x86 ELF, but 2^64 on Mach-O.L*labels ->L*labelsinvalid CFI advance_loc expression.Llabels as symbols, these will be written to the object symbol table and cause function splits\param(multiply BMI2).altmacrohi->\hi,lo->\loAlternate routes are possible via capitalization of the file ending from
.sto.S(files go through C preprocessor).Testing
-march=native. I used Homebrew Clang 23 with thellvm-debug-modulepreset.llvm-debug-module, theto_charstest traps.CharconvString.ToCharsEmptyBufferIsValueTooLargehits a pre-existing debug assert (charconv.hpp:70)clang -target x86_64-linux-gnu;.text/.rodatais byte-identical to61b29f3for all 6 filesCI Runner
As of now this includes a
macos-15-intelApple Clang runner that can build the library including the assembly. Apple Clang on x86_64 will seg fault compiling at least two of the tests:multi_limb_construction.test.cppandnumeric.test.cpp. It can be taken out but perhaps may be of interest for others to see where it fails.