Revert to the correct value of lddlflags for AddressSanitizer
authorVincent Pit <perl@profvince.com>
Fri, 22 Jun 2012 12:02:20 +0000 (14:02 +0200)
committerVincent Pit <perl@profvince.com>
Fri, 22 Jun 2012 12:07:39 +0000 (14:07 +0200)
-Afoo=val appends 'val' to the value of variable foo after the platform
hints are processed, but before the default value is computed by Configure.
At this time, 'foo' appears as non-empty and Configure skips the default
logic. This is the reason -shared must always be added to lddlflags.

I don't know why I didn't caught this while testing AddressSanitizer builds.

pod/perlhacktips.pod

index 91ef14a..6c33550 100644 (file)
@@ -1172,8 +1172,9 @@ Windows.
 To build perl with AddressSanitizer, your Configure invocation should
 look like:
 
-    sh Configure -des -Dcc=clang -Accflags=-faddress-sanitizer \
-     -Aldflags=-faddress-sanitizer -Alddlflags=-faddress-sanitizer
+    sh Configure -des -Dcc=clang \
+       -Accflags=-faddress-sanitizer -Aldflags=-faddress-sanitizer \
+       -Alddlflags=-shared\ -faddress-sanitizer
 
 where these arguments mean:
 
@@ -1192,13 +1193,12 @@ Compile perl and extensions sources with AddressSanitizer.
 
 Link the perl executable with AddressSanitizer.
 
-=item * -Alddlflags=-faddress-sanitizer
+=item * -Alddlflags=-shared\ -faddress-sanitizer
 
-Link dynamic extensions with AddressSanitizer.
-
-If you also pass C<-Duseshrplib> to Configure in order to build a
-shared perl library, then you must replace this by
-C<-Alddlflags=-shared\ -faddress-sanitizer>.
+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).
 
 =back