develooper Front page | perl.perl5.porters | Postings from February 2015

Why build failures with 'clang' with '-fsanitize'?

Thread Next
From:
James E Keenan
Date:
February 1, 2015 13:55
Subject:
Why build failures with 'clang' with '-fsanitize'?
Message ID:
20150201135509.14454.qmail@lists-nntp.develooper.com
Certain smoke test configurations consistently report failures to build 
perl.  For example, from a branch I created last night I received a FAIL 
when it was tested with this configuration:

#####
v5.21.8-140-g999b04b  Configuration (common) -Accflags="-DPERL_POISON 
-Werror=declaration-after-statement -fsanitize=undefined 
-fsanitize-blacklist=`pwd`/asan_ignore" -Aldflags="-fsanitize=undefined" 
-Dcc=clang
#####

I know little about 'clang', so this morning I upgraded to clang-3.5. 
When I tested with the above configuration, 'make' failed at this point:

#####
clang -c -DPERL_CORE -Werror=declaration-after-statement 
-fsanitize=undefined 
-fsanitize-blacklist=/home/jkeenan/gitwork/perl/asan_ignore 
-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -std=c89 
-O2 -Wall -Wextra -Wc++-compat -Wwrite-strings op.c
clang -c -DPERL_CORE -Werror=declaration-after-statement 
-fsanitize=undefined 
-fsanitize-blacklist=/home/jkeenan/gitwork/perl/asan_ignore 
-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -std=c89 
-O2 -Wall -Wextra -Wc++-compat -Wwrite-strings perly.c
#####

This actually froze the browser (Firefox) I had open at the time, so I 
had to stop compilation.  I then experimented by reducing the number of 
options to 'Configure'.  These built and tested successfully:

#####
sh ./Configure -des -Dusedevel -Dcc=clang 
-Accflags="-Werror=declaration-after-statement"

sh ./Configure -des -Dusedevel -Dcc=clang -Accflags="-DPERL_POISON 
-Werror=declaration-after-statement"
#####

But as soon as I included the '-fsanitize' options, compilation failed 
at the same point (after perly.c) as above.

Can anyone explain what is happening and what we should do about it?

Thank you very much.
Jim Keenan

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About