Add NDEBUG and CodeStripping to libwebrtc build system
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Apr 2017 01:51:00 +0000 (01:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Apr 2017 01:51:00 +0000 (01:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170954

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-18
Reviewed by Alex Christensen.

This optimizes libwebrtc library size and efficiency.
This allows allocating libwebrtc objects in WebCore without issues.

* Configurations/Base.xcconfig:
* Configurations/boringssl.xcconfig:
* Configurations/libsrtp.xcconfig:
* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:
* Configurations/opus.xcconfig:
* Configurations/usrsctp.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig
Source/ThirdParty/libwebrtc/Configurations/boringssl.xcconfig
Source/ThirdParty/libwebrtc/Configurations/libsrtp.xcconfig
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig
Source/ThirdParty/libwebrtc/Configurations/libwebrtcpcrtc.xcconfig
Source/ThirdParty/libwebrtc/Configurations/opus.xcconfig
Source/ThirdParty/libwebrtc/Configurations/usrsctp.xcconfig

index 1eb426c..e0fc309 100644 (file)
@@ -1,3 +1,21 @@
+2017-04-18  Youenn Fablet  <youenn@apple.com>
+
+        Add NDEBUG and CodeStripping to libwebrtc build system
+        https://bugs.webkit.org/show_bug.cgi?id=170954
+
+        Reviewed by Alex Christensen.
+
+        This optimizes libwebrtc library size and efficiency.
+        This allows allocating libwebrtc objects in WebCore without issues.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/boringssl.xcconfig:
+        * Configurations/libsrtp.xcconfig:
+        * Configurations/libwebrtc.xcconfig:
+        * Configurations/libwebrtcpcrtc.xcconfig:
+        * Configurations/opus.xcconfig:
+        * Configurations/usrsctp.xcconfig:
+
 2017-04-17  Youenn Fablet  <youenn@apple.com>
 
         Add an external libwebrtc encoder factory in WebCore
index 6d5cbdc..b9d2daa 100644 (file)
@@ -56,10 +56,31 @@ TARGET_MAC_OS_X_VERSION_MAJOR_14 = 101400;
 
 SDKROOT = macosx.internal;
 
+
+// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
+// We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
+DEBUG_DEFINES_debug = ;
+DEBUG_DEFINES_normal = NDEBUG;
+DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT));
+
+GCC_OPTIMIZATION_LEVEL = $(GCC_OPTIMIZATION_LEVEL_$(CURRENT_VARIANT));
+GCC_OPTIMIZATION_LEVEL_normal = 3;
+GCC_OPTIMIZATION_LEVEL_debug = 0;
+
+STRIP_INSTALLED_PRODUCT = $(STRIP_INSTALLED_PRODUCT_$(CURRENT_VARIANT));
+STRIP_INSTALLED_PRODUCT_normal = YES;
+STRIP_INSTALLED_PRODUCT_debug = NO;
+
+DEAD_CODE_STRIPPING_debug = NO;
+DEAD_CODE_STRIPPING_normal = YES;
+DEAD_CODE_STRIPPING = $(DEAD_CODE_STRIPPING_$(CURRENT_VARIANT));
+
 OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS);
 OTHER_CPLUSPLUSFLAGS = $(ASAN_OTHER_CPLUSPLUSFLAGS);
 OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
 
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(inherited);
+
 NORMAL_WEBCORE_FRAMEWORKS_DIR = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
 NORMAL_WEBCORE_FRAMEWORKS_DIR[sdk=macosx*] = $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
 
index f6d8f41..35d570f 100644 (file)
@@ -12,4 +12,4 @@ PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/libwebrtc;
 USE_HEADERMAP = NO;
 
 // FIXME: There's no assembly used in the boringssl build yet :(
-GCC_PREPROCESSOR_DEFINITIONS = OPENSSL_NO_ASM;
+GCC_PREPROCESSOR_DEFINITIONS = OPENSSL_NO_ASM $(inherited);
index 1004db8..da81621 100644 (file)
@@ -11,4 +11,4 @@ HEADER_SEARCH_PATHS = Source/third_party/libsrtp/include Source/third_party/libs
 INSTALL_PATH = /usr/local/lib;
 PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/libwebrtc;
 USE_HEADERMAP = NO;
-GCC_PREPROCESSOR_DEFINITIONS = V8_DEPRECATION_WARNINGS ENABLE_NOTIFICATIONS ENABLE_PLUGINS=1 ENABLE_PDF=1 ENABLE_PRINTING=1 ENABLE_BASIC_PRINTING=1 ENABLE_PRINT_PREVIEW=1 ENABLE_SPELLCHECK=1 USE_BROWSER_SPELLCHECKER=1 NO_TCMALLOC USE_EXTERNAL_POPUP_MENU=1 ENABLE_WEBRTC=1 ENABLE_EXTENSIONS=1 ENABLE_TASK_MANAGER=1 ENABLE_THEMES=1 ENABLE_SESSION_SERVICE=1 ENABLE_SUPERVISED_USERS=1 FULL_SAFE_BROWSING SAFE_BROWSING_CSD SAFE_BROWSING_DB_LOCAL CHROMIUM_BUILD ENABLE_MEDIA_ROUTER=1 FIELDTRIAL_TESTING_ENABLED CR_CLANG_REVISION=284979-1 CR_XCODE_VERSION=0820 __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 _DEBUG DYNAMIC_ANNOTATIONS_ENABLED=1 WTF_USE_DYNAMIC_ANNOTATIONS=1 PACKAGE_STRING="\"libsrtp2 2.0.0-pre\"" PACKAGE_VERSION="\"2.0.0-pre\"" HAVE_CONFIG_H OPENSSL HAVE_STDLIB_H HAVE_STRING_H HAVE_STDINT_H HAVE_INTTYPES_H HAVE_INT16_T HAVE_INT32_T HAVE_INT8_T HAVE_UINT16_T HAVE_UINT32_T HAVE_UINT64_T HAVE_UINT8_T HAVE_ARPA_INET_H HAVE_NETINET_IN_H HAVE_SYS_TYPES_H HAVE_UNISTD_H;
+GCC_PREPROCESSOR_DEFINITIONS = V8_DEPRECATION_WARNINGS ENABLE_NOTIFICATIONS ENABLE_PLUGINS=1 ENABLE_PDF=1 ENABLE_PRINTING=1 ENABLE_BASIC_PRINTING=1 ENABLE_PRINT_PREVIEW=1 ENABLE_SPELLCHECK=1 USE_BROWSER_SPELLCHECKER=1 NO_TCMALLOC USE_EXTERNAL_POPUP_MENU=1 ENABLE_WEBRTC=1 ENABLE_EXTENSIONS=1 ENABLE_TASK_MANAGER=1 ENABLE_THEMES=1 ENABLE_SESSION_SERVICE=1 ENABLE_SUPERVISED_USERS=1 FULL_SAFE_BROWSING SAFE_BROWSING_CSD SAFE_BROWSING_DB_LOCAL CHROMIUM_BUILD ENABLE_MEDIA_ROUTER=1 FIELDTRIAL_TESTING_ENABLED CR_CLANG_REVISION=284979-1 CR_XCODE_VERSION=0820 __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 _DEBUG DYNAMIC_ANNOTATIONS_ENABLED=1 WTF_USE_DYNAMIC_ANNOTATIONS=1 PACKAGE_STRING="\"libsrtp2 2.0.0-pre\"" PACKAGE_VERSION="\"2.0.0-pre\"" HAVE_CONFIG_H OPENSSL HAVE_STDLIB_H HAVE_STRING_H HAVE_STDINT_H HAVE_INTTYPES_H HAVE_INT16_T HAVE_INT32_T HAVE_INT8_T HAVE_UINT16_T HAVE_UINT32_T HAVE_UINT64_T HAVE_UINT8_T HAVE_ARPA_INET_H HAVE_NETINET_IN_H HAVE_SYS_TYPES_H HAVE_UNISTD_H $(inherited);
index 39151e8..ab62867 100644 (file)
@@ -26,7 +26,7 @@ USE_HEADERMAP = NO;
 INSTALLHDRS_SCRIPT_PHASE = YES;
 WARNING_CFLAGS = -Wno-deprecated-declarations;
 
-GCC_PREPROCESSOR_DEFINITIONS = WEBRTC_POSIX WEBRTC_MAC SSL_USE_OPENSSL FEATURE_ENABLE_SSL HAVE_SRTP HAVE_OPENSSL_SSL_H SCTP_PROCESS_LEVEL_LOCKS SCTP_SIMPLE_ALLOCATOR SCTP_USE_OPENSSL_SHA1 __Userspace__ HAVE_SA_LEN HAVE_SCONN_LEN __APPLE_USE_RFC_2292 __Userspace_os_Darwin NON_WINDOWS_DEFINE HAVE_WEBRTC_VIDEO HAVE_WEBRTC_VOICE WEBRTC_INTELLIGIBILITY_ENHANCER=0 WEBRTC_APM_DEBUG_DUMP=0 WEBRTC_NS_FLOAT WEBRTC_CODEC_ILBC WEBRTC_CODEC_OPUS WEBRTC_CODEC_ISAC WEBRTC_CODEC_RED RTC_DISABLE_VP9 RTC_DISABLE_VP8 HAVE_STDINT_H HAVE_STDLIB_H HAVE_UINT64_T OPENSSL HAVE_CONFIG_H WEBRTC_WEBKIT_BUILD HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE  HAVE_SCTP WEBRTC_CODEC_G711 WEBRTC_CODEC_G722;
+GCC_PREPROCESSOR_DEFINITIONS = WEBRTC_POSIX WEBRTC_MAC SSL_USE_OPENSSL FEATURE_ENABLE_SSL HAVE_SRTP HAVE_OPENSSL_SSL_H SCTP_PROCESS_LEVEL_LOCKS SCTP_SIMPLE_ALLOCATOR SCTP_USE_OPENSSL_SHA1 __Userspace__ HAVE_SA_LEN HAVE_SCONN_LEN __APPLE_USE_RFC_2292 __Userspace_os_Darwin NON_WINDOWS_DEFINE HAVE_WEBRTC_VIDEO HAVE_WEBRTC_VOICE WEBRTC_INTELLIGIBILITY_ENHANCER=0 WEBRTC_APM_DEBUG_DUMP=0 WEBRTC_NS_FLOAT WEBRTC_CODEC_ILBC WEBRTC_CODEC_OPUS WEBRTC_CODEC_ISAC WEBRTC_CODEC_RED RTC_DISABLE_VP9 RTC_DISABLE_VP8 HAVE_STDINT_H HAVE_STDLIB_H HAVE_UINT64_T OPENSSL HAVE_CONFIG_H WEBRTC_WEBKIT_BUILD HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE  HAVE_SCTP WEBRTC_CODEC_G711 WEBRTC_CODEC_G722 $(inherited);
 
 GCC_PREPROCESSOR_DEFINITIONS[sdk=macosx*] = $(inherited) WEBRTC_USE_VTB_HARDWARE_ENCODER;
 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) WEBRTC_IOS;
index 69ed83e..f1fc762 100644 (file)
@@ -12,7 +12,7 @@ INSTALL_PATH = /usr/local/lib;
 PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/libwebrtc;
 USE_HEADERMAP = NO;
 
-GCC_PREPROCESSOR_DEFINITIONS = WEBRTC_POSIX WEBRTC_MAC SSL_USE_OPENSSL FEATURE_ENABLE_SSL HAVE_SRTP HAVE_OPENSSL_SSL_H SCTP_PROCESS_LEVEL_LOCKS SCTP_SIMPLE_ALLOCATOR SCTP_USE_OPENSSL_SHA1 __Userspace__ HAVE_SA_LEN HAVE_SCONN_LEN __APPLE_USE_RFC_2292 __Userspace_os_Darwin NON_WINDOWS_DEFINE HAVE_WEBRTC_VIDEO HAVE_WEBRTC_VOICE WEBRTC_INTELLIGIBILITY_ENHANCER=0 WEBRTC_APM_DEBUG_DUMP=0 WEBRTC_NS_FLOAT WEBRTC_CODEC_ILBC WEBRTC_CODEC_OPUS WEBRTC_CODEC_ISAC WEBRTC_CODEC_RED RTC_DISABLE_VP9 RTC_DISABLE_VP8 HAVE_STDINT_H HAVE_STDLIB_H HAVE_UINT64_T OPENSSL HAVE_CONFIG_H WEBRTC_WEBKIT_BUILD HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE  HAVE_SCTP;
+GCC_PREPROCESSOR_DEFINITIONS = WEBRTC_POSIX WEBRTC_MAC SSL_USE_OPENSSL FEATURE_ENABLE_SSL HAVE_SRTP HAVE_OPENSSL_SSL_H SCTP_PROCESS_LEVEL_LOCKS SCTP_SIMPLE_ALLOCATOR SCTP_USE_OPENSSL_SHA1 __Userspace__ HAVE_SA_LEN HAVE_SCONN_LEN __APPLE_USE_RFC_2292 __Userspace_os_Darwin NON_WINDOWS_DEFINE HAVE_WEBRTC_VIDEO HAVE_WEBRTC_VOICE WEBRTC_INTELLIGIBILITY_ENHANCER=0 WEBRTC_APM_DEBUG_DUMP=0 WEBRTC_NS_FLOAT WEBRTC_CODEC_ILBC WEBRTC_CODEC_OPUS WEBRTC_CODEC_ISAC WEBRTC_CODEC_RED RTC_DISABLE_VP9 RTC_DISABLE_VP8 HAVE_STDINT_H HAVE_STDLIB_H HAVE_UINT64_T OPENSSL HAVE_CONFIG_H WEBRTC_WEBKIT_BUILD HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE  HAVE_SCTP $(inherited);
 
 GCC_PREPROCESSOR_DEFINITIONS[sdk=macosx*] = $(inherited);
 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) WEBRTC_IOS;
index 6275c9d..6757b1b 100644 (file)
@@ -11,7 +11,7 @@ INSTALL_PATH = /usr/local/lib;
 PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/libwebrtc;
 USE_HEADERMAP = NO;
 WARNING_CFLAGS = -Wno-incompatible-pointer-types
-GCC_PREPROCESSOR_DEFINITIONS = VAR_ARRAYS OPUS_BUILD OPUS_EXPORT= HAVE_LRINT HAVE_LRINTF OPUS_X86_MAY_HAVE_SSE2;
+GCC_PREPROCESSOR_DEFINITIONS = VAR_ARRAYS OPUS_BUILD OPUS_EXPORT= HAVE_LRINT HAVE_LRINTF OPUS_X86_MAY_HAVE_SSE2 $(inherited);
 GCC_PREPROCESSOR_DEFINITIONS[arch=arm64*] = $(inherited) OPUS_ARM_PRESUME_AARCH64_NEON_INTR;
 GCC_PREPROCESSOR_DEFINITIONS[arch=x86_64] = $(inherited) $(SSE4_FLAG);
 
index de52baa..bea0216 100644 (file)
@@ -11,5 +11,5 @@ INSTALL_PATH = /usr/local/lib;
 PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/libwebrtc;
 USE_HEADERMAP = NO;
 WARNING_CFLAGS = -Wno-deprecated-declarations;
-GCC_PREPROCESSOR_DEFINITIONS = SCTP_PROCESS_LEVEL_LOCKS SCTP_SIMPLE_ALLOCATOR SCTP_USE_OPENSSL_SHA1 __Userspace__ HAVE_SA_LEN HAVE_SCONN_LEN __APPLE_USE_RFC_2292 __Userspace_os_Darwin;
+GCC_PREPROCESSOR_DEFINITIONS = SCTP_PROCESS_LEVEL_LOCKS SCTP_SIMPLE_ALLOCATOR SCTP_USE_OPENSSL_SHA1 __Userspace__ HAVE_SA_LEN HAVE_SCONN_LEN __APPLE_USE_RFC_2292 __Userspace_os_Darwin $(inherited);
 OTHER_CFLAGS = -UINET -UINET6 -U__APPLE__;