perlhacktips: fix ASan Configure settings

- Change "blacklist" to "ignorelist" because that is what the current
  ASan documentation/wiki uses.
- Move "-fsanitize-ignorelist=..." to ccflags (it is a C compiler
  option, not a Configure option).
- Use quotes for option values with spaces, not backslashes. I think
  it's more readable.

Fixes #23579.
This commit is contained in:
Lukas Mai 2025-08-16 17:44:16 +02:00
parent b70be8dad5
commit a7a1d5e901

View File

@ -1585,10 +1585,9 @@ C<ASAN_OPTIONS=detect_leaks=1>.
To build perl with AddressSanitizer, your Configure invocation should
look like:
sh Configure -des -Dcc=clang \
-Accflags=-fsanitize=address -Aldflags=-fsanitize=address \
-Alddlflags=-shared\ -fsanitize=address \
-fsanitize-blacklist=`pwd`/asan_ignore
sh Configure -des -Dcc=clang \
-Accflags="-fsanitize=address -fsanitize-ignorelist=$PWD/asan_ignore" \
-Aldflags="-fsanitize=address" -Alddlflags="-shared -fsanitize=address"
where these arguments mean:
@ -1599,27 +1598,25 @@ where these arguments mean:
This should be replaced by the full path to your clang executable if it
is not in your path.
=item * -Accflags=-fsanitize=address
=item * -Accflags="-fsanitize=address -fsanitize-ignorelist=$PWD/asan_ignore"
Compile perl and extensions sources with AddressSanitizer.
=item * -Aldflags=-fsanitize=address
AddressSanitizer will ignore functions listed in the F<asan_ignore>
file. (This file should contain a short explanation of why each of the
functions is listed.)
=item * -Aldflags="-fsanitize=address"
Link the perl executable with AddressSanitizer.
=item * -Alddlflags=-shared\ -fsanitize=address
=item * -Alddlflags="-shared -fsanitize=address"
Link dynamic extensions with AddressSanitizer. You must manually
specify C<-shared> because using C<-Alddlflags=-shared> will prevent
Configure from setting a default value for C<lddlflags>, which usually
contains C<-shared> (at least on Linux).
=item * -fsanitize-blacklist=`pwd`/asan_ignore
AddressSanitizer will ignore functions listed in the C<asan_ignore>
file. (This file should contain a short explanation of why each of the
functions is listed.)
=back
See also L<https://github.com/google/sanitizers/wiki/AddressSanitizer>.