Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix compile error on ARM and GCC < 4.1.0 #46

Merged
merged 1 commit into from

3 participants

@weisslj

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".

@weisslj weisslj Fix compile error on ARM and GCC < 4.1.0
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".
15eba81
@gustehn

Patch has passed first testings and has been assigned to be reviewed

@garazdawi
Collaborator

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.

@weisslj

Ok, thanks! I like the explicit configure switch, it is better than silently disabling native atomic ops.

@gustehn gustehn merged commit 15eba81 into from
@jsonn jsonn referenced this pull request from a commit in jsonn/pkgsrc
is From erlang/otp#46 (comment)
"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.
5deea9f
@jperkin jperkin referenced this pull request from a commit in joyent/pkgsrc
is From erlang/otp#46 (comment)
"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.
7403268
@jperkin jperkin referenced this pull request from a commit in joyent/pkgsrc
is From erlang/otp#46 (comment)
"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.
2934032
@jsonn jsonn referenced this pull request from a commit in jsonn/pkgsrc
is From erlang/otp#46 (comment)
"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.
9bb7246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2013
  1. @weisslj

    Fix compile error on ARM and GCC < 4.1.0

    weisslj authored
    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".
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 erts/include/internal/gcc/ethread.h
View
5 erts/include/internal/gcc/ethread.h
@@ -25,6 +25,9 @@
#ifndef ETHREAD_GCC_H__
#define ETHREAD_GCC_H__
+#if defined(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP32) \
+ || defined(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP64)
+
#ifndef ETHR_MEMBAR
# include "ethr_membar.h"
#endif
@@ -46,3 +49,5 @@
#endif
#endif
+
+#endif
Something went wrong with that request. Please try again.