From owner-freebsd-toolchain@FreeBSD.ORG Fri May 27 11:51:47 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 7F29E1065688; Fri, 27 May 2011 11:51:47 +0000 (UTC) Date: Fri, 27 May 2011 11:51:47 +0000 From: Alexander Best To: freebsd-hackers@freebsd.org Message-ID: <20110527115147.GA73802@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline Cc: freebsd-toolchain@freebsd.org Subject: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 11:51:47 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi there, i would like to hear people's opinion regarding the following patch. it features the following semantic changes: 1) -W is now called -Wextra 2) move -fformat-extensions and -fdiagnostics-show-option out of CWARNFLAGS, since they aren't really warnings. this will now let anybody use custom CWARNFLAGS without having to remember to add -fformat-extensions in order not to break buildworld. 3) rearrange "\" characters, as to avoid double spaces 4) when building kernel modules, -fstack-protector was added to CFLAGS twice. this should now be solved. cheers. alex -- a13x --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kern.mk-bsy.sys.mk.patch" diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 796d169..eec7408 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -36,7 +36,7 @@ CWARNFLAGS += -Werror CWARNFLAGS += -Wall -Wno-format-y2k . endif . if ${WARNS} >= 3 -CWARNFLAGS += -W -Wno-unused-parameter -Wstrict-prototypes\ +CWARNFLAGS += -Wextra -Wno-unused-parameter -Wstrict-prototypes\ -Wmissing-prototypes -Wpointer-arith . endif . if ${WARNS} >= 4 diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index a0a595f..0806b0b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -3,10 +3,9 @@ # # Warning flags for compiling the kernel and components of the kernel: # -CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ - -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -Wundef -Wno-pointer-sign -fformat-extensions \ - -Wmissing-include-dirs -fdiagnostics-show-option +CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes\ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual\ + -Wundef -Wno-pointer-sign -Wmissing-include-dirs # # The following flags are next up for working on: # -Wextra @@ -83,7 +82,7 @@ CFLAGS+= -mno-sse .else CFLAGS+= -mno-aes -mno-avx .endif -CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \ +CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float\ -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif @@ -120,11 +119,17 @@ INLINE_LIMIT?= 8000 CFLAGS+= -ffreestanding # +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. +CFLAGS+= -fformat-extensions -fdiagnostics-show-option + +# # GCC SSP support # .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" -CFLAGS+= -fstack-protector +SSP_CFLAGS?= -fstack-protector +CFLAGS+= ${SSP_CFLAGS} .endif # --rwEMma7ioTxnRzrJ-- From owner-freebsd-toolchain@FreeBSD.ORG Fri May 27 17:38:03 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 736461065672; Fri, 27 May 2011 17:38:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD678FC0A; Fri, 27 May 2011 17:38:03 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p4RHLKUt056377 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 27 May 2011 11:21:24 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110527115147.GA73802@freebsd.org> Date: Fri, 27 May 2011 11:21:14 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> References: <20110527115147.GA73802@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 27 May 2011 11:21:24 -0600 (MDT) Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 17:38:03 -0000 These look generally good. Just one thing I had a question on: # +# Enable FreeBSD kernel-specific printf format specifiers. Also = instruct gcc to +# enable some diagnostics, which make it easier to pinpoint tinderbox = failures. +CFLAGS+=3D -fformat-extensions -fdiagnostics-show-option + Does this put sand in the gears of clang support? Warner On May 27, 2011, at 5:51 AM, Alexander Best wrote: > hi there, >=20 > i would like to hear people's opinion regarding the following patch. = it > features the following semantic changes: >=20 > 1) -W is now called -Wextra > 2) move -fformat-extensions and -fdiagnostics-show-option out of = CWARNFLAGS, > since they aren't really warnings. this will now let anybody use = custom > CWARNFLAGS without having to remember to add -fformat-extensions in = order > not to break buildworld. > 3) rearrange "\" characters, as to avoid double spaces > 4) when building kernel modules, -fstack-protector was added to CFLAGS = twice. > this should now be solved. >=20 > cheers. > alex >=20 > --=20 > a13x > = _______________________________________________ > freebsd-toolchain@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > To unsubscribe, send any mail to = "freebsd-toolchain-unsubscribe@freebsd.org" From owner-freebsd-toolchain@FreeBSD.ORG Fri May 27 18:14:59 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id 73206106566B; Fri, 27 May 2011 18:14:59 +0000 (UTC) Date: Fri, 27 May 2011 18:14:59 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110527181459.GA29908@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 18:14:59 -0000 On Fri May 27 11, Warner Losh wrote: > These look generally good. Just one thing I had a question on: > > # > +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to > +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. > +CFLAGS+= -fformat-extensions -fdiagnostics-show-option > + > > Does this put sand in the gears of clang support? i don't think so. the code that features -fformat-extensions support is freebsd specific and gets plugged into the vendor code during every new import. dim@ and rdivacky@ have been discussing the possibility of getting this committed upstream as something like -ffreebsd-extensions, but they haven't decided, yet. regarding -fdiagnostics-show-option: this is intended purely for gcc, since it is disabled per default. under clang the flag exists, too, but it is enabled by default. so specifying it under clang is pretty much a nop. cheers. alex > > Warner > > > On May 27, 2011, at 5:51 AM, Alexander Best wrote: > > > hi there, > > > > i would like to hear people's opinion regarding the following patch. it > > features the following semantic changes: > > > > 1) -W is now called -Wextra > > 2) move -fformat-extensions and -fdiagnostics-show-option out of CWARNFLAGS, > > since they aren't really warnings. this will now let anybody use custom > > CWARNFLAGS without having to remember to add -fformat-extensions in order > > not to break buildworld. > > 3) rearrange "\" characters, as to avoid double spaces > > 4) when building kernel modules, -fstack-protector was added to CFLAGS twice. > > this should now be solved. > > > > cheers. > > alex > > > > -- > > a13x > > _______________________________________________ > > freebsd-toolchain@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > > To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe@freebsd.org" -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Fri May 27 18:29:06 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id 7105C1065673; Fri, 27 May 2011 18:29:06 +0000 (UTC) Date: Fri, 27 May 2011 18:29:06 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110527182906.GA31871@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110527181459.GA29908@freebsd.org> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 18:29:06 -0000 On Fri May 27 11, Alexander Best wrote: > On Fri May 27 11, Warner Losh wrote: > > These look generally good. Just one thing I had a question on: > > > > # > > +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to > > +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. > > +CFLAGS+= -fformat-extensions -fdiagnostics-show-option > > + > > > > Does this put sand in the gears of clang support? i've improved the above comment so as to note that clang won't be affected by -fdiagnostics-show-option. the new patch is available here: http://people.freebsd.org/~arundel/patches/kern.mk-bsy.sys.mk.patch another "issue" i've come across is the fact that on amd64, -O2 is always being set, no matter, if debugging is enabled or disabled. i think amd64 should also (just like all the other archs) be using -O, when debugging was enabled. changing this is quite easy. so if people think this is something worth changing i can integrate it into my existing patch. cheers. alex > > i don't think so. the code that features -fformat-extensions support is freebsd > specific and gets plugged into the vendor code during every new import. dim@ > and rdivacky@ have been discussing the possibility of getting this committed > upstream as something like -ffreebsd-extensions, but they haven't decided, yet. > > regarding -fdiagnostics-show-option: this is intended purely for gcc, since it > is disabled per default. under clang the flag exists, too, but it is enabled by > default. so specifying it under clang is pretty much a nop. > > cheers. > alex > > > > > Warner > > > > > > On May 27, 2011, at 5:51 AM, Alexander Best wrote: > > > > > hi there, > > > > > > i would like to hear people's opinion regarding the following patch. it > > > features the following semantic changes: > > > > > > 1) -W is now called -Wextra > > > 2) move -fformat-extensions and -fdiagnostics-show-option out of CWARNFLAGS, > > > since they aren't really warnings. this will now let anybody use custom > > > CWARNFLAGS without having to remember to add -fformat-extensions in order > > > not to break buildworld. > > > 3) rearrange "\" characters, as to avoid double spaces > > > 4) when building kernel modules, -fstack-protector was added to CFLAGS twice. > > > this should now be solved. > > > > > > cheers. > > > alex > > > > > > -- > > > a13x > > > _______________________________________________ > > > freebsd-toolchain@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > > > To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe@freebsd.org" > > -- > a13x -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Fri May 27 19:32:27 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB821065675; Fri, 27 May 2011 19:32:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6E20F8FC1C; Fri, 27 May 2011 19:32:27 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p4RJQFl2057829 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 27 May 2011 13:26:19 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110527181459.GA29908@freebsd.org> Date: Fri, 27 May 2011 13:26:09 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <4B1CE52B-68E9-4AB4-82FA-FB1F8C622BF0@bsdimp.com> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 27 May 2011 13:26:19 -0600 (MDT) Cc: freebsd-hackers@freebsd.org, freebsd-toolchain@freebsd.org Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 19:32:27 -0000 On May 27, 2011, at 12:14 PM, Alexander Best wrote: > On Fri May 27 11, Warner Losh wrote: >> These look generally good. Just one thing I had a question on: >>=20 >> # >> +# Enable FreeBSD kernel-specific printf format specifiers. Also = instruct gcc to >> +# enable some diagnostics, which make it easier to pinpoint = tinderbox failures. >> +CFLAGS+=3D -fformat-extensions -fdiagnostics-show-option >> + >>=20 >> Does this put sand in the gears of clang support? >=20 > i don't think so. the code that features -fformat-extensions support = is freebsd > specific and gets plugged into the vendor code during every new = import. dim@ > and rdivacky@ have been discussing the possibility of getting this = committed > upstream as something like -ffreebsd-extensions, but they haven't = decided, yet. OK. I have a bunch of uncommitted changes to support external = toolchains, and this sort of thing might bite me when them... But I'll = fight with that when I get there. > regarding -fdiagnostics-show-option: this is intended purely for gcc, = since it > is disabled per default. under clang the flag exists, too, but it is = enabled by > default. so specifying it under clang is pretty much a nop. Cool. This is less of a concern, since it will be present in most = external toolchains I care about. Warner > cheers. > alex >=20 >>=20 >> Warner >>=20 >>=20 >> On May 27, 2011, at 5:51 AM, Alexander Best wrote: >>=20 >>> hi there, >>>=20 >>> i would like to hear people's opinion regarding the following patch. = it >>> features the following semantic changes: >>>=20 >>> 1) -W is now called -Wextra >>> 2) move -fformat-extensions and -fdiagnostics-show-option out of = CWARNFLAGS, >>> since they aren't really warnings. this will now let anybody use = custom >>> CWARNFLAGS without having to remember to add -fformat-extensions in = order >>> not to break buildworld. >>> 3) rearrange "\" characters, as to avoid double spaces >>> 4) when building kernel modules, -fstack-protector was added to = CFLAGS twice. >>> this should now be solved. >>>=20 >>> cheers. >>> alex >>>=20 >>> --=20 >>> a13x >>> = _______________________________________________ >>> freebsd-toolchain@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain >>> To unsubscribe, send any mail to = "freebsd-toolchain-unsubscribe@freebsd.org" >=20 > --=20 > a13x >=20 >=20 From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 00:05:27 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240DD106564A for ; Sat, 28 May 2011 00:05:27 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id AD12F8FC0A for ; Sat, 28 May 2011 00:05:26 +0000 (UTC) Received: by ewy1 with SMTP id 1so1028840ewy.13 for ; Fri, 27 May 2011 17:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=L1sQHoDCSE/nWuQVT6oOhr8pwMkEFVGmc4VcWQ2+X0M=; b=FQBxvIoVJjZMMLkasvOvX2zBYMfnteeS0S4B2qlv99xYw3Cb52LbaWTVPh52Qf92RT 3VAgd0RjS785bN0PfTweF7++Z/GgmVKms1BTwtJHTmkA9E4qBeCAaJZcTwY5KkBc7j/Y W0MGGOsu2bqdBAjVZ8rRoLemrtsE0abLgCI9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=JuOeudcTmPE3USMjsxBr8GdHCLpm7r6Pqenb2Q/77lDLOIKQDxNLxcjaE9SWDfuoSa lXOW7CLJkT0PmE85Q26AhFtCXEAGgo9FE5oBdFq2mZDBQU76XemAHI4fbc25ytOM8gDu PDC1dAu4Cx7BpOFNaHUBxcdh8ZncpHlJNGvuw= Received: by 10.213.9.145 with SMTP id l17mr946420ebl.10.1306539625033; Fri, 27 May 2011 16:40:25 -0700 (PDT) Received: from localhost (tor-exit.rmpriv.nl [91.217.223.30]) by mx.google.com with ESMTPS id b1sm1578030eeg.19.2011.05.27.16.40.21 (version=SSLv3 cipher=OTHER); Fri, 27 May 2011 16:40:23 -0700 (PDT) From: Pan Tsu To: freebsd-toolchain@freebsd.org Date: Sat, 28 May 2011 03:40:12 +0400 Message-ID: <86zkm74srn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Subject: [clang] boot2 fails to build with DEBUG_FLAGS? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 00:05:27 -0000 While compiling boot blocks with debug symbols may not be very useful having DEBUG_FLAGS in make.conf is not uncommon. $ make CC=clang DEBUG_FLAGS=-g [...] objcopy -S -O binary boot2.out boot2.bin btxld -v -E 0x2000 -f bin -b /usr/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 client: fmt=bin size=16ed text=0 data=0 bss=0 entry=0 output: fmt=bin size=1f7d text=200 data=1d7d org=0 entry=0 -381 bytes available *** Error code 1 $ make CC=clang [...] objcopy -S -O binary boot2.out boot2.bin btxld -v -E 0x2000 -f bin -b /usr/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 client: fmt=bin size=1505 text=0 data=0 bss=0 entry=0 output: fmt=bin size=1d95 text=200 data=1b95 org=0 entry=0 107 bytes available [...] $ make CC=gcc DEBUG_FLAGS=-g [...] objcopy -S -O binary boot2.out boot2.bin btxld -v -E 0x2000 -f bin -b /usr/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 client: fmt=bin size=13bd text=0 data=0 bss=0 entry=0 output: fmt=bin size=1c4d text=200 data=1a4d org=0 entry=0 435 bytes available [...] $ make CC=gcc [...] objcopy -S -O binary boot2.out boot2.bin btxld -v -E 0x2000 -f bin -b /usr/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 client: fmt=bin size=13bd text=0 data=0 bss=0 entry=0 output: fmt=bin size=1c4d text=200 data=1a4d org=0 entry=0 435 bytes available [...] -- FreeBSD 9.0-CURRENT #0 r222354M amd64 From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 09:34:31 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id DFBB21065686; Sat, 28 May 2011 09:34:31 +0000 (UTC) Date: Sat, 28 May 2011 09:34:31 +0000 From: Alexander Best To: Warner Losh Message-ID: <20110528093431.GA15636@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <4B1CE52B-68E9-4AB4-82FA-FB1F8C622BF0@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B1CE52B-68E9-4AB4-82FA-FB1F8C622BF0@bsdimp.com> Cc: freebsd-hackers@freebsd.org, freebsd-toolchain@freebsd.org Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 09:34:32 -0000 On Fri May 27 11, Warner Losh wrote: > > On May 27, 2011, at 12:14 PM, Alexander Best wrote: > > > On Fri May 27 11, Warner Losh wrote: > >> These look generally good. Just one thing I had a question on: > >> > >> # > >> +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to > >> +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. > >> +CFLAGS+= -fformat-extensions -fdiagnostics-show-option > >> + > >> > >> Does this put sand in the gears of clang support? > > > > i don't think so. the code that features -fformat-extensions support is freebsd > > specific and gets plugged into the vendor code during every new import. dim@ > > and rdivacky@ have been discussing the possibility of getting this committed > > upstream as something like -ffreebsd-extensions, but they haven't decided, yet. > > OK. I have a bunch of uncommitted changes to support external toolchains, and this sort of thing might bite me when them... But I'll fight with that when I get there. well the main problem imho is -fformat-extensions. the code that supports this flag has not been pushed upstream neither to clang, nor to gcc. so compiling the freebsd kernel with anything external, like clang tot or gcc 4.6 will fail to recognise the special printf formatting. personally i think getting this committed upsteam to clang as -ffreebsd-extensions would be a nice thing to have. however it's not my decision to make. ;) the -fdiagnostics-show-option flag is a standard clang and gcc flag and won't cause any problems. the only difference between gcc and clang is: gcc has it disabled by default; clang has it enabled by default. i've reworked my patch yet again. it now features these changes: 1) -W is now called -Wextra 2) move -fformat-extensions and -fdiagnostics-show-option out of CWARNFLAGS, since they aren't really warnings. this will now let anybody use custom CWARNFLAGS without having to remember to add -fformat-extensions in order not to break buildworld. 3) rearrange "\" characters, as to avoid double spaces 4) when building kernel modules, -fstack-protector was added to CFLAGS twice. this should now be solved. 5) only enable -frename-registers, when gcc is used, since clang doesn't understand this flag 6) when debugging is enabled, also use the -O flag for amd64 and not -O2. when people enable debugging they don't really want optimisations such as -O2 turned on. the patch is available here: http://people.freebsd.org/~arundel/patches/kern.mk-bsd.sys.mk.patch NB: regarding point 2), i'd like to encurrage people to play around with CWARNFLAGS a bit. maybe we find some nice -Wwarning options which are reasonable to have and - most importantly - don't break tinderbox. for far i've played around with the following flags and can verify that they break tinderbox: -Wshadow, -Wwrite-strings, -Wextra, -Wbad-function-cast and -Wmissing-declarations -Wmissing-declarations almost works, but there are ~ 20 undeclared functions in the dtrace code. if those could be fixed it would be possible to add that flag to CWARNFLAGS. cheers. alex > > > regarding -fdiagnostics-show-option: this is intended purely for gcc, since it > > is disabled per default. under clang the flag exists, too, but it is enabled by > > default. so specifying it under clang is pretty much a nop. > > Cool. This is less of a concern, since it will be present in most external toolchains I care about. > > Warner > > > cheers. > > alex > > > >> > >> Warner > >> > >> > >> On May 27, 2011, at 5:51 AM, Alexander Best wrote: > >> > >>> hi there, > >>> > >>> i would like to hear people's opinion regarding the following patch. it > >>> features the following semantic changes: > >>> > >>> 1) -W is now called -Wextra > >>> 2) move -fformat-extensions and -fdiagnostics-show-option out of CWARNFLAGS, > >>> since they aren't really warnings. this will now let anybody use custom > >>> CWARNFLAGS without having to remember to add -fformat-extensions in order > >>> not to break buildworld. > >>> 3) rearrange "\" characters, as to avoid double spaces > >>> 4) when building kernel modules, -fstack-protector was added to CFLAGS twice. > >>> this should now be solved. > >>> > >>> cheers. > >>> alex > >>> > >>> -- > >>> a13x > >>> _______________________________________________ > >>> freebsd-toolchain@freebsd.org mailing list > >>> http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > >>> To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe@freebsd.org" > > > > -- > > a13x > > > > -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 16:08:16 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5890B106564A for ; Sat, 28 May 2011 16:08:16 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D38068FC08 for ; Sat, 28 May 2011 16:08:15 +0000 (UTC) Received: by fxm11 with SMTP id 11so2632906fxm.13 for ; Sat, 28 May 2011 09:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=OdAP1NTgAiylZpv6hXVgYbovWDxShxEJbRRn8+WtRqE=; b=spG+wEeNiQ4+zSaFaEZ1xkqyAtiwRGkjR/+5gJptO7ekWIE3MDHrGa/XJhGIeZp3xi o86G/RP2d4FOefAJHH2bkSMDKcvGJWuycui4goMcRBQFroGt/AUa4AgIRdGDFujjG8fU 0Knznn+yUksYohlDsYY7Dp0JsjO4C/nBOod7w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=OhmakvxrDIQ4qQj2yFd7duXIv6oSbA6Cr+c9CdQLu3lMKZ7U2lCywzZoS6KqeJG05+ 0eOWQQVLqT3w9ikZmIE3gTe5odSRzrmC1YurdXF8WwHy1s/+2hSGJZneZdaeRjK32TsC P/e41SGBEJbB5XjCxzvuN0FSRZave4YlPtNSc= Received: by 10.223.103.3 with SMTP id i3mr3637964fao.110.1306598894355; Sat, 28 May 2011 09:08:14 -0700 (PDT) Received: from localhost ([173.212.227.12]) by mx.google.com with ESMTPS id l26sm199140fah.14.2011.05.28.09.08.09 (version=SSLv3 cipher=OTHER); Sat, 28 May 2011 09:08:13 -0700 (PDT) From: Pan Tsu To: Alexander Best References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> Date: Sat, 28 May 2011 20:08:05 +0400 In-Reply-To: <20110527182906.GA31871@freebsd.org> (Alexander Best's message of "Fri, 27 May 2011 18:29:06 +0000") Message-ID: <86oc2mlsey.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 16:08:16 -0000 Alexander Best writes: > On Fri May 27 11, Alexander Best wrote: >> On Fri May 27 11, Warner Losh wrote: >> > These look generally good. Just one thing I had a question on: >> > >> > # >> > +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to >> > +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. >> > +CFLAGS+= -fformat-extensions -fdiagnostics-show-option >> > + >> > >> > Does this put sand in the gears of clang support? > > i've improved the above comment so as to note that clang won't be affected by > -fdiagnostics-show-option. the new patch is available here: > > http://people.freebsd.org/~arundel/patches/kern.mk-bsy.sys.mk.patch > > another "issue" i've come across is the fact that on amd64, -O2 is always being > set, no matter, if debugging is enabled or disabled. i think amd64 should also > (just like all the other archs) be using -O, when debugging was enabled. Any reason a kernel with symbols (DEBUG) *must* be pessimized to -O1 level? Looking at r140606 it's not clear how symbols are related to a bump from -O1 to -O2 for non-amd64 archs. And -RELEASE kernels since at least 6.0R have `makeoptions DEBUG=-g' uncommented in GENERIC. > changing this is quite easy. so if people think this is something worth > changing i can integrate it into my existing patch. From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 18:23:26 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id 3A5E0106566C; Sat, 28 May 2011 18:23:26 +0000 (UTC) Date: Sat, 28 May 2011 18:23:26 +0000 From: Alexander Best To: Pan Tsu Message-ID: <20110528182326.GA75447@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86oc2mlsey.fsf@gmail.com> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 18:23:26 -0000 On Sat May 28 11, Pan Tsu wrote: > Alexander Best writes: > > > On Fri May 27 11, Alexander Best wrote: > >> On Fri May 27 11, Warner Losh wrote: > >> > These look generally good. Just one thing I had a question on: > >> > > >> > # > >> > +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to > >> > +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. > >> > +CFLAGS+= -fformat-extensions -fdiagnostics-show-option > >> > + > >> > > >> > Does this put sand in the gears of clang support? > > > > i've improved the above comment so as to note that clang won't be affected by > > -fdiagnostics-show-option. the new patch is available here: > > > > http://people.freebsd.org/~arundel/patches/kern.mk-bsy.sys.mk.patch > > > > another "issue" i've come across is the fact that on amd64, -O2 is always being > > set, no matter, if debugging is enabled or disabled. i think amd64 should also > > (just like all the other archs) be using -O, when debugging was enabled. > > Any reason a kernel with symbols (DEBUG) *must* be pessimized to -O1 level? > Looking at r140606 it's not clear how symbols are related to a bump > from -O1 to -O2 for non-amd64 archs. And -RELEASE kernels since at least > 6.0R have `makeoptions DEBUG=-g' uncommented in GENERIC. well i'm not an expert on this. but are we 100% sure that a kernel on amd64 compiled with -O2 frename-registers can be debugged the same way as one with -O? if that is the case: sure...-O2 is fine. ;) however i've often read messages - mostly by bruce evans - claiming that anything greater than -O will in fact decrease a kernel's ability to be debugged just as well as a kernel with -O. cheers. alex > > > changing this is quite easy. so if people think this is something worth > > changing i can integrate it into my existing patch. -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 18:36:23 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id 5E48F1065674; Sat, 28 May 2011 18:36:23 +0000 (UTC) Date: Sat, 28 May 2011 18:36:23 +0000 From: Alexander Best To: Pan Tsu Message-ID: <20110528183623.GA77277@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> <20110528182326.GA75447@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110528182326.GA75447@freebsd.org> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 18:36:23 -0000 On Sat May 28 11, Alexander Best wrote: > On Sat May 28 11, Pan Tsu wrote: > > Alexander Best writes: > > > > > On Fri May 27 11, Alexander Best wrote: > > >> On Fri May 27 11, Warner Losh wrote: > > >> > These look generally good. Just one thing I had a question on: > > >> > > > >> > # > > >> > +# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to > > >> > +# enable some diagnostics, which make it easier to pinpoint tinderbox failures. > > >> > +CFLAGS+= -fformat-extensions -fdiagnostics-show-option > > >> > + > > >> > > > >> > Does this put sand in the gears of clang support? > > > > > > i've improved the above comment so as to note that clang won't be affected by > > > -fdiagnostics-show-option. the new patch is available here: > > > > > > http://people.freebsd.org/~arundel/patches/kern.mk-bsy.sys.mk.patch > > > > > > another "issue" i've come across is the fact that on amd64, -O2 is always being > > > set, no matter, if debugging is enabled or disabled. i think amd64 should also > > > (just like all the other archs) be using -O, when debugging was enabled. > > > > Any reason a kernel with symbols (DEBUG) *must* be pessimized to -O1 level? > > Looking at r140606 it's not clear how symbols are related to a bump > > from -O1 to -O2 for non-amd64 archs. And -RELEASE kernels since at least > > 6.0R have `makeoptions DEBUG=-g' uncommented in GENERIC. > > well i'm not an expert on this. but are we 100% sure that a kernel on amd64 > compiled with -O2 frename-registers can be debugged the same way as one with > -O? if that is the case: sure...-O2 is fine. ;) > > however i've often read messages - mostly by bruce evans - claiming that > anything greater than -O will in fact decrease a kernel's ability to be > debugged just as well as a kernel with -O. ok. so here are two seperate patches: http://people.freebsd.org/~arundel/patches/kern.mk-bsd.sys.mk.patch ^^ this one will trigger -O on amd64, when debugging was enabled. http://people.freebsd.org/~arundel/patches/kern.mk-bsd.sys.mk-O2.patch ^^ this one will leave the semantics as they are, so even when debugging was enabled, -O2 gets set under amd64. cheers. alex > > cheers. > alex > > > > > > changing this is quite easy. so if people think this is something worth > > > changing i can integrate it into my existing patch. > > -- > a13x -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 20:26:21 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D411106566C; Sat, 28 May 2011 20:26:21 +0000 (UTC) (envelope-from brucec@muon.cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id B0C558FC16; Sat, 28 May 2011 20:26:20 +0000 (UTC) Received: by muon.cran.org.uk (Postfix, from userid 1001) id B0FC1E6300; Sat, 28 May 2011 21:26:19 +0100 (BST) Date: Sat, 28 May 2011 21:26:19 +0100 From: Bruce Cran To: Alexander Best Message-ID: <20110528202619.GA27204@muon.cran.org.uk> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> <20110528182326.GA75447@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110528182326.GA75447@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG, Pan Tsu Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 20:26:21 -0000 On Sat, May 28, 2011 at 06:23:26PM +0000, Alexander Best wrote: > > well i'm not an expert on this. but are we 100% sure that a kernel on amd64 > compiled with -O2 frename-registers can be debugged the same way as one with > -O? if that is the case: sure...-O2 is fine. ;) > > however i've often read messages - mostly by bruce evans - claiming that > anything greater than -O will in fact decrease a kernel's ability to be > debugged just as well as a kernel with -O. > The critical option when -O2 is used is -fno-omit-frame-pointers, since removing frame pointers makes debugging impossible (on i386). With -O2 code is moved around and removed, so debugging is more difficult, but can still provide useful information. -- Bruce Cran From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 20:39:24 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id A854C1065670; Sat, 28 May 2011 20:39:24 +0000 (UTC) Date: Sat, 28 May 2011 20:39:24 +0000 From: Alexander Best To: Bruce Cran Message-ID: <20110528203924.GA88186@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> <20110528182326.GA75447@freebsd.org> <20110528202619.GA27204@muon.cran.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110528202619.GA27204@muon.cran.org.uk> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG, Pan Tsu Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 20:39:24 -0000 On Sat May 28 11, Bruce Cran wrote: > On Sat, May 28, 2011 at 06:23:26PM +0000, Alexander Best wrote: > > > > well i'm not an expert on this. but are we 100% sure that a kernel on amd64 > > compiled with -O2 frename-registers can be debugged the same way as one with > > -O? if that is the case: sure...-O2 is fine. ;) > > > > however i've often read messages - mostly by bruce evans - claiming that > > anything greater than -O will in fact decrease a kernel's ability to be > > debugged just as well as a kernel with -O. > > > > The critical option when -O2 is used is -fno-omit-frame-pointers, since removing > frame pointers makes debugging impossible (on i386). With -O2 code is moved around and > removed, so debugging is more difficult, but can still provide useful > information. how about making -fno-omit-frame-pointers mandatory for all builds with an optimisation level higher than -O? something like .if !empty(COPTFLAGS:M-O[234sz]) && empty(COPTFLAGS:M-fno-omit-frame-pointers) COPTFLAGS+= -fno-omit-frame-pointers .endif (-O4 and -Oz are clang specific, but it won't hurt having them in there) cheers. alex > > -- > Bruce Cran -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Sat May 28 21:32:44 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id C99031065674; Sat, 28 May 2011 21:32:44 +0000 (UTC) Date: Sat, 28 May 2011 21:32:44 +0000 From: Alexander Best To: Bruce Cran Message-ID: <20110528213244.GA93335@freebsd.org> References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> <20110528182326.GA75447@freebsd.org> <20110528202619.GA27204@muon.cran.org.uk> <20110528203924.GA88186@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110528203924.GA88186@freebsd.org> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG, Pan Tsu Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 21:32:44 -0000 On Sat May 28 11, Alexander Best wrote: > On Sat May 28 11, Bruce Cran wrote: > > On Sat, May 28, 2011 at 06:23:26PM +0000, Alexander Best wrote: > > > > > > well i'm not an expert on this. but are we 100% sure that a kernel on amd64 > > > compiled with -O2 frename-registers can be debugged the same way as one with > > > -O? if that is the case: sure...-O2 is fine. ;) > > > > > > however i've often read messages - mostly by bruce evans - claiming that > > > anything greater than -O will in fact decrease a kernel's ability to be > > > debugged just as well as a kernel with -O. > > > > > > > The critical option when -O2 is used is -fno-omit-frame-pointers, since removing > > frame pointers makes debugging impossible (on i386). With -O2 code is moved around and > > removed, so debugging is more difficult, but can still provide useful > > information. > > how about making -fno-omit-frame-pointers mandatory for all builds with an > optimisation level higher than -O? man this is confusing. why must the freebsd make skeleton be so complicated. :( it seems -fno-omit-frame-pointers gets set in sys/conf/Makefile.amd64 and sys/conf/Makefile.powerpc already. also for modules in sys/conf/kmod.mk. i guess somebody with a better in deth knowledge should investigate this matter. this is a bit too complicated for me. cheers. alex > > something like > > .if !empty(COPTFLAGS:M-O[234sz]) && empty(COPTFLAGS:M-fno-omit-frame-pointers) > COPTFLAGS+= -fno-omit-frame-pointers > .endif > > (-O4 and -Oz are clang specific, but it won't hurt having them in there) > > cheers. > alex > > > > > -- > > Bruce Cran > > -- > a13x -- a13x