<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>271737</bug_id>
          
          <creation_ts>2024-03-26 17:26:55 -0700</creation_ts>
          <short_desc>[CMake][GLib] Add a build option to enable recommended optimizations</short_desc>
          <delta_ts>2024-10-31 05:47:01 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CMake</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=266396</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>270902</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Perez">aperez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2024056</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-03-26 17:26:55 -0700</bug_when>
    <thetext>In bug #270902 we are introducing compiler flags with compiler+linker
optimizations. We would like to have those enabled by default, but allow
packagers/distributors to opt-out of our set of “recommended” options.

We could call this USE_RECOMMENDED_OPTIMIZATIONS, or similar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071840</commentid>
    <comment_count>1</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-10-31 05:14:40 -0700</bug_when>
    <thetext>From the discussion in https://github.com/WebKit/WebKit/pull/21785

  [...] the build system for Chromium has an option which basically
  means “I wanna make a production build” which is toggles everything
  the authors want to have in the official builds. We could rename
  the USE_CXX_STDLIB_ASSERTIONS to something else like and make it
  cover a set of recommended hardening options—C++ library assertions
  would be the first one.

I think that could be part of this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071841</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-10-31 05:18:48 -0700</bug_when>
    <thetext>Another comment from the GitHub discuission... not sure if it may be
good to split to a separate bug depending on this one, but leaving it
here for the sake of having the notes all here:

  &gt; &gt; Alternatively (or additionally) we can also disable them [the
  &gt; &gt; &quot;production build&quot; options by default with CMAKE_BUILD_TYPE=None,
  &gt; &gt; which is the recommended way to go for distributors and lets CMake
  &gt; &gt;  pick only the compiler flags defined in the environment.
  &gt; 
  &gt; I&apos;m not sure:
  &gt; 
  &gt; * The WebKit build warns you if the build type is missing, and
  &gt;   forcibly sets it. We would have to change that
  &gt; * Many major distributors set the build type for all packages to
  &gt;   avoid problems like the above. GNOME uses RelWithDebInfo. I think
  &gt;   Mageia does too. Fedora does not. I&apos;m not sure about Debian.
  &gt; 
  &gt; Intuitively, the idea sounds good to me though. Setting nice flags
  &gt; _except_ if you have a &quot;plain&quot; build type seems good and equivalent
  &gt; to how meson works. It could also work by just using the build type
  &gt; as input for the default value of a new option.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071844</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-10-31 05:47:01 -0700</bug_when>
    <thetext>Discussion regarding hardening flags: https://github.com/WebKit/WebKit/pull/21785#pullrequestreview-1781881751</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>