svn commit: r263692 - head

Warner Losh imp at bsdimp.com
Mon Mar 24 20:09:59 UTC 2014


On Mar 24, 2014, at 2:01 PM, Ian Lepore <ian at FreeBSD.org> wrote:

> On Mon, 2014-03-24 at 20:47 +0100, Dimitry Andric wrote:
>> On 24 Mar 2014, at 20:36, Warner Losh <imp at bsdimp.com> wrote:
>>> On Mar 24, 2014, at 1:21 PM, Dimitry Andric <dim at FreeBSD.org> wrote:
>>>> Author: dim
>>>> Date: Mon Mar 24 19:21:14 2014
>>>> New Revision: 263692
>>>> URL: http://svnweb.freebsd.org/changeset/base/263692
>>>> 
>>>> Log:
>>>> Add a note to UPDATING about customized kernel configuration files now
>>>> requiring -gdwarf-2 for debug info, when using clang 3.4.
>>> 
>>> Makes we wonder why we didn’t put this in kmod.mk…  Is there any reason not do?
>> 
>> For modules, you can just DEBUG_FLAGS, like for world.  But there is no
>> default value of DEBUG_FLAGS in kmod.mk, at least I don't see any.
>> 
>> -Dimitry
>> 
> 
> I guessing he meant kern.mk so that it would be in effect for both
> kernel and modules build.  Something like this (which I've tested only
> for building an arm kernel without modules so far)...
> 
> -- Ian
> 
> Index: sys/conf/kern.mk
> ===================================================================
> --- sys/conf/kern.mk	(revision 263112)
> +++ sys/conf/kern.mk	(working copy)
> @@ -162,3 +162,7 @@ CFLAGS+=	-ffreestanding
>     ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
> CFLAGS+=	-fstack-protector
> .endif
> +
> +.if ${COMPILER_TYPE} == "clang" && !empty(CFLAGS:M-g*) && empty(CFLAGS:M-gdwarf*)
> +CFLAGS+= -gdwarf-2
> +.endif

Exactly. We don’t need more kludge-o-ramas for this in the config files, we need fewer. Since clang doesn’t play well with the kernel on this detail, and since the kernel makefiles can cope, we should make them rather than having it hard-coded in lots of config files (or std.* files) that we’ll just need to remove later when we have a dwarf 4 solution.

Warner


More information about the svn-src-head mailing list