summaryrefslogtreecommitdiff
path: root/regen/embed.pl
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2022-06-18 07:26:58 +0200
committerxenu <me@xenu.pl>2022-06-18 08:51:14 +0200
commit0351a629e71de127cbfd1b142e9eaa6069deabf5 (patch)
treed3248e133b1eb3d42bdfa321e9e8d06820628ad4 /regen/embed.pl
parent2287d33092e0f6594e38c269503627308460e02e (diff)
downloadperl-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 'regen/embed.pl')
-rwxr-xr-xregen/embed.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/regen/embed.pl b/regen/embed.pl
index 09853c63eb..d36eb6c4d2 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -241,6 +241,10 @@ my ($embed, $core, $ext, $api) = setup_embed();
if ( $flags =~ /I/ ) {
push @attrs, "__attribute__always_inline__";
}
+ # roughly the inverse of the rules used in makedef.pl
+ if ( $flags !~ /[ACeIimSX]/ ) {
+ push @attrs, '__attribute__visibility__("hidden")'
+ }
if( $flags =~ /f/ ) {
my $prefix = $has_context ? 'pTHX_' : '';
my ($args, $pat);