Changeset 222930 in webkit


Ignore:
Timestamp:
Oct 5, 2017 1:39:04 PM (7 years ago)
Author:
clopez@igalia.com
Message:

Generate a compile error if release is built without compiler optimizations
https://bugs.webkit.org/show_bug.cgi?id=177665

Reviewed by Brian Burg.

.:

Default to RelWithDebInfo if CMAKE_BUILD_TYPE is unset.

  • CMakeLists.txt:

Source/JavaScriptCore:

Pass -DRELEASE_WITHOUT_OPTIMIZATIONS to testair.cpp and testb3.cpp because
this files are compiled with -O0 for build speed reasons after r195639.

Source/WTF:

For GCC and Clang, generate an error at build time that will alert
the developer that she is trying to build Release without any compiler
optimization. A build time error is much better than an unexpected
"oh, WebKit is really slow ..." situation later.

If this was intended, then we tell the developer that she can continue
by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
flags.

The intention of this patch is to ensure that nobody builds Release
without enabling compiler optimization by mistake.

  • wtf/Compiler.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r222900 r222930  
     1# -----------------------------------------------------------------------------
     2# Determine CMake version and build type.
     3# -----------------------------------------------------------------------------
    14cmake_minimum_required(VERSION 3.3)
     5
     6if (NOT CMAKE_BUILD_TYPE)
     7    message(WARNING "No CMAKE_BUILD_TYPE value specified, defaulting to RelWithDebInfo.")
     8    set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
     9else ()
     10    message(STATUS "The CMake build type is: ${CMAKE_BUILD_TYPE}")
     11endif ()
     12
    213project(WebKit)
    314
  • trunk/ChangeLog

    r222927 r222930  
     12017-10-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        Generate a compile error if release is built without compiler optimizations
     4        https://bugs.webkit.org/show_bug.cgi?id=177665
     5
     6        Reviewed by Brian Burg.
     7
     8        Default to RelWithDebInfo if CMAKE_BUILD_TYPE is unset.
     9
     10        * CMakeLists.txt:
     11
    1122017-10-05  Tim Horton  <timothy_horton@apple.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r222929 r222930  
     12017-10-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        Generate a compile error if release is built without compiler optimizations
     4        https://bugs.webkit.org/show_bug.cgi?id=177665
     5
     6        Reviewed by Brian Burg.
     7
     8        Pass -DRELEASE_WITHOUT_OPTIMIZATIONS to testair.cpp and testb3.cpp because
     9        this files are compiled with -O0 for build speed reasons after r195639.
     10
     11        * JavaScriptCore.xcodeproj/project.pbxproj:
     12
    1132017-10-05  Saam Barati  <sbarati@apple.com>
    214
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r222901 r222930  
    345345                0F61833C1C45F62A0072450B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
    346346                0F61833D1C45F62A0072450B /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
    347                 0F6183451C45F6600072450B /* testair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183441C45F6600072450B /* testair.cpp */; settings = {COMPILER_FLAGS = "-O0"; }; };
     347                0F6183451C45F6600072450B /* testair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183441C45F6600072450B /* testair.cpp */; settings = {COMPILER_FLAGS = "-O0 -DRELEASE_WITHOUT_OPTIMIZATIONS"; }; };
    348348                0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */; };
    349349                0F620176143FCD3B0068B77C /* DFGBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620170143FCD2F0068B77C /* DFGBasicBlock.h */; };
     
    637637                0FEC85A31BDB5CF10080FF74 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
    638638                0FEC85A41BDB5CF10080FF74 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
    639                 0FEC85AF1BDB5D5E0080FF74 /* testb3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEC85AE1BDB5D5E0080FF74 /* testb3.cpp */; settings = {COMPILER_FLAGS = "-O0"; }; };
     639                0FEC85AF1BDB5D5E0080FF74 /* testb3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEC85AE1BDB5D5E0080FF74 /* testb3.cpp */; settings = {COMPILER_FLAGS = "-O0 -DRELEASE_WITHOUT_OPTIMIZATIONS"; }; };
    640640                0FEC85B31BDED9570080FF74 /* B3ConstPtrValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEC85B21BDED9570080FF74 /* B3ConstPtrValue.h */; };
    641641                0FEC85BA1BE1462F0080FF74 /* B3InsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEC85B51BE1462F0080FF74 /* B3InsertionSet.h */; };
  • trunk/Source/WTF/ChangeLog

    r222928 r222930  
     12017-10-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        Generate a compile error if release is built without compiler optimizations
     4        https://bugs.webkit.org/show_bug.cgi?id=177665
     5
     6        Reviewed by Brian Burg.
     7
     8        For GCC and Clang, generate an error at build time that will alert
     9        the developer that she is trying to build Release without any compiler
     10        optimization. A build time error is much better than an unexpected
     11        "oh, WebKit is really slow ..."  situation later.
     12
     13        If this was intended, then we tell the developer that she can continue
     14        by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
     15        flags.
     16
     17        The intention of this patch is to ensure that nobody builds Release
     18        without enabling compiler optimization by mistake.
     19
     20        * wtf/Compiler.h:
     21
    1222017-10-05  David Kilzer  <ddkilzer@apple.com>
    223
  • trunk/Source/WTF/wtf/Compiler.h

    r222870 r222930  
    105105#endif /* COMPILER(GCC) */
    106106
     107#if COMPILER(GCC_OR_CLANG) && defined(NDEBUG) && !defined(__OPTIMIZE__) && !defined(RELEASE_WITHOUT_OPTIMIZATIONS)
     108#error "Building release without compiler optimizations: WebKit will be slow. Set -DRELEASE_WITHOUT_OPTIMIZATIONS if this is intended."
     109#endif
     110
    107111/* COMPILER(MINGW) - MinGW GCC */
    108112
Note: See TracChangeset for help on using the changeset viewer.