9d7d3f
From ac2121bf962ecc054dd103ccd42a93912051672e Mon Sep 17 00:00:00 2001
9d7d3f
From: Kamil Dudka <kdudka@redhat.com>
9d7d3f
Date: Tue, 21 Jun 2016 12:40:26 +0200
9d7d3f
Subject: [PATCH] curl-compilers.m4: improve detection of GCC's -fvisibility=
9d7d3f
 flag
9d7d3f
9d7d3f
Some builds of GCC produce output on both stdout and stderr when --help
9d7d3f
--verbose is used.  The 2>&1 redirection caused them to be arbitrarily
9d7d3f
interleaved with each other because of stream buffering.  Consequently,
9d7d3f
grep failed to match the fvisibility= string in the mixed output, even
9d7d3f
though the string was present in GCC's standard output.
9d7d3f
9d7d3f
This led to silently disabling symbol hiding in some builds of curl.
9d7d3f
9d7d3f
Upstream-commit: b2dcf0347f1ee5041cccd64632bb8dd7ccbbae91
9d7d3f
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
9d7d3f
---
9d7d3f
 configure            | 2 +-
9d7d3f
 m4/curl-compilers.m4 | 4 ++--
9d7d3f
 2 files changed, 3 insertions(+), 3 deletions(-)
9d7d3f
9d7d3f
diff --git a/configure b/configure
9d7d3f
index 4797e02..fc260ee 100755
9d7d3f
--- a/configure
9d7d3f
+++ b/configure
9d7d3f
@@ -17636,7 +17636,7 @@ $as_echo_n "checking if compiler supports hiding library internal symbols... " >
9d7d3f
       ;;
9d7d3f
     GNU_C)
9d7d3f
             if test "$compiler_num" -ge "304"; then
9d7d3f
-        if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
9d7d3f
+        if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null ; then
9d7d3f
           tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))"
9d7d3f
           tmp_CFLAGS="-fvisibility=hidden"
9d7d3f
           supports_symbol_hiding="yes"
9d7d3f
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
9d7d3f
index ca064dd..77371de 100644
9d7d3f
--- a/m4/curl-compilers.m4
9d7d3f
+++ b/m4/curl-compilers.m4
9d7d3f
@@ -21,7 +21,7 @@
9d7d3f
 #***************************************************************************
9d7d3f
 
9d7d3f
 # File version for 'aclocal' use. Keep it a single number.
9d7d3f
-# serial 65
9d7d3f
+# serial 66
9d7d3f
 
9d7d3f
 
9d7d3f
 dnl CURL_CHECK_COMPILER
9d7d3f
@@ -1391,7 +1391,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [
9d7d3f
     GNU_C)
9d7d3f
       dnl Only gcc 3.4 or later
9d7d3f
       if test "$compiler_num" -ge "304"; then
9d7d3f
-        if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
9d7d3f
+        if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null ; then
9d7d3f
           tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))"
9d7d3f
           tmp_CFLAGS="-fvisibility=hidden"
9d7d3f
           supports_symbol_hiding="yes"
9d7d3f
-- 
9d7d3f
2.5.5
9d7d3f