From owner-freebsd-toolchain@FreeBSD.ORG Tue Jul 19 00:23:41 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 F41DE106564A for ; Tue, 19 Jul 2011 00:23:40 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C0D478FC16 for ; Tue, 19 Jul 2011 00:23:40 +0000 (UTC) Received: by iyb11 with SMTP id 11so4373911iyb.13 for ; Mon, 18 Jul 2011 17:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; bh=dzwQCHmSSBcLgP22IGw90IOaSYhYzIV2jXdOJ2Liods=; b=ibheCgkfpJHk4Dz3X6+F6LbZIKYcxHghJ8t12I/CaXWgNoFExNVMAjWecEy7iGZViD V0Hp6ul65i/wQVKvItos4c2x4E5XM5J8wioIqYbiFAhe9il+ZOOYptuCNjiWXcQttV31 425Pofpv+HazoTS0IC/7SXATMCqyLViNJSoCU= Received: by 10.231.143.129 with SMTP id v1mr6444526ibu.14.1311033696129; Mon, 18 Jul 2011 17:01:36 -0700 (PDT) Received: from localhost (saeed.torservers.net [72.46.129.45]) by mx.google.com with ESMTPS id b6sm3237942ibg.31.2011.07.18.17.01.31 (version=SSLv3 cipher=OTHER); Mon, 18 Jul 2011 17:01:34 -0700 (PDT) From: Pan Tsu To: Roman Divacky References: <86zkm74srn.fsf@gmail.com> <20110530161905.GA91202@freebsd.org> Date: Tue, 19 Jul 2011 04:01:26 +0400 Message-ID: <8639i3dtpl.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-toolchain@freebsd.org Subject: Re: [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: Tue, 19 Jul 2011 00:23:41 -0000 Roman Divacky writes: > I dont have the same environment (I am using trunk llvm/clang) but I cant > reproduce it here... > > fwiw, with trunk llvm DEBUG_FLAGS dies in assembly stage because our as > does not know .cfi_section Why sys/boot even allows user CFLAGS influence if it's that fragile? $ __MAKE_CONF=/dev/null make all CC=clang DEBUG_FLAGS='-g -fno-omit-frame-pointer' ===> i386/boot2 (all) objcopy -S -O binary boot1.out boot1 dd if=/dev/zero of=boot2.ldr bs=512 count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.000016 secs (32051995 bytes/sec) [...] ld -static -N --gc-sections -nostdlib -m elf_i386_fbsd -Ttext 0x2000 -o boot2.out /usr/obj/usr/src/sys/boot/i386/boot2/../btx/lib/crt0.o boot2.o sio.o 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=15bd text=0 data=0 bss=0 entry=0 output: fmt=bin size=1e4d text=200 data=1c4d org=0 entry=0 -77 bytes available *** Error code 1 And those DEBUG_FLAGS are handy to globally make world and ports trace-friendly (gdb/pmc/dtrace) without losing optimization. Luckily .if ${.CURDIR:N*sys/boot*} DEBUG_FLAGS ?= -g -fno-omit-frame-pointer .endif seems to work. OTOH, clang breaks gptzfsboot here, i.e. ZFS: zfs_alloc()/zfs_free() mismatch