commit:     9bb8160bd3bbd28d2b5f3b50e9e657537a4a32ba
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 19 16:12:18 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jul 19 16:12:18 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bb8160b

sys-apps/file: Add missing gl_VISIBILITY macro in configure script

Closes: https://bugs.gentoo.org/661508
Package-Manager: Portage-2.3.42, Repoman-2.3.9
RepoMan-Options: --force

 .../{file-5.33-r2.ebuild => file-5.33-r3.ebuild}   |   8 +-
 .../file/files/file-5.33-gl_VISIBILITY-macro.patch | 116 +++++++++++++++++++++
 2 files changed, 123 insertions(+), 1 deletion(-)

diff --git a/sys-apps/file/file-5.33-r2.ebuild 
b/sys-apps/file/file-5.33-r3.ebuild
similarity index 93%
rename from sys-apps/file/file-5.33-r2.ebuild
rename to sys-apps/file/file-5.33-r3.ebuild
index e67df7bc93a..e9203f385ff 100644
--- a/sys-apps/file/file-5.33-r2.ebuild
+++ b/sys-apps/file/file-5.33-r3.ebuild
@@ -33,11 +33,17 @@ DEPEND="
 RDEPEND="${DEPEND}
        python? ( !dev-python/python-magic )"
 
-PATCHES=( "${FILESDIR}"/${P}-CVE-2018-10360.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-CVE-2018-10360.patch
+       "${FILESDIR}"/${P}-gl_VISIBILITY-macro.patch
+)
 
 src_prepare() {
        default
 
+       # We are patching configure script so fix timestamp to avoid autoreconf
+       touch -r compile configure
+
        [[ ${PV} == "9999" ]] && eautoreconf
        elibtoolize
 

diff --git a/sys-apps/file/files/file-5.33-gl_VISIBILITY-macro.patch 
b/sys-apps/file/files/file-5.33-gl_VISIBILITY-macro.patch
new file mode 100644
index 00000000000..cef3cb5518b
--- /dev/null
+++ b/sys-apps/file/files/file-5.33-gl_VISIBILITY-macro.patch
@@ -0,0 +1,116 @@
+https://bugs.gentoo.org/661508
+
+--- a/configure
++++ b/configure
+@@ -638,6 +638,8 @@
+ IS_CROSS_COMPILE_FALSE
+ IS_CROSS_COMPILE_TRUE
+ LIBOBJS
++HAVE_VISIBILITY
++CFLAG_VISIBILITY
+ OTOOL64
+ OTOOL
+ LIPO
+@@ -12512,7 +12519,92 @@
+ # Only expand once:
+ 
+ 
+-gl_VISIBILITY
++
++
++  CFLAG_VISIBILITY=
++  HAVE_VISIBILITY=0
++  if test -n "$GCC"; then
++                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the 
-Werror option is usable" >&5
++$as_echo_n "checking whether the -Werror option is usable... " >&6; }
++    if ${gl_cv_cc_vis_werror+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++
++      gl_save_CFLAGS="$CFLAGS"
++      CFLAGS="$CFLAGS -Werror"
++      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  gl_cv_cc_vis_werror=yes
++else
++  gl_cv_cc_vis_werror=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++      CFLAGS="$gl_save_CFLAGS"
++fi
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
++$as_echo "$gl_cv_cc_vis_werror" >&6; }
++        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple 
visibility declarations" >&5
++$as_echo_n "checking for simple visibility declarations... " >&6; }
++    if ${gl_cv_cc_visibility+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++
++      gl_save_CFLAGS="$CFLAGS"
++      CFLAGS="$CFLAGS -fvisibility=hidden"
++                                    if test $gl_cv_cc_vis_werror = yes; then
++        CFLAGS="$CFLAGS -Werror"
++      fi
++      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++extern __attribute__((__visibility__("hidden"))) int hiddenvar;
++             extern __attribute__((__visibility__("default"))) int 
exportedvar;
++             extern __attribute__((__visibility__("hidden"))) int hiddenfunc 
(void);
++             extern __attribute__((__visibility__("default"))) int 
exportedfunc (void);
++             void dummyfunc (void) {}
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  gl_cv_cc_visibility=yes
++else
++  gl_cv_cc_visibility=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++      CFLAGS="$gl_save_CFLAGS"
++fi
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
++$as_echo "$gl_cv_cc_visibility" >&6; }
++    if test $gl_cv_cc_visibility = yes; then
++      CFLAG_VISIBILITY="-fvisibility=hidden"
++      HAVE_VISIBILITY=1
++    fi
++  fi
++
++
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_VISIBILITY $HAVE_VISIBILITY
++_ACEOF
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+ $as_echo_n "checking for ANSI C header files... " >&6; }
+ if ${ac_cv_header_stdc+:} false; then :
+@@ -16194,7 +16286,7 @@
+     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+     test -z "$DEPDIR" && continue
+     am__include=`sed -n 's/^am__include = //p' < "$mf"`
+-    test -z "am__include" && continue
++    test -z "$am__include" && continue
+     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+     # Find all dependency output files, they are included files with
+     # $(DEPDIR) in their names.  We invoke sed twice because it is the

Reply via email to