jack2 icon indicating copy to clipboard operation
jack2 copied to clipboard

static_assert failed "fCounter must be aligned within JackAtomicState"

Open ryandesign opened this issue 2 years ago • 2 comments

Describe the bug

JACK fails to build on macOS 10.12 and 10.13 with their older Apple Clang compilers:

error: static_assert failed "fCounter must be aligned within JackAtomicState"

But it builds fine both on macOS 10.14 and newer and on OS X 10.11 and older.

Environment

  • JACK Version: 0.9.21
  • Operating System: macOS 10.12 or 10.13
  • Installation: MacPorts

Steps To Reproduce

sudo port install jack

Expected vs. actual behavior

Expected successful compile but actually got:

In file included from ../common/JackTransportEngine.cpp:24:
In file included from ../common/JackEngineControl.h:25:
In file included from ../common/JackFrameTimer.h:24:
../common/JackAtomicState.h:135:13: error: static_assert failed "fCounter must be aligned within JackAtomicState"
            static_assert(offsetof(JackAtomicState, fCounter) % sizeof(fCounter) == 0,
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/JackFrameTimer.h:90:9: note: in instantiation of member function 'Jack::JackAtomicState<Jack::JackTimer>::JackAtomicState' requested here
        JackFrameTimer(): fFirstWakeUp(true)
        ^
1 error generated.

In file included from ../common/JackEngineProfiling.cpp:21:
In file included from ../common/JackGraphManager.h:28:
../common/JackAtomicState.h:135:13: error: static_assert failed "fCounter must be aligned within JackAtomicState"
            static_assert(offsetof(JackAtomicState, fCounter) % sizeof(fCounter) == 0,
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/JackFrameTimer.h:90:9: note: in instantiation of member function 'Jack::JackAtomicState<Jack::JackTimer>::JackAtomicState' requested here
        JackFrameTimer(): fFirstWakeUp(true)
        ^
1 error generated.

In file included from ../common/JackDebugClient.cpp:21:
In file included from ../common/JackEngineControl.h:25:
In file included from ../common/JackFrameTimer.h:24:
../common/JackAtomicState.h:135:13: error: static_assert failed "fCounter must be aligned within JackAtomicState"
            static_assert(offsetof(JackAtomicState, fCounter) % sizeof(fCounter) == 0,
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/JackFrameTimer.h:90:9: note: in instantiation of member function 'Jack::JackAtomicState<Jack::JackTimer>::JackAtomicState' requested here
        JackFrameTimer(): fFirstWakeUp(true)
        ^
1 error generated.

Logs from MacPorts automated build servers:

ryandesign avatar Jan 13 '23 03:01 ryandesign

I'm seeing this issue on macOS 10.13.6 with Xcode 10.1. Fresh install of macports 2.8.1. This gets in the way of installing python-rtmidi, even though rtmidi is buildable from scratch without jack. jack_bug.log

atalkingegg avatar Jun 25 '23 03:06 atalkingegg

For what it's worth, stock jack2-1.9.22 builds from source without hitting this error. /opt/local/bin/python3 ./waf configure --prefix=/usr/local /opt/local/bin/python3 ./waf build sudo /opt/local/bin/python3 ./waf install Perhaps fixing this could be just a version update thing.

atalkingegg avatar Jun 25 '23 04:06 atalkingegg