supranational / blst

Multilingual BLS12-381 signature library
Apache License 2.0
454 stars 171 forks source link

Rust bindings broken on Mac Sonoma 14.5. #221

Closed wyattbenno777 closed 1 month ago

wyattbenno777 commented 1 month ago

If you try to use blst as a dependency on the newer mac OS 14.5 you get an error not 4 byte aligned

To reproduce run:

sudo cargo build --release

With blst as a dependency in your cargo.toml. If you are running on the above OS you will get an error.

Error log: ld: '___blst_platform_cap' from '/project/target/aarch64-apple-darwin/release/deps/libblst-95e3c070fc3bc4ad.rlib[16](946f8b581cbe3ca9-assembly.o)' not 4-byte aligned, which cannot be encoded as a target of LDR/STR in '<anon>' from '/project/target/aarch64-apple-darwin/release/deps/libblst-95e3c070fc3bc4ad.rlib[16](946f8b581cbe3ca9-assembly.o)' final section layout: __PAGEZERO addr=0x00000000, size=0x100000000, fileOffset=0x00000000 __TEXT addr=0x100000000, size=0x01874000, fileOffset=0x00000000 __text addr=0x100001000, size=0x01200494, fileOffset=0x00001000 __stubs addr=0x101201494, size=0x00000e40, fileOffset=0x01201494 __init_offsets addr=0x1012022d4, size=0x0000000c, fileOffset=0x012022d4 __gcc_except_tab addr=0x1012022e0, size=0x000eeff8, fileOffset=0x012022e0 __const addr=0x1012f2000, size=0x00292df8, fileOffset=0x012f2000 __cstring addr=0x101584df8, size=0x0002c48c, fileOffset=0x01584df8 __unwind_info addr=0x1015b1284, size=0x0006dd18, fileOffset=0x015b1284 __eh_frame addr=0x10161efa0, size=0x002547a0, fileOffset=0x0161efa0 __DATA_CONST addr=0x101874000, size=0x00138000, fileOffset=0x01874000 __got addr=0x101874000, size=0x00000a70, fileOffset=0x01874000 __const addr=0x101874a70, size=0x001342e0, fileOffset=0x01874a70 __DATA addr=0x1019ac000, size=0x00018000, fileOffset=0x019ac000 __data addr=0x1019ac000, size=0x00013c20, fileOffset=0x019ac000 __thread_vars addr=0x1019bfc20, size=0x00000318, fileOffset=0x019bfc20 __thread_data addr=0x1019bff38, size=0x00000070, fileOffset=0x019bff38 __thread_bss addr=0x1019bffa8, size=0x00000431, fileOffset=0x019bffa8 __bss addr=0x1019c03e0, size=0x00001a70, fileOffset=0x00000000 __common addr=0x1019c1e50, size=0x00000188, fileOffset=0x00000000 __LINKEDIT addr=0x1019c4000, size=0x008d4000, fileOffset=0x019c4000 clang: error: linker command failed with exit code 1 (use -v to see invocation)

dot-asm commented 1 month ago

Github runner runs macOS 14.5 and tests pass. So the first question you should ask is what's the difference between your computer and presumably vanilla MacOS installation in the github CI farm. I mean it sounds more like a problem with your installation than with blst itself. This is not to say that making adjustments in blst is out of the question, but the root of the problem has to be identified... The error shouldn't have occurred, because all assemblers were observed to align common symbols at their sizes, and since the size is specified for the variable in question, it should be aligned accordingly... Besides, ARM ldr is specified to be able to handle misaligned address, so what's up with the error to begin with?

wyattbenno777 commented 1 month ago

Found the issue. It was with another repo thanks for checking and proving info @dot-asm