Changeset 177703 in webkit
- Timestamp:
- Dec 23, 2014 4:13:16 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r177358 r177703 1 2014-12-23 Alexey Proskuryakov <ap@apple.com> 2 3 Simplify building with ASan 4 https://bugs.webkit.org/show_bug.cgi?id=139916 5 6 Reviewed by Mark Rowe. 7 8 * Makefile.shared: Invoke set-webkit-configuration to store ASan choice as appropriate. 9 1 10 2014-12-16 Carlos Garcia Campos <cgarcia@igalia.com> 2 11 -
trunk/Makefile.shared
r172186 r177703 26 26 endif 27 27 28 ifeq ($(ASAN),YES) 29 ASAN_OPTION=--asan 30 else 31 ifeq ($(ASAN),NO) 32 ASAN_OPTION=--no-asan 33 endif 34 endif 35 28 36 export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu) 29 37 30 all: 38 all: set_asan_configuration 31 39 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) 32 40 33 41 debug d development dev develop: force 34 $(SCRIPTS_PATH)/set-webkit-configuration --debug 42 $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) 35 43 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) 36 44 37 45 release r deployment dep deploy: force 38 $(SCRIPTS_PATH)/set-webkit-configuration --release 46 $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) 39 47 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) 40 48 41 49 analyze: 42 $(SCRIPTS_PATH)/set-webkit-configuration --release 50 $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) 43 51 ifndef PATH_TO_SCAN_BUILD 44 52 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) … … 47 55 endif 48 56 57 set_asan_configuration: 58 ifneq (,$(ASAN_OPTION)) 59 $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION) 60 endif 61 49 62 clean: 50 63 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) -
trunk/Tools/ChangeLog
r177690 r177703 1 2014-12-23 Alexey Proskuryakov <ap@apple.com> 2 3 Simplify building with ASan 4 https://bugs.webkit.org/show_bug.cgi?id=139916 5 6 Reviewed by Mark Rowe. 7 8 * Scripts/set-webkit-configuration: Store ASan state into a new configuration file. 9 We could also update Configuration file format, but that's a little scary because 10 of how many places in code read it. 11 12 * Scripts/webkitdirs.pm: 13 (determineASanIsEnabled): Read it from ASan configuration file. 14 (argumentsForConfiguration): Added a FIXME. 15 (asanIsEnabled): A caching wrapper similar to what we have for other configuration options. 16 (XcodeOptions): Pass the options needed for ASan. 17 18 * asan/asan.xcconfig: Use the right toolchains. Made warnings fatal again, as there 19 no warnings to avoid. Removed explicit linking options, as -fsanitize=address does 20 that automatically. 21 1 22 2014-12-23 Alexey Proskuryakov <ap@apple.com> 2 23 -
trunk/Tools/Scripts/set-webkit-configuration
r165816 r177703 37 37 --32-bit Set the default architecture to 32-bit 38 38 --64-bit Set the default architecture to 64-bit 39 --[no-]asan Enable or disable clang address sanitizer 39 40 --debug Set the default configuration to debug 40 41 --release Set the default configuration to release … … 44 45 my $configuration = passedConfiguration(); 45 46 my $architecture = passedArchitecture(); 47 my $enableASAN = checkForArgumentAndRemoveFromARGV("--asan"); 48 my $disableASAN = checkForArgumentAndRemoveFromARGV("--no-asan"); 46 49 47 50 if (!$architecture) { … … 62 65 unlink "$baseProductDir/Configuration"; 63 66 unlink "$baseProductDir/Architecture"; 67 unlink "$baseProductDir/ASan"; 64 68 exit 0; 65 69 } 66 70 67 if (!$configuration && !$architecture ) {71 if (!$configuration && !$architecture && !$enableASAN && !$disableASAN || ($enableASAN && $disableASAN)) { 68 72 print STDERR $usage; 69 73 exit 1; … … 85 89 } 86 90 } 91 92 if ($enableASAN) { 93 open ASAN, ">", "$baseProductDir/ASan" or die; 94 print ASAN "YES"; 95 close ASAN; 96 } elsif ($disableASAN) { 97 unlink "$baseProductDir/ASan"; 98 } -
trunk/Tools/Scripts/webkitdirs.pm
r175555 r177703 91 91 92 92 my $architecture; 93 my $asanIsEnabled; 93 94 my $numberOfCPUs; 94 95 my $maxCPULoad; … … 348 349 } 349 350 351 sub determineASanIsEnabled 352 { 353 return if defined $asanIsEnabled; 354 determineBaseProductDir(); 355 356 $asanIsEnabled = 0; 357 my $asanConfigurationValue; 358 359 if (open ASAN, "$baseProductDir/ASan") { 360 $asanConfigurationValue = <ASAN>; 361 close ASAN; 362 chomp $asanConfigurationValue; 363 $asanIsEnabled = 1 if $asanConfigurationValue eq "YES"; 364 } 365 } 366 350 367 sub determineNumberOfCPUs 351 368 { … … 393 410 394 411 my @args = (); 412 # FIXME: Is it necessary to pass --debug, --release, --32-bit or --64-bit? 413 # These are determined automatically from stored configuration. 395 414 push(@args, '--debug') if ($configuration =~ "^Debug"); 396 415 push(@args, '--release') if ($configuration =~ "^Release"); … … 589 608 } 590 609 610 sub asanIsEnabled() 611 { 612 determineASanIsEnabled(); 613 return $asanIsEnabled; 614 } 615 591 616 sub configurationForVisualStudio() 592 617 { … … 625 650 determineConfiguration(); 626 651 determineArchitecture(); 652 determineASanIsEnabled(); 627 653 determineXcodeSDK(); 628 654 629 655 my @sdkOption = ($xcodeSDK ? "SDKROOT=$xcodeSDK" : ()); 630 656 my @architectureOption = ($architecture ? "ARCHS=$architecture" : ()); 631 632 return (@baseProductDirOption, "-configuration", $configuration, @architectureOption, @sdkOption, argumentsForXcode()); 657 my @asanOption = ($asanIsEnabled ? ("-xcconfig", sourceDir() . "/Tools/asan/asan.xcconfig", "ASAN_IGNORE=" . sourceDir() . "/Tools/asan/webkit-asan-ignore.txt") : ()); 658 659 return (@baseProductDirOption, "-configuration", $configuration, @architectureOption, @sdkOption, @asanOption, argumentsForXcode()); 633 660 } 634 661 -
trunk/Tools/asan/asan.xcconfig
r174290 r177703 1 GCC_TREAT_WARNINGS_AS_ERRORS = NO; 1 TOOLCHAINS[sdk=iphone*] = $(TOOLCHAINS); 2 TOOLCHAINS = $(TOOLCHAINS_$(PLATFORM_NAME)_$(MAC_OS_X_VERSION_MAJOR)); 3 TOOLCHAINS_macosx_1080 = default; 4 TOOLCHAINS_macosx_1090 = default; 5 TOOLCHAINS_macosx_101000 = default; 6 TOOLCHAINS_macosx_101100 = $(TOOLCHAINS); 2 7 3 ASAN_OTHER_CFLAGS = -fsanitize=address -O1 -fsanitize-blacklist=$(ASAN_IGNORE) - Wno-error -fno-omit-frame-pointer -g -DUSE_SYSTEM_MALLOC=1;8 ASAN_OTHER_CFLAGS = -fsanitize=address -O1 -fsanitize-blacklist=$(ASAN_IGNORE) -fno-omit-frame-pointer -g -DUSE_SYSTEM_MALLOC=1; 4 9 ASAN_OTHER_CPLUSPLUSFLAGS = $(ASAN_OTHER_CFLAGS); 5 ASAN_OTHER_LDFLAGS = -fsanitize=address $(ASAN_OTHER_LDFLAGS_$(PLATFORM_NAME));6 ASAN_OTHER_LDFLAGS_macosx = -lclang_rt.asan_osx_dynamic; 7 ASAN_OTHER_LDFLAGS_iphonesimulator = -lclang_rt.asan_iossim_dynamic;10 ASAN_OTHER_LDFLAGS = -fsanitize=address; 11 12 GCC_ENABLE_OBJC_GC = NO;
Note: See TracChangeset
for help on using the changeset viewer.