Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive
@ 2019-04-16 17:47 Michael Jeanson
  2019-04-16 17:48 ` [lttng-dev] [PATCH urcu 2/2] Check for TLS support after CC detection Michael Jeanson
  2019-04-16 17:51 ` [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive Mathieu Desnoyers
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Jeanson @ 2019-04-16 17:47 UTC (permalink / raw)


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 m4/ax_c___attribute__.m4 |  6 ++---
 m4/ax_pthread.m4         |  9 ++++---
 m4/ax_tls.m4             | 57 ++++++++++++++++------------------------
 3 files changed, 30 insertions(+), 42 deletions(-)

diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4
index cf3d62b..6a1ede1 100644
--- a/m4/ax_c___attribute__.m4
+++ b/m4/ax_c___attribute__.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#    http://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
+#    https://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -28,7 +28,7 @@
 #   Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
 #
 #   As a special exception, the respective Autoconf Macro's copyright owner
 #   gives unlimited permission to copy, distribute and modify the configure
@@ -43,7 +43,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 8
+#serial 9
 
 AC_DEFUN([AX_C___ATTRIBUTE__], [
   AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__],
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index 4c4051e..4920e07 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+#        https://www.gnu.org/software/autoconf-archive/ax_pthread.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -67,7 +67,7 @@
 #   Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
 #
 #   As a special exception, the respective Autoconf Macro's copyright owner
 #   gives unlimited permission to copy, distribute and modify the configure
@@ -82,7 +82,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 23
+#serial 25
 
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
 AC_DEFUN([AX_PTHREAD], [
@@ -438,7 +438,8 @@ if test "x$ax_pthread_ok" = "xyes"; then
         AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
             [ax_cv_PTHREAD_PRIO_INHERIT],
             [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
-                                             [[int i = PTHREAD_PRIO_INHERIT;]])],
+                                             [[int i = PTHREAD_PRIO_INHERIT;
+                                               return i;]])],
                             [ax_cv_PTHREAD_PRIO_INHERIT=yes],
                             [ax_cv_PTHREAD_PRIO_INHERIT=no])
             ])
diff --git a/m4/ax_tls.m4 b/m4/ax_tls.m4
index 7c86daf..51edee8 100644
--- a/m4/ax_tls.m4
+++ b/m4/ax_tls.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#          http://www.gnu.org/software/autoconf-archive/ax_tls.html
+#          https://www.gnu.org/software/autoconf-archive/ax_tls.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -9,9 +9,9 @@
 # DESCRIPTION
 #
 #   Provides a test for the compiler support of thread local storage (TLS)
-#   extensions. Defines TLS if it is found. Currently knows about GCC/ICC
-#   and MSVC. I think SunPro uses the same as GCC, and Borland apparently
-#   supports either.
+#   extensions. Defines TLS if it is found. Currently knows about C++11,
+#   GCC/ICC, and MSVC. I think SunPro uses the same as GCC, and Borland
+#   apparently supports either.
 #
 # LICENSE
 #
@@ -29,7 +29,7 @@
 #   Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
 #
 #   As a special exception, the respective Autoconf Macro's copyright owner
 #   gives unlimited permission to copy, distribute and modify the configure
@@ -44,44 +44,31 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 11
-
-#   Define m4_ifblank and m4_ifnblank macros from introduced in
-#   autotools 2.64 m4sugar.m4 if using an earlier autotools.
-
-ifdef([m4_ifblank], [], [
-m4_define([m4_ifblank],
-[m4_if(m4_translit([[$1]],  [ ][	][
-]), [], [$2], [$3])])
-])
-
-
-ifdef([m4_ifnblank], [], [
-m4_define([m4_ifnblank],
-[m4_if(m4_translit([[$1]],  [ ][	][
-]), [], [$3], [$2])])
-])
+#serial 14
 
 AC_DEFUN([AX_TLS], [
-  AC_MSG_CHECKING(for thread local storage (TLS) class)
-  AC_CACHE_VAL(ac_cv_tls, [
-    ax_tls_keywords="__thread __declspec(thread) none"
-    for ax_tls_keyword in $ax_tls_keywords; do
+  AC_MSG_CHECKING([for thread local storage (TLS) class])
+  AC_CACHE_VAL([ac_cv_tls],
+   [for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do
        AS_CASE([$ax_tls_keyword],
           [none], [ac_cv_tls=none ; break],
-          [AC_TRY_LINK(
-               [$ax_tls_keyword int foo;],
-               [++foo;],
+          [AC_TRY_COMPILE(
+              [#include <stdlib.h>
+               static void
+               foo(void) {
+               static ] $ax_tls_keyword [ int bar;
+               exit(1);
+               }],
+               [],
                [ac_cv_tls=$ax_tls_keyword ; break],
-               [ac_cv_tls=none]
+               ac_cv_tls=none
            )])
     done
   ])
-  AC_MSG_RESULT($ac_cv_tls)
+  AC_MSG_RESULT([$ac_cv_tls])
 
   AS_IF([test "$ac_cv_tls" != "none"],
-    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
-      m4_ifnblank([$1], [$1]),
-    m4_ifnblank([$2], [$2])
-  )
+    [AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS storage class define it to that here])
+     m4_ifnblank([$1],[$1])],
+    [m4_ifnblank([$2],[$2])])
 ])
-- 
2.17.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lttng-dev] [PATCH urcu 2/2] Check for TLS support after CC detection
  2019-04-16 17:47 [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive Michael Jeanson
@ 2019-04-16 17:48 ` Michael Jeanson
  2019-04-16 17:51 ` [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive Mathieu Desnoyers
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Jeanson @ 2019-04-16 17:48 UTC (permalink / raw)


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 configure.ac | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3879f8f..475dcf5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,11 @@ AC_ARG_ENABLE([compiler-tls],
 	[def_compiler_tls=$enableval],
 	[def_compiler_tls="yes"])
 
+# Checks for C compiler
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_CC
+AC_PROG_CC_STDC
+
 # If not overridden, use ax_tls.m4 to check if TLS is available.
 AS_IF([test "x$def_compiler_tls" = "xyes"],
 	[AX_TLS([def_tls_detect=$ac_cv_tls], [:])],
@@ -54,11 +59,6 @@ AS_IF([test "x$def_tls_detect" = "x"],
 	[:],
 	[AC_DEFINE_UNQUOTED([CONFIG_RCU_TLS], $def_tls_detect)])
 
-# Checks for C compiler
-AC_USE_SYSTEM_EXTENSIONS
-AC_PROG_CC
-AC_PROG_CC_STDC
-
 # Checks for programs.
 AC_PROG_AWK
 AC_PROG_MAKE_SET
-- 
2.17.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive
  2019-04-16 17:47 [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive Michael Jeanson
  2019-04-16 17:48 ` [lttng-dev] [PATCH urcu 2/2] Check for TLS support after CC detection Michael Jeanson
@ 2019-04-16 17:51 ` Mathieu Desnoyers
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2019-04-16 17:51 UTC (permalink / raw)


Both patches merged into liburcu master branch, thanks!

Mathieu

----- On Apr 16, 2019, at 1:47 PM, Michael Jeanson mjeanson at efficios.com wrote:

> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
> m4/ax_c___attribute__.m4 |  6 ++---
> m4/ax_pthread.m4         |  9 ++++---
> m4/ax_tls.m4             | 57 ++++++++++++++++------------------------
> 3 files changed, 30 insertions(+), 42 deletions(-)
> 
> diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4
> index cf3d62b..6a1ede1 100644
> --- a/m4/ax_c___attribute__.m4
> +++ b/m4/ax_c___attribute__.m4
> @@ -1,5 +1,5 @@
> # ===========================================================================
> -#    http://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
> +#    https://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
> # ===========================================================================
> #
> # SYNOPSIS
> @@ -28,7 +28,7 @@
> #   Public License for more details.
> #
> #   You should have received a copy of the GNU General Public License along
> -#   with this program. If not, see <http://www.gnu.org/licenses/>.
> +#   with this program. If not, see <https://www.gnu.org/licenses/>.
> #
> #   As a special exception, the respective Autoconf Macro's copyright owner
> #   gives unlimited permission to copy, distribute and modify the configure
> @@ -43,7 +43,7 @@
> #   modified version of the Autoconf Macro, you may extend this special
> #   exception to the GPL to apply to your modified version as well.
> 
> -#serial 8
> +#serial 9
> 
> AC_DEFUN([AX_C___ATTRIBUTE__], [
>   AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__],
> diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
> index 4c4051e..4920e07 100644
> --- a/m4/ax_pthread.m4
> +++ b/m4/ax_pthread.m4
> @@ -1,5 +1,5 @@
> # ===========================================================================
> -#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
> +#        https://www.gnu.org/software/autoconf-archive/ax_pthread.html
> # ===========================================================================
> #
> # SYNOPSIS
> @@ -67,7 +67,7 @@
> #   Public License for more details.
> #
> #   You should have received a copy of the GNU General Public License along
> -#   with this program. If not, see <http://www.gnu.org/licenses/>.
> +#   with this program. If not, see <https://www.gnu.org/licenses/>.
> #
> #   As a special exception, the respective Autoconf Macro's copyright owner
> #   gives unlimited permission to copy, distribute and modify the configure
> @@ -82,7 +82,7 @@
> #   modified version of the Autoconf Macro, you may extend this special
> #   exception to the GPL to apply to your modified version as well.
> 
> -#serial 23
> +#serial 25
> 
> AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
> AC_DEFUN([AX_PTHREAD], [
> @@ -438,7 +438,8 @@ if test "x$ax_pthread_ok" = "xyes"; then
>         AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
>             [ax_cv_PTHREAD_PRIO_INHERIT],
>             [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
> -                                             [[int i =
> PTHREAD_PRIO_INHERIT;]])],
> +                                             [[int i = PTHREAD_PRIO_INHERIT;
> +                                               return i;]])],
>                             [ax_cv_PTHREAD_PRIO_INHERIT=yes],
>                             [ax_cv_PTHREAD_PRIO_INHERIT=no])
>             ])
> diff --git a/m4/ax_tls.m4 b/m4/ax_tls.m4
> index 7c86daf..51edee8 100644
> --- a/m4/ax_tls.m4
> +++ b/m4/ax_tls.m4
> @@ -1,5 +1,5 @@
> # ===========================================================================
> -#          http://www.gnu.org/software/autoconf-archive/ax_tls.html
> +#          https://www.gnu.org/software/autoconf-archive/ax_tls.html
> # ===========================================================================
> #
> # SYNOPSIS
> @@ -9,9 +9,9 @@
> # DESCRIPTION
> #
> #   Provides a test for the compiler support of thread local storage (TLS)
> -#   extensions. Defines TLS if it is found. Currently knows about GCC/ICC
> -#   and MSVC. I think SunPro uses the same as GCC, and Borland apparently
> -#   supports either.
> +#   extensions. Defines TLS if it is found. Currently knows about C++11,
> +#   GCC/ICC, and MSVC. I think SunPro uses the same as GCC, and Borland
> +#   apparently supports either.
> #
> # LICENSE
> #
> @@ -29,7 +29,7 @@
> #   Public License for more details.
> #
> #   You should have received a copy of the GNU General Public License along
> -#   with this program. If not, see <http://www.gnu.org/licenses/>.
> +#   with this program. If not, see <https://www.gnu.org/licenses/>.
> #
> #   As a special exception, the respective Autoconf Macro's copyright owner
> #   gives unlimited permission to copy, distribute and modify the configure
> @@ -44,44 +44,31 @@
> #   modified version of the Autoconf Macro, you may extend this special
> #   exception to the GPL to apply to your modified version as well.
> 
> -#serial 11
> -
> -#   Define m4_ifblank and m4_ifnblank macros from introduced in
> -#   autotools 2.64 m4sugar.m4 if using an earlier autotools.
> -
> -ifdef([m4_ifblank], [], [
> -m4_define([m4_ifblank],
> -[m4_if(m4_translit([[$1]],  [ ][	][
> -]), [], [$2], [$3])])
> -])
> -
> -
> -ifdef([m4_ifnblank], [], [
> -m4_define([m4_ifnblank],
> -[m4_if(m4_translit([[$1]],  [ ][	][
> -]), [], [$3], [$2])])
> -])
> +#serial 14
> 
> AC_DEFUN([AX_TLS], [
> -  AC_MSG_CHECKING(for thread local storage (TLS) class)
> -  AC_CACHE_VAL(ac_cv_tls, [
> -    ax_tls_keywords="__thread __declspec(thread) none"
> -    for ax_tls_keyword in $ax_tls_keywords; do
> +  AC_MSG_CHECKING([for thread local storage (TLS) class])
> +  AC_CACHE_VAL([ac_cv_tls],
> +   [for ax_tls_keyword in thread_local _Thread_local __thread
> '__declspec(thread)' none; do
>        AS_CASE([$ax_tls_keyword],
>           [none], [ac_cv_tls=none ; break],
> -          [AC_TRY_LINK(
> -               [$ax_tls_keyword int foo;],
> -               [++foo;],
> +          [AC_TRY_COMPILE(
> +              [#include <stdlib.h>
> +               static void
> +               foo(void) {
> +               static ] $ax_tls_keyword [ int bar;
> +               exit(1);
> +               }],
> +               [],
>                [ac_cv_tls=$ax_tls_keyword ; break],
> -               [ac_cv_tls=none]
> +               ac_cv_tls=none
>            )])
>     done
>   ])
> -  AC_MSG_RESULT($ac_cv_tls)
> +  AC_MSG_RESULT([$ac_cv_tls])
> 
>   AS_IF([test "$ac_cv_tls" != "none"],
> -    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS
> storage class define it to that here])
> -      m4_ifnblank([$1], [$1]),
> -    m4_ifnblank([$2], [$2])
> -  )
> +    [AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS
> storage class define it to that here])
> +     m4_ifnblank([$1],[$1])],
> +    [m4_ifnblank([$2],[$2])])
> ])
> --
> 2.17.1

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-16 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 17:47 [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive Michael Jeanson
2019-04-16 17:48 ` [lttng-dev] [PATCH urcu 2/2] Check for TLS support after CC detection Michael Jeanson
2019-04-16 17:51 ` [lttng-dev] [PATCH urcu 1/2] Update macros from the autotools archive Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox