boostorg / fiber

userland threads
464 stars 108 forks source link

Unbreak fiber for macOS PPC #306

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago

@olk Remember we were wondering why context was fixed but fiber failed? I preprocessed sources and found the cause. Of course this could not possibly work.

barracuda156 commented 1 year ago

Here are error we get with sources in fiber:

 /opt/local/bin/as -v -I . -arch ppc -o bin.v2/libs/fiber/build/darwin-12.2.0/release/threading-multi/visibility-hidden/algo/work_stealing.o bin.v2/libs/fiber/build/darwin-12.2.0/release/threading-multi/visibility-hidden/algo/work_stealing.s
Apple Inc version cctools-localbuild, GNU assembler version 1.38
bin.v2/libs/fiber/build/darwin-12.2.0/release/threading-multi/visibility-hidden/algo/work_stealing.s:2357:Parameter syntax error (parameter 1)

This is preprocessed source:

LVL172:
    .loc 22 66 21
; 66 "./boost/fiber/detail/spinlock_ttas.hpp" 1
    or 27,27,27
; 0 "" 2
    .loc 22 66 63

Bingo.

barracuda156 commented 1 year ago

@olk Could you review this please?

olk commented 1 year ago

@olk Could you review this please?

Unfortunately I don't own a Mac or PPC system.

Did you run the unit tests in the subdirectory?

barracuda156 commented 1 year ago

@olk Not yet, but here it is merely a matter of wrong assembler syntax. On macOS registers must be prefixed with r (or f for float), so the existing code fails to build, and cannot build unless this is fixed. (I fixed the same bug in Catch2, in Seqan3 and elsewhere. Pretty common.)

barracuda156 commented 1 year ago

@olk Could we merge this? Without it fiber simply does not build at all.

olk commented 1 year ago

ty