Disable strict-aliasing globally
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 6 Apr 2021 22:18:02 +0000 (18:18 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 19 Apr 2021 17:34:15 +0000 (13:34 -0400)
Change-Id: Idaf3407c827eeff05f5e52afb446484ff959dbd0
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
src/lib/lttng-ust-ctl/Makefile.am
src/lib/lttng-ust-cyg-profile/Makefile.am
src/lib/lttng-ust-dl/Makefile.am
src/lib/lttng-ust-fd/Makefile.am
src/lib/lttng-ust-fork/Makefile.am
src/lib/lttng-ust-libc-wrapper/Makefile.am
src/lib/lttng-ust-pthread-wrapper/Makefile.am
src/lib/lttng-ust-python-agent/Makefile.am
src/lib/lttng-ust/Makefile.am

index cf2e0e3e75f04d18dbc85fff2781c7203e60238b..66e07f7f2a2f91dddea213ffe20344b947b65344 100644 (file)
@@ -179,6 +179,11 @@ AC_LANG_POP([C])
 # Clang >= 3.3 (required by the project) and are only valid for C code.
 WARN_CFLAGS="${WARN_CFLAGS} -Wold-style-definition -Wstrict-prototypes"
 
+# Disable 'strict aliasing' if the compiler supports it.
+AC_LANG_PUSH([C])
+AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CFLAGS], [-Werror])
+AC_LANG_POP([C])
+
 
 ##                     ##
 ## C++ compiler checks ##
@@ -544,7 +549,7 @@ AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], ust_ctl_lib_version)
 # Major soname for python-lttngust
 AC_SUBST([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current])
 
-AM_CFLAGS="$WARN_CFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
+AM_CFLAGS="$OPT_CFLAGS $WARN_CFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
 AC_SUBST(AM_CFLAGS)
 
 AM_CXXFLAGS="$WARN_CXXFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
index f8cc70cbbaee81b551881ea7d57b6af5109cbcfb..807d8fa6317efafd6224353b21e958c8c728f010 100644 (file)
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
 AM_CPPFLAGS += -I$(top_srcdir)/liblttng-ust-comm
-AM_CFLAGS += -fno-strict-aliasing
 
 lib_LTLIBRARIES = liblttng-ust-ctl.la
 
index 26b5015646644a5e6dfd71ce34600b67e4874783..234c11bc450103e7ee29d640bd4aa53c941af941 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+AM_CFLAGS += -I$(srcdir)
 
 lib_LTLIBRARIES = liblttng-ust-cyg-profile.la \
        liblttng-ust-cyg-profile-fast.la
index f1b87ea87c1ac82d6e799dbd9e050b5c70b67f8f..b5a2d366d5a0a3178a924bfbcf6297b953a22a04 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+AM_CFLAGS += -I$(srcdir)
 
 lib_LTLIBRARIES = liblttng-ust-dl.la
 liblttng_ust_dl_la_SOURCES = \
index 23c4d13682a3c17fe63323b4b45327b487931d60..f0c4f01e275ebf2b404b2582dcb7e03b8ccfa795 100644 (file)
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -fno-strict-aliasing
-
 lib_LTLIBRARIES = liblttng-ust-fd.la
 liblttng_ust_fd_la_SOURCES = \
        lttng-ust-fd.c
index de3d2d6035cff8f5797567b5a78c28a8ecab7492..648a99e677ee475b2a2579ad84e10dd762aef863 100644 (file)
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -fno-strict-aliasing
-
 lib_LTLIBRARIES = liblttng-ust-fork.la
 liblttng_ust_fork_la_SOURCES = ustfork.c
 liblttng_ust_fork_la_LIBADD = \
index 0507e4df0d0c47492b52464484f4cadce0ff33c8..4490bb60bf2b1ca4d5fd85b9bb5d8bd615ee3220 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+AM_CFLAGS += -I$(srcdir)
 
 lib_LTLIBRARIES = liblttng-ust-libc-wrapper.la
 
index 3edb72a7352eeb360a8975417e13a6fd4c74354f..5eb1a03d24a9f7846deee94d1f46acd95b60b99a 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+AM_CFLAGS += -I$(srcdir)
 
 lib_LTLIBRARIES = liblttng-ust-pthread-wrapper.la
 
index 619a268f429bac5f5976b83fa631078dcb5f68f3..2c65d6b592220b866e02f12819ddfa821db80ef3 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
 # tracepoint provider: always built/installed (does not depend on Python per se)
-AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+AM_CFLAGS += -I$(srcdir)
 
 lib_LTLIBRARIES = liblttng-ust-python-agent.la
 
index a935bdbe036bb9c53315a66252acd06258dccf33..4aa576bef7fa3f08894faa312d9b198a7368c145 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
-AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+AM_CFLAGS += -I$(srcdir)
 
 lib_LTLIBRARIES = liblttng-ust.la
 
This page took 0.028441 seconds and 4 git commands to generate.