Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 60a920f

Browse files
committed
Add lto plugin to ranlib also
Needed for static lto libs, as eg on Cygwin for Win32CORE.a Add actual probes, which failed prev. eg. on linux gcc-8. Closes #388
1 parent c9466d4 commit 60a920f

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

Configure

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22145,7 +22145,6 @@ else
2214522145
ranlib=":"
2214622146
fi
2214722147
fi
22148-
$rm -f foo* bar*
2214922148

2215022149
if $test -n "$gccversion"; then
2215122150
case "$ccflags" in
@@ -22158,17 +22157,40 @@ if $test -n "$gccversion"; then
2215822157
cygwin) plugin="/usr/lib/gcc/$myarchname/$gccversion/cyglto_plugin.dll" ;;
2215922158
*) plugin="/usr/lib/gcc/$myarchname/$gccversion/liblto_plugin.$dlext" ;;
2216022159
esac
22161-
if test -f "$plugin"; then
22162-
arflags="$arflags --plugin $plugin"
22160+
if $test -f "$plugin"; then
22161+
echo "lto plugin found"
2216322162
else
22164-
echo "$plugin for ar with -flto not found" >&4
22163+
for f in $libpth; do
22164+
$test -f $plugin || plugin="$f/liblto_plugin.$dlext"
22165+
done
22166+
fi
22167+
if $test -f "$plugin"; then
22168+
case $ar in
22169+
*llvm-ar*) ;;
22170+
*) if $ar $arflags --plugin $plugin bar$_a bar2$_o bar1$_o >/dev/null 2>&1; then
22171+
echo "can use $ar with lto --plugin $plugin" >&4
22172+
arflags="$arflags --plugin $plugin"
22173+
fi
22174+
;;
22175+
esac
22176+
case $ranlib in
22177+
*llvm-ranlib*) ;;
22178+
:) ;;
22179+
*) if $ranlib --plugin $plugin bar$_a; then
22180+
echo "can use $ranlib with lto --plugin $plugin" >&4
22181+
ranlib="$ranlib --plugin $plugin"
22182+
fi
22183+
;;
22184+
esac
22185+
else
22186+
echo "$plugin for ar with lto not found" >&4
2216522187
fi
2216622188
unset plugin
2216722189
;;
2216822190
*) ;;
2216922191
esac
2217022192
fi
22171-
22193+
$rm -f foo* bar*
2217222194

2217322195
: Check the max offset that gmtime and localtime accept
2217422196
echo "Checking max offsets that gmtime () accepts"

pod/perlcdelta.pod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,9 @@ llvm-profdata.
311311

312312
=item *
313313

314-
Added C<ar --plugin> path to the F<lto_plugin>, required for static
315-
libs with C<-flto>. Esp. on cygwin.
314+
Added C<ar --plugin> path to the gcc F<lto_plugin>, required for
315+
binutils C<ar> with static libs with C<-flto>. Esp. on cygwin.
316+
Ditto for C<ranlib>.
316317

317318
=item *
318319

0 commit comments

Comments
 (0)