From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 30 08:10:52 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 996B5DDC; Sat, 30 Mar 2013 08:10:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B29F66E6; Sat, 30 Mar 2013 08:10:51 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA29589; Sat, 30 Mar 2013 10:10:43 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ULqs7-000OOh-HX; Sat, 30 Mar 2013 10:10:43 +0200 Message-ID: <51569DFF.5080708@FreeBSD.org> Date: Sat, 30 Mar 2013 10:10:39 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130321 Thunderbird/17.0.4 MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org, toolchain@FreeBSD.org Subject: clang: -mno-omit-leaf-frame-pointer X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Mar 2013 08:10:52 -0000 It seems that, unlike gcc, for clang -fno-omit-frame-pointer does not imply -mno-omit-leaf-frame-pointer. This is probably a bug. Meanwhile I would like to propose the following amd64-specific patch. Perhaps the same type of change would be useful for powerpc as well. I would like this change primarily for DTrace (fbt), but other debugging/profiling code may benefit from it as well. I chose to make -mno-omit-leaf-frame-pointer not conditional on clang, because with gcc it is just a nop (i.e. it doesn't hurt anything). --- a/sys/conf/Makefile.amd64 +++ b/sys/conf/Makefile.amd64 @@ -32,7 +32,7 @@ S= ../../.. .include "$S/conf/kern.pre.mk" .if !empty(DDB_ENABLED) || !empty(DTR_ENABLED) || !empty(HWPMC_ENABLED) -CFLAGS+= -fno-omit-frame-pointer +CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif MKMODULESENV+= MACHINE=amd64 diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index f0d3d4d..7eaba85 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -122,7 +122,7 @@ LDFLAGS+= -d -warn-common CFLAGS+= ${DEBUG_FLAGS} .if ${MACHINE_CPUARCH} == amd64 -CFLAGS+= -fno-omit-frame-pointer +CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif .if ${MACHINE_CPUARCH} == powerpc -- Andriy Gapon