From 90b969c2ede4bd5ba3722d0f2a71a77d8380bf80 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 11 Apr 2012 14:14:11 +0100 Subject: tools: Correct PTHREAD options in config/StdGNU.mk It is not correct to say -lpthread. The correct option is -pthread, which may have sundry other effects on code generation etc. It needs to be passed both to compilation and linking. Fix the configure test to test -pthread, and plumb the resulting flag through to PTHREAD_{CFLAGS,LDFLAGS} in Tools.mk; also substitute PTHREAD_LIBS (although this will currently always be empty). Remove PTHREAD_LIBS setting from StdGNU.mk. Fix the one user (libxc) to use PTHREAD_{CFLAGS,LDFLAGS} too. There are still some other users in tree which pass -pthread or -lpthread by adding it as a literal to their own compiler options. These will be fixed in a later patch. Signed-off-by: Ian Jackson Cc: Roger Pau Monne Acked-by: Roger Pau Monne Committed-by: Ian Jackson --- config/StdGNU.mk | 1 - config/Tools.mk.in | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/StdGNU.mk b/config/StdGNU.mk index e2c9335db4..e2f2e1ef36 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -67,7 +67,6 @@ XEN_CONFIG_DIR = $(CONFIG_DIR)/xen XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts SOCKET_LIBS = -PTHREAD_LIBS = -lpthread UTIL_LIBS = -lutil DLOPEN_LIBS = -ldl diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 339a7b6f7b..912d02199a 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -26,6 +26,10 @@ PREPEND_LIB := @PREPEND_LIB@ APPEND_INCLUDES := @APPEND_INCLUDES@ APPEND_LIB := @APPEND_LIB@ +PTHREAD_CFLAGS := @PTHREAD_CFLAGS@ +PTHREAD_LDFLAGS := @PTHREAD_LDFLAGS@ +PTHREAD_LIBS := @PTHREAD_LIBS@ + # Download GIT repositories via HTTP or GIT's own protocol? # GIT's protocol is faster and more robust, when it works at all (firewalls # may block it). We make it the default, but if your GIT repository downloads -- cgit v1.2.3