[MacPorts] #64146: rust on Mac OS 10.6.8?

MacPorts noreply at macports.org
Mon Dec 6 13:20:33 UTC 2021


#64146: rust on Mac OS 10.6.8?
-------------------------+--------------------
 Reporter:  catap        |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  ports        |    Version:
 Keywords:               |       Port:
-------------------------+--------------------
 Here a ticket that prevents my work to be forgotten.

 I feel that with some future work rust can run on macOS 10.6.

 I think that it is possible to support rust on macOS 10.6. It can use
 MacPorts' llvm/clang to compile that overstep mussed on this system thread
 local features.

 Anyway, the question is how to run some rustc to build a nice one.

 My current code is available here: https://github.com/catap/macports-
 ports/tree/rust-macOS-10.6 and it discovered that dynamicly linked thread
 local functions and variables can't work on 10.6 because dyld don't load
 it :)

 The condition https://github.com/apple-open-
 source/macos/blob/10.6.8/dyld/src/ImageLoaderMachOCompressed.cpp#L567
 prevents from it.

 I have no idea how to overwritede this function which is statically linked
 inside dyld.

 Anyway, this recent features and if try rust before it, anything before
 https://github.com/rust-
 lang/rust/commit/641d3b09f41b441f2c2618de32983ad3d13ea3f it can be load by
 10.6.

 Anyway, 1.53.0 is crashed as
 {{{
 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
 0x00000001c528dbde in
 std::sys_common::thread_info::ThreadInfo::with::_$u7b$$u7b$closure$u7d$$u7d$::h126ae42a0a4323c8
 ()
 (gdb) bt
 #0  0x00000001c528dbde in
 std::sys_common::thread_info::ThreadInfo::with::_$u7b$$u7b$closure$u7d$$u7d$::h126ae42a0a4323c8
 ()
 #1  0x00000001c528f197 in std::panicking::default_hook::hda3cfa32e0773aac
 ()
 #2  0x00000001c528ff55 in
 std::panicking::rust_panic_with_hook::h1cdaa4b48d8ea4a1 ()
 #3  0x00000001c528fa69 in
 std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::h51157b4dbc4c5d91
 ()
 #4  0x00000001c528c0d8 in
 std::sys_common::backtrace::__rust_end_short_backtrace::h8f7fee8b4c5a0c05
 ()
 #5  0x00000001c528f9fa in rust_begin_unwind ()
 #6  0x00000001c531dfaf in core::panicking::panic_fmt::h28a37220b8fae52a ()
 #7  0x00000001c531df07 in core::panicking::panic::hc0de1ec470c25a9a ()
 #8  0x00000001c528dde9 in
 std::sys_common::thread_info::set::hc916da4382f84dce ()
 #9  0x00000001c5290399 in std::rt::lang_start_internal::h37583e1fa93097c4
 ()
 #10 0x00000001bd7f2bb9 in main ()
 (gdb)
 }}}

 and additional digging shown that this is again thread local function
 which is shared accross libraries.

 The next logical step is try to use static build of rustc. Static here
 means static linked with rust std and rustc-driver.

 I can produce it by hand and test it, but if it work I still have no idea
 how to bootstrap it on 10.6, because if I hardcde rust 1.57.0 for example,
 in few releases 10.6 will be broken again.

 :(

-- 
Ticket URL: <https://trac.macports.org/ticket/64146>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list