Re: NDEBUG when building packages?
- To: debian-devel@lists.debian.org
- Cc: debian-devel@lists.debian.org
- Subject: Re: NDEBUG when building packages?
- From: Mathieu Malaterre <malat@debian.org>
- Date: Fri, 7 Jun 2013 11:54:49 +0200
- Message-id: <[🔎] CA+7wUsx-La707opCh_HrcrAjUQw7DdAkTAa4HXov8Vfp=MX6AA@mail.gmail.com>
- In-reply-to: <CACZd_tBqy0VUA+ZRWEJZxMucpdTQcN0=CO+AyuZnaEcZ_JmxVw@mail.gmail.com>
- References: <5113FE77.8010508@pocock.com.au> <20771.43161.813488.58458@chiark.greenend.org.uk> <CA+7wUsyPGyTh9ThHoKhxAk-bF2gv1mDoxx8HZC-QJix9srFO+Q@mail.gmail.com> <20775.38178.57144.518678@chiark.greenend.org.uk> <87mwuw9imi.fsf@windlord.stanford.edu> <CA+7wUswHYHypftg0zJ1s638Sy=2LJmrUBy5g3Gz9669eHE=Kmg@mail.gmail.com> <CACZd_tBqy0VUA+ZRWEJZxMucpdTQcN0=CO+AyuZnaEcZ_JmxVw@mail.gmail.com>
On Sat, Feb 23, 2013 at 11:09 AM, Vincent Cheng <vincentc1208@gmail.com> wrote:
> On Sat, Feb 23, 2013 at 1:39 AM, Mathieu Malaterre <malat@debian.org> wrote:
>> On Fri, Feb 22, 2013 at 9:52 PM, Russ Allbery <rra@debian.org> wrote:
>>> Ian Jackson <ijackson@chiark.greenend.org.uk> writes:
>>>> Mathieu Malaterre writes ("Re: NDEBUG when building packages?"):
>>>
>>>>> In that case, this should really be clarified. A lot of debian/cmake
>>>>> packages are actually doing:
>>>
>>>>> -DCMAKE_BUILD_TYPE:STRING=Release
>>>
>>>>> within there debian/rules files. This settings by default compiles
>>>>> with: `-O3 -DNDEBUG`
>>>
>>>> OMG WTF BBQ
>>>
>>>> Certainly -DNDEBUG should never be used unless upstream explicitly say
>>>> that it's intended to be supported, and usually not even then.
>>>
>>> Also, -O3 is generally considered rather iffy. It's not very well-tested
>>> and in various versions of GCC it tended to make the code slower, not
>>> faster (usually because it unrolled loops too far and blew the CPU cache).
>>> It's also had various code generation bugs from time to time.
>>>
>>> I wouldn't use -O3 without benchmarking of that specific code to confirm
>>> that it really improves matters.
>>
>> Seems like everyone agreed. I'll report a bug to lintian package to
>> have it check for this string in d/rules:
>>
>> http://codesearch.debian.net/search?q=DCMAKE_BUILD_TYPE:STRING%3DRelease
>
> We should also suggest that packages use
> -DCMAKE_BUILD_TYPE=RelWithDebInfo instead (-g -O2). In fact, I think
> that this would be a sensible default for packages using debhelper's
> cmake integration. Sounds like another wishlist bug for debhelper...
cmake from sid makes it even harder. RelWithDebInfo now contains
-DNDEBUG ... I have to source-upload all my packages :(
$ grep NDEBUG ChangeLog.manual
Add -DNDEBUG to RelWithDebInfo flags where where Release flags had it.
The solution (backward compat) is now:
Either do *not* define CMAKE_BUILD_TYPE, or define CMAKE_BUILD_TYPE to
Debug (and hope -DNDEBUG does not creep in ever)
2cts
Reply to: