texlive[70984] Build/source: avoid using -fvisibility-inlines-hidden
commits+karl at tug.org
commits+karl at tug.org
Fri Apr 19 00:14:37 CEST 2024
Revision: 70984
https://tug.org/svn/texlive?view=revision&revision=70984
Author: karl
Date: 2024-04-19 00:14:36 +0200 (Fri, 19 Apr 2024)
Log Message:
-----------
avoid using -fvisibility-inlines-hidden with C
Modified Paths:
--------------
trunk/Build/source/doc/ChangeLog
trunk/Build/source/doc/tlbuild.texi
trunk/Build/source/m4/ChangeLog
trunk/Build/source/m4/kpse-visibility.m4
Modified: trunk/Build/source/doc/ChangeLog
===================================================================
--- trunk/Build/source/doc/ChangeLog 2024-04-18 22:09:05 UTC (rev 70983)
+++ trunk/Build/source/doc/ChangeLog 2024-04-18 22:14:36 UTC (rev 70984)
@@ -1,3 +1,9 @@
+2024-04-18 Karl Berry <karl at freefriends.org>
+
+ * tlbuild.texi (Macros for compilers): mention that
+ -fvisibility-inlines-hidden is not for C,
+ and index -fvisibility... options.
+
2023-12-23 Karl Berry <karl at tug.org>
* build-tools: autoconf 2.72 and (belatedly) makeinfo 7.1
Modified: trunk/Build/source/doc/tlbuild.texi
===================================================================
--- trunk/Build/source/doc/tlbuild.texi 2024-04-18 22:09:05 UTC (rev 70983)
+++ trunk/Build/source/doc/tlbuild.texi 2024-04-18 22:14:36 UTC (rev 70984)
@@ -2,7 +2,7 @@
@setfilename tlbuild.info
@set version 2024
- at set month-year March 2024
+ at set month-year April 2024
@set mytitle Building @TeX{} Live (@value{version})
@settitle @value{mytitle}
@@ -1233,11 +1233,14 @@
@end defmac
@defmac KPSE_COMPILER_VISIBILITY
+ at vindex -fvisibility=hidden
+ at vindex -fvisibility-inlines-hidden
When using the C or C++ compiler, try to set
@code{VISIBILITY_C[XX]FLAGS} to flags to hide external symbols. Call
- at code{AC_SUBST} for this variable. At present this only tests for
-the compiler option @code{-fvisibility=hidden}, but could be
-extended if necessary.
+ at code{AC_SUBST} for this variable. This tests for the compiler option
+ at code{-fvisibility=hidden} and, except for C,
+ at code{-fvisibility-inlines-hidden}. Reports or patches for additional
+tests are welcome.
@vindex kpse_cv_visibility_c[xx]flags
This macro caches its results in the @code{kpse_cv_visibility_cflags}
Modified: trunk/Build/source/m4/ChangeLog
===================================================================
--- trunk/Build/source/m4/ChangeLog 2024-04-18 22:09:05 UTC (rev 70983)
+++ trunk/Build/source/m4/ChangeLog 2024-04-18 22:14:36 UTC (rev 70984)
@@ -1,3 +1,9 @@
+2024-04-18 Karl Berry <karl at freefriends.org>
+
+ * kpse-visibility.m4 (_KPSE_VISIBILITY_FLAGS): avoid testing or
+ including -fvisibility-inlines-hidden for C. From Luigi, mail of
+ 12 Apr 2024 06:26:23.
+
2024-02-01 Luigi Scarso <luigi.scarso at gmail.com>
* kpse-pkgs.m4 (kpse_libs_pkgs): add mpfi (new subdir).
Modified: trunk/Build/source/m4/kpse-visibility.m4
===================================================================
--- trunk/Build/source/m4/kpse-visibility.m4 2024-04-18 22:09:05 UTC (rev 70983)
+++ trunk/Build/source/m4/kpse-visibility.m4 2024-04-18 22:14:36 UTC (rev 70984)
@@ -1,6 +1,6 @@
# $Id$
# Public macros for the TeX Live (TL) tree.
-# Copyright 2017-2018 Karl Berry <tex-live at tug.org>
+# Copyright 2017-2024 Karl Berry <tex-live at tug.org>
# Copyright 2013-2014 Peter Breitenlohner <tex-live at tug.org>
#
# This file is free software; the copyright holder
@@ -62,8 +62,19 @@
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <stdio.h>
extern void foo(void);
void foo(void){printf("foo\n");}]])])
-# FIXME: Add tests for non-GNU compilers
-for kpse_flag in '-fvisibility=hidden -fvisibility-inlines-hidden' '-fvisibility=hidden'; do
+# Maybe other compiler need other tests; patches needed.
+#
+# The idea, maybe, is to use both flags when they are supported, but
+# old C++ compilers, as well as C, don't support
+# -fvisibility-inlines-hidden, so test just -fvisibility=hidden too?
+#
+for kpse_flag in "-fvisibility=hidden -fvisibility-inlines-hidden" \
+ "-fvisibility=hidden"; do
+ if test x"$1" = xC \
+ && echo "$kpse_flag" | grep inlines-hidden >/dev/null; then
+ # C does not support this additional flag; just skip the test.
+ continue
+ fi
AS_TR_CPP($2)="$kpse_save_flags -Werror $kpse_flag"
AC_COMPILE_IFELSE([], [kpse_cv_visibility_$2=$kpse_flag; break])
done
More information about the tex-live-commits
mailing list.