diff options
author | Karl Berry <karl@freefriends.org> | 2024-04-18 22:14:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-04-18 22:14:36 +0000 |
commit | 043f2bfe108bd85f91f45767b3796df6891807fb (patch) | |
tree | b7e96c9465d6f60793fda3f42c180513d6e49a57 /Build | |
parent | 3d288f4b017841503f55fa80343f4759e6afcd01 (diff) |
avoid using -fvisibility-inlines-hidden with C
git-svn-id: svn://tug.org/texlive/trunk@70984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/doc/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/doc/tlbuild.texi | 11 | ||||
-rw-r--r-- | Build/source/m4/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/m4/kpse-visibility.m4 | 17 |
4 files changed, 33 insertions, 7 deletions
diff --git a/Build/source/doc/ChangeLog b/Build/source/doc/ChangeLog index 11b9a4ee4de..7ff403383cd 100644 --- a/Build/source/doc/ChangeLog +++ b/Build/source/doc/ChangeLog @@ -1,3 +1,9 @@ +2024-04-18 Karl Berry <karl@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@tug.org> * build-tools: autoconf 2.72 and (belatedly) makeinfo 7.1 diff --git a/Build/source/doc/tlbuild.texi b/Build/source/doc/tlbuild.texi index 776c309e681..a889b42b4a6 100644 --- a/Build/source/doc/tlbuild.texi +++ b/Build/source/doc/tlbuild.texi @@ -2,7 +2,7 @@ @setfilename tlbuild.info @set version 2024 -@set month-year March 2024 +@set month-year April 2024 @set mytitle Building @TeX{} Live (@value{version}) @settitle @value{mytitle} @@ -1233,11 +1233,14 @@ This macro caches its results in the @code{kpse_cv_warning_cflags}, @end defmac @defmac KPSE_COMPILER_VISIBILITY +@vindex -fvisibility=hidden +@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 -@code{AC_SUBST} for this variable. At present this only tests for -the compiler option @code{-fvisibility=hidden}, but could be -extended if necessary. +@code{AC_SUBST} for this variable. This tests for the compiler option +@code{-fvisibility=hidden} and, except for C, +@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} diff --git a/Build/source/m4/ChangeLog b/Build/source/m4/ChangeLog index c539ea411ad..e8251fb4e2e 100644 --- a/Build/source/m4/ChangeLog +++ b/Build/source/m4/ChangeLog @@ -1,3 +1,9 @@ +2024-04-18 Karl Berry <karl@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@gmail.com> * kpse-pkgs.m4 (kpse_libs_pkgs): add mpfi (new subdir). diff --git a/Build/source/m4/kpse-visibility.m4 b/Build/source/m4/kpse-visibility.m4 index 5bdb8b93af5..04955ea2739 100644 --- a/Build/source/m4/kpse-visibility.m4 +++ b/Build/source/m4/kpse-visibility.m4 @@ -1,6 +1,6 @@ # $Id$ # Public macros for the TeX Live (TL) tree. -# Copyright 2017-2018 Karl Berry <tex-live@tug.org> +# Copyright 2017-2024 Karl Berry <tex-live@tug.org> # Copyright 2013-2014 Peter Breitenlohner <tex-live@tug.org> # # This file is free software; the copyright holder @@ -62,8 +62,19 @@ kpse_save_flags=$AS_TR_CPP($2) 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 |