Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndris Zeila <andris.zeila@zabbix.com>2020-08-05 15:58:58 +0300
committerAndris Zeila <andris.zeila@zabbix.com>2020-08-05 15:59:20 +0300
commit88332506254610fac89e887bd27868348da948e0 (patch)
tree0c88e694ed5e67d6e08633f882de507d0deb97c3
parent37cfb1959505dce432cab05e0f515198fcef7574 (diff)
...G...... [ZBX-16998] improved agent binary compatibility by removing __thread attribute when not building agent2
* commit '7f7970126f09818d4567acd2d7a91ec7a0b71106': .D........ [ZBX-16998] added changelog entry .......... [ZBX-16998] fixed agent2 build on windows ...G...... [ZBX-16998] removed __thread usage when building only C targets (cherry picked from commit 75ea8679f05b892a9d09c6ba5fe3ecb9b47e332f)
-rw-r--r--ChangeLog.d/bugfix/ZBX-169981
-rw-r--r--build/mingw/Makefile4
-rw-r--r--configure.ac1
-rw-r--r--include/zbxtypes.h14
4 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog.d/bugfix/ZBX-16998 b/ChangeLog.d/bugfix/ZBX-16998
new file mode 100644
index 00000000000..5d024706467
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-16998
@@ -0,0 +1 @@
+...G...... [ZBX-16998] improved agent binary compatibility by removing __thread attribute when not building agent2 (wiper)
diff --git a/build/mingw/Makefile b/build/mingw/Makefile
index 972c5a8d182..dcb5fc33530 100644
--- a/build/mingw/Makefile
+++ b/build/mingw/Makefile
@@ -33,7 +33,9 @@ OBJS = \
$(OUTPUTDIR)\eventlog.o \
$(TARGETDIR)\resource.syso
-CFLAGS := $(CFLAGS) -O2 -g -DUNICODE -DHAVE_STDINT_H=1 -I$(TOPDIR)\build\win32\include -I$(TOPDIR)\build\mingw -I$(TOPDIR)\include
+CFLAGS := $(CFLAGS) -O2 -g -DUNICODE -DHAVE_STDINT_H=1 -DZBX_BUILD_AGENT2=1 -DHAVE_THREAD_LOCAL=1 \
+ -I$(TOPDIR)\build\win32\include -I$(TOPDIR)\build\mingw -I$(TOPDIR)\include
+
RFLAGS := $(RFLAGS) --input-format=rc -O coff
GOPATH := $(GOPATH);$(TOPDIR)\go
TAGS :=
diff --git a/configure.ac b/configure.ac
index 0fb70af4804..39a1d278dd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1734,6 +1734,7 @@ if test "x$agent2" = "xyes"; then
if test "x$GO" = "xno"; then
AC_MSG_ERROR([Unable to find "go" executable in path])
fi
+ AC_DEFINE(ZBX_BUILD_AGENT2,1,[Define to 1 if Agent2 is being built.])
fi
if test "x$java" = "xyes"; then
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index b64ca0dde44..0d3a5b421ed 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -20,12 +20,20 @@
#ifndef ZABBIX_TYPES_H
#define ZABBIX_TYPES_H
+#include "sysinc.h"
+
#if defined(_WINDOWS)
# define ZBX_THREAD_LOCAL __declspec(thread)
#else
-# if defined(HAVE_THREAD_LOCAL) && (defined(__GNUC__) || defined(__clang__) || defined(__MINGW32__))
-# define ZBX_THREAD_LOCAL __thread
-# else
+/* for non windows build thread local storage is required only for agent2 */
+# if defined(ZBX_BUILD_AGENT2)
+# if defined(HAVE_THREAD_LOCAL) && (defined(__GNUC__) || defined(__clang__) || defined(__MINGW32__))
+# define ZBX_THREAD_LOCAL __thread
+# else
+# error "C compiler is not compatible with agent2 assembly"
+# endif
+# endif
+# if !defined(ZBX_THREAD_LOCAL)
# define ZBX_THREAD_LOCAL
# endif
#endif