diff options
author | Tomasz Konojacki <me@xenu.pl> | 2022-06-18 07:26:58 +0200 |
---|---|---|
committer | xenu <me@xenu.pl> | 2022-06-18 08:51:14 +0200 |
commit | 0351a629e71de127cbfd1b142e9eaa6069deabf5 (patch) | |
tree | d3248e133b1eb3d42bdfa321e9e8d06820628ad4 /Configure | |
parent | 2287d33092e0f6594e38c269503627308460e02e (diff) | |
download | perl-0351a629e71de127cbfd1b142e9eaa6069deabf5.tar.gz |
hide private functions with __attribute__((visibility("hidden")))
This allows us to enforce API boundaries and potentially enables
compiler optimisations.
We've been always hiding non-public symbols on Windows. This commit
brings that to the other platforms.
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -391,6 +391,7 @@ d_attribute_nonnull='' d_attribute_noreturn='' d_attribute_pure='' d_attribute_unused='' +d_attribute_visibility='' d_attribute_warn_unused_result='' d_printf_format_null='' d_backtrace='' @@ -11337,6 +11338,34 @@ set d_attribute_always_inline eval $setvar $rm -f attrib* +: Look for GCC-style attribute visibility +case "$d_attribute_visibility" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((visibility)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include <stdio.h> +__attribute__((visibility("hidden"))) int I_will_be_hidden(void); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $compiler_warning attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((visibility))." + val="$undef" + else + echo "Your C compiler supports __attribute__((visibility))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_visibility" ;; +esac +set d_attribute_visibility +eval $setvar +$rm -f attrib* + : see if getpgrp exists set getpgrp d_getpgrp eval $inlibc @@ -24598,6 +24627,7 @@ d_attribute_nonnull='$d_attribute_nonnull' d_attribute_noreturn='$d_attribute_noreturn' d_attribute_pure='$d_attribute_pure' d_attribute_unused='$d_attribute_unused' +d_attribute_visibility='$d_attribute_visibility' d_attribute_warn_unused_result='$d_attribute_warn_unused_result' d_backtrace='$d_backtrace' d_bsd='$d_bsd' |