From owner-freebsd-current@FreeBSD.ORG Wed Mar 7 04:52:30 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD0B106566B for ; Wed, 7 Mar 2012 04:52:29 +0000 (UTC) (envelope-from jiashiun@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 B712F8FC08 for ; Wed, 7 Mar 2012 04:52:29 +0000 (UTC) Received: by iahk25 with SMTP id k25so10889215iah.13 for ; Tue, 06 Mar 2012 20:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=pU9UZ4arI5bloT42d4Y/CkHVgj40Ae4pt2cLR6rCIGI=; b=SyqLUxSoBJoZZ2DDqsfsqpZoD8A+4GKx0/YWPpOJknSwAU5Ofy7cenuZxmN2j1aeaM VrdVqueAP9ScZiEqXzAYAKRh8yWZQGvgbtXEPk5Fs8yIw3v0mQQSSnmNg6ps62rhRRhK 17tIAoYI/zD5MSQrWT1wVG98k13KGVrlNX2b38+kee8NgqeszQbYAiX70Ha/Ugd1si7o nQkm/IfVR9dSVkxIZcjOcnefeq/3p79pIplORVw5ZAD5le/d/1eLXrswldqR7psmoIxW f23x4QfN3pPqku0f1BnlG3VRrIxNa4BNomewC8A56G9qwtPYHqD5UVSc456XxWuPehOu 2kAA== Received: by 10.50.140.101 with SMTP id rf5mr625555igb.27.1331095949111; Tue, 06 Mar 2012 20:52:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.11.197 with HTTP; Tue, 6 Mar 2012 20:51:58 -0800 (PST) From: Jia-Shiun Li Date: Wed, 7 Mar 2012 12:51:58 +0800 Message-ID: To: freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: boot2 overflow when building with clang X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 04:52:30 -0000 I am not familiar with boot2, but it looks like allocated size for boot2 is not enough to hold code generated by clang. Reverting r232570 fixes it. ===> sys/boot/i386/boot2 (all) objcopy -S -O binary boot1.out boot1 dd if=/dev/zero of=boot2.ldr bs=512 count=1 clang -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time -mno-align-long-strings -mrtd -mregparm=3 -DUSE_XREAD -DUFS1_AND_UFS2 -DFLAGS=0x80 -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 -I/usr/src/sys/boot/i386/boot2/../../common -I/usr/src/sys/boot/i386/boot2/../btx/lib -I. -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Winline --param max-inline-insns-single=100 -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -std=gnu99 -S -o boot2.s.tmp /usr/src/sys/boot/i386/boot2/boot2.c sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s rm -f boot2.s.tmp clang -c boot2.s clang -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time -mno-align-long-strings -mrtd -mregparm=3 -DUSE_XREAD -DUFS1_AND_UFS2 -DFLAGS=0x80 -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 -I/usr/src/sys/boot/i386/boot2/../../common -I/usr/src/sys/boot/i386/boot2/../btx/lib -I. -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Winline --param max-inline-insns-single=100 -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -std=gnu99 -c /usr/src/sys/boot/i386/boot2/sio.S ld -static -N --gc-sections -nostdlib -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=15a1 text=0 data=0 bss=0 entry=0 output: fmt=bin size=1e31 text=200 data=1c31 org=0 entry=0 -49 bytes available *** [boot2] Error code 1 Stop in /usr/src/sys/boot/i386/boot2. *** [all] Error code 1 Stop in /usr/src/sys/boot/i386. *** [all] Error code 1 Stop in /usr/src/sys/boot. *** [all] Error code 1 Stop in /usr/src/sys. *** [sys.all__D] Error code 1 Stop in /usr/src. *** [everything] Error code 1 Stop in /usr/src. *** [buildworld] Error code 1 Stop in /usr/src. Jia-Shiun.