New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compile error on ARM and GCC < 4.1.0 #46
Conversation
Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with old versions of GCC that do not have atomic ops builtins on platforms where there is no native ethread implementation (e.g. ARM): In file included from ../include/internal/gcc/ethread.h:29, from ../include/internal/ethread.h:354, from beam/erl_threads.h:264, from beam/erl_smp.h:27, from beam/sys.h:413, from hipe/hipe_mkliterals.c:29: ../include/internal/gcc/ethr_membar.h:49:4: error: #error "No __sync_val_compare_and_swap" This patch adds a header guard in "gcc/ethread.h", as is present in "libatomic_ops/ethread.h".
Patch has passed first testings and has been assigned to be reviewed |
We will be running this through some more exhaustive tests and if they pass it will be merged for release in R16B02. Please note however that I will be merging this branch as well, which will mean that you have to explicitly tell configure that you intend to use the fallback atomic operations though --disable-native-ethr-impls or --disable-smp-require-native-atomics. |
Ok, thanks! I like the explicit configure switch, it is better than silently disabling native atomic ops. |
"Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with old versions of GCC that do not have atomic ops builtins on platforms where there is no native ethread implementation (e.g. ARM): (...) Please note however that I will be merging this branch as well, which will mean that you have to explicitly tell configure that you intend to use the fallback atomic operations though --disable-native-ethr-impls or --disable-smp-require-native-atomics." Translated: On NetBSD-5.1 (with gcc-4.1.3) the erlang package didn't compile because of > ../include/internal/gcc/ethr_membar.h:49:4: error: > #error "No __sync_val_compare_and_swap" Adding the abovementioned option --disable-native-ethr-impls make the Erlang runtime system use the original (now fallback) code. This should maybe be an pkg option, but for now this has to do.
"Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with old versions of GCC that do not have atomic ops builtins on platforms where there is no native ethread implementation (e.g. ARM): (...) Please note however that I will be merging this branch as well, which will mean that you have to explicitly tell configure that you intend to use the fallback atomic operations though --disable-native-ethr-impls or --disable-smp-require-native-atomics." Translated: On NetBSD-5.1 (with gcc-4.1.3) the erlang package didn't compile because of > ../include/internal/gcc/ethr_membar.h:49:4: error: > #error "No __sync_val_compare_and_swap" Adding the abovementioned option --disable-native-ethr-impls make the Erlang runtime system use the original (now fallback) code. This should maybe be an pkg option, but for now this has to do.
"Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with old versions of GCC that do not have atomic ops builtins on platforms where there is no native ethread implementation (e.g. ARM): (...) Please note however that I will be merging this branch as well, which will mean that you have to explicitly tell configure that you intend to use the fallback atomic operations though --disable-native-ethr-impls or --disable-smp-require-native-atomics." Translated: On NetBSD-5.1 (with gcc-4.1.3) the erlang package didn't compile because of > ../include/internal/gcc/ethr_membar.h:49:4: error: > #error "No __sync_val_compare_and_swap" Adding the abovementioned option --disable-native-ethr-impls make the Erlang runtime system use the original (now fallback) code. This should maybe be an pkg option, but for now this has to do.
"Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with old versions of GCC that do not have atomic ops builtins on platforms where there is no native ethread implementation (e.g. ARM): (...) Please note however that I will be merging this branch as well, which will mean that you have to explicitly tell configure that you intend to use the fallback atomic operations though --disable-native-ethr-impls or --disable-smp-require-native-atomics." Translated: On NetBSD-5.1 (with gcc-4.1.3) the erlang package didn't compile because of > ../include/internal/gcc/ethr_membar.h:49:4: error: > #error "No __sync_val_compare_and_swap" Adding the abovementioned option --disable-native-ethr-impls make the Erlang runtime system use the original (now fallback) code. This should maybe be an pkg option, but for now this has to do.
Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with
old versions of GCC that do not have atomic ops builtins on platforms
where there is no native ethread implementation (e.g. ARM):
In file included from ../include/internal/gcc/ethread.h:29,
from ../include/internal/ethread.h:354,
from beam/erl_threads.h:264,
from beam/erl_smp.h:27,
from beam/sys.h:413,
from hipe/hipe_mkliterals.c:29:
../include/internal/gcc/ethr_membar.h:49:4: error: #error "No __sync_val_compare_and_swap"
This patch adds a header guard in "gcc/ethread.h", as is present in
"libatomic_ops/ethread.h".