Skip to content

Commit dfbafc9

Browse files
committed
porting/libperl.t: detect LTO builds via -Doptimize
Link-time optimization (LTO) may be enabled via -flto using either -Dccflags='-flto' or -Doptimize='-O2 -flto', so check both variables to detect an LTO build.
1 parent dcb3991 commit dfbafc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/porting/libperl.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if ($Config{cc} =~ /g\+\+/) {
5656
}
5757

5858
# ccname is gcc for both gcc and clang
59-
if ($Config{ccname} eq "gcc" && $Config{ccflags} =~ /-flto\b/) {
59+
if ($Config{ccname} eq "gcc" && "$Config{ccflags} $Config{optimize}" =~ /-flto\b/) {
6060
# If we compile with gcc nm marks PL_no_mem as "D" (normal data) rather than a R (read only)
6161
# but the symbol still ends up in the .rodata section of the image on linking.
6262
# If we compile with clang 14, nm marks PL_no_mem as "T" (text, aka code) rather than R

0 commit comments

Comments
 (0)