orc issueshttps://gitlab.freedesktop.org/gstreamer/orc/-/issues2024-01-29T11:11:40Zhttps://gitlab.freedesktop.org/gstreamer/orc/-/issues/59Build failure with -std=c99 on arm64 Macs due to assembly syntax2024-01-29T11:11:40ZRyan Carsten SchmidtBuild failure with -std=c99 on arm64 Macs due to assembly syntaxHello, [MacPorts users report](https://trac.macports.org/ticket/69206) being unable to build orc 0.4.35 on macOS with Apple Silicon / arm64 / aarch64 processors.
The error is:
```
../orc-0.4.35/orc-test/orctest.c:68:22: error: expected...Hello, [MacPorts users report](https://trac.macports.org/ticket/69206) being unable to build orc 0.4.35 on macOS with Apple Silicon / arm64 / aarch64 processors.
The error is:
```
../orc-0.4.35/orc-test/orctest.c:68:22: error: expected ')'
asm("msr FPCR, %0" : : "r" (fpcr_value));
^
../orc-0.4.35/orc-test/orctest.c:68:6: note: to match this '('
asm("msr FPCR, %0" : : "r" (fpcr_value));
^
1 error generated.
```
The code in question is here:
https://gitlab.freedesktop.org/gstreamer/orc/-/blob/887392103956a8733a750c4442e2664d5c26527d/orc-test/orctest.c#L67-73
Perhaps this is GNU-specific assembler syntax. We are compiling with clang, as is customary on macOS. Clang does define `__GNUC__`.https://gitlab.freedesktop.org/gstreamer/orc/-/issues/44Follow-up from "Fix build on iOS simulator"2023-02-03T17:02:28ZTim-Philipp Müllertim@centricular.comFollow-up from "Fix build on iOS simulator"The following discussion from !78 should be addressed:
- [x] @kleisauke started a [discussion](https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/78#note_1629043):
> ```suggestion:-6+0
> cdata.set('HAVE_PTHREAD_JIT'...The following discussion from !78 should be addressed:
- [x] @kleisauke started a [discussion](https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/78#note_1629043):
> ```suggestion:-6+0
> cdata.set('HAVE_PTHREAD_JIT', cc.has_function('pthread_jit_write_protect_np', prefix: '#include <pthread.h>'))
> ```
> Would probably fix this as well. See for example: https://github.com/mesonbuild/meson/pull/11011.
>
> In short, it's a known Meson issue (https://github.com/mesonbuild/meson/issues/3482) that compiling with a new XCode toolchain while targeting an older macOS version (e.g. with the `MACOSX_DEPLOYMENT_TARGET=10.9` env) causes some functions to be incorrectly detected as available. This can be fixed by passing the `prefix: '#include <...>'` argument to the `cc.has_function()` call.
>
> This was originally reported at https://github.com/lovell/sharp/issues/3438.https://gitlab.freedesktop.org/gstreamer/orc/-/issues/43Build failure on iOS: "pthread_jit_write_protect_supported_np is unavailable:...2022-10-31T16:55:33ZTim-Philipp Müllertim@centricular.comBuild failure on iOS: "pthread_jit_write_protect_supported_np is unavailable: not available on iOS"From [cerbero cross-ios universal build](https://gitlab.freedesktop.org/tpm/cerbero/-/jobs/30736359):
```
../orc/orccompiler.c:132:7: error: 'pthread_jit_write_protect_supported_np' is unavailable: not available on iOS
pthread_jit_...From [cerbero cross-ios universal build](https://gitlab.freedesktop.org/tpm/cerbero/-/jobs/30736359):
```
../orc/orccompiler.c:132:7: error: 'pthread_jit_write_protect_supported_np' is unavailable: not available on iOS
pthread_jit_write_protect_supported_np());
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk/usr/include/pthread.h:565:5: note: 'pthread_jit_write_protect_supported_np' has been explicitly marked unavailable here
int pthread_jit_write_protect_supported_np(void);
^
../orc/orccompiler.c:460:3: error: 'pthread_jit_write_protect_np' is unavailable: not available on iOS
pthread_jit_write_protect_np(0);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk/usr/include/pthread.h:561:6: note: 'pthread_jit_write_protect_np' has been explicitly marked unavailable here
void pthread_jit_write_protect_np(int enabled);
^
../orc/orccompiler.c:479:3: error: 'pthread_jit_write_protect_np' is unavailable: not available on iOS
pthread_jit_write_protect_np(1);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk/usr/include/pthread.h:561:6: note: 'pthread_jit_write_protect_np' has been explicitly marked unavailable here
void pthread_jit_write_protect_np(int enabled);
^
3 errors generated.
```0.4.33