static_assert failed "fCounter must be aligned within JackAtomicState"
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:
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
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.