From owner-freebsd-current@FreeBSD.ORG Mon Feb 4 13:26:19 2008 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 5973D16A417 for ; Mon, 4 Feb 2008 13:26:19 +0000 (UTC) (envelope-from qpadla@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mx1.freebsd.org (Postfix) with ESMTP id 281F013C457 for ; Mon, 4 Feb 2008 13:26:19 +0000 (UTC) (envelope-from qpadla@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so2452141waf.3 for ; Mon, 04 Feb 2008 05:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date:user-agent:references:in-reply-to:cc:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; bh=P1JItlpqls8TGxtgUU/1ReXMZhwjTNSoJL+iDSkR47U=; b=b7f3Dj9LnINyNEbwanYxRG0BHDq9AZw98Io7iwg74lnzUwjxUctFaXXE7cJtyzEFcnJZrnmsavL3qBs8ISpwsDDLI2NPflnYibK7p9Mpn2Bc/olkt5YKTZKVi3QihRk5DIdTmmBooEaBInhUZ+ovpIxt1LRdAF+Niq50qHm4cOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to:cc:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=l1MxMdMzkgNaIHusb3yCw4MNxDiKtHd2kvxWga0T2O88TKkfL1MoUyay+4G3HpQRQimys5/eB2YlQmOiR8EctfKLhzvTUHpNA1wMlxnnDpsY5pXG+DhxDkteLQvQjUzGEP9nYcX6ROPKkONOlWCXVWORvJ9ZKzDdDO0rzXxZyo8= Received: by 10.114.192.1 with SMTP id p1mr323522waf.47.1202131577868; Mon, 04 Feb 2008 05:26:17 -0800 (PST) Received: from atlas.local ( [89.162.141.1]) by mx.google.com with ESMTPS id i8sm19841459nfh.1.2008.02.04.05.26.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Feb 2008 05:26:16 -0800 (PST) From: Nikolay Pavlov To: Oliver Fromme Date: Mon, 4 Feb 2008 15:26:11 +0200 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) References: <200802041237.m14CbiaU070447@lurza.secnetix.de> In-Reply-To: <200802041237.m14CbiaU070447@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802041526.12081.qpadla@gmail.com> Cc: freebsd-current@freebsd.org Subject: Re: Broken loader on 7.0-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: qpadla@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 13:26:19 -0000 On Monday 04 February 2008 14:37:44 Oliver Fromme wrote: > Nikolay Pavlov wrote: > > While building 7.0-RC1 i've discovered that the loader file is broken > > in my box and i am unable to boot using it. I've already hit this > > problem 2 months ago. After playing a bit i've found the way on how > > to reproduce it easily: > > > > ~# cd /usr/src/sys/boot/i386 > > /usr/src/sys/boot/i386# make btx libi386 loader > > I'm afraid I can't reproduce it. I've tried the exact same > command, and it built a working loader for me. Are you > building on i386 or amd64? They use the same i386 loader, > but there are slight differences in the build process. Thanks for response Oliver. I am very confused about this problem. It looks very stupid, but i am completely unable to build a working loader on that box. This is amd64 with GENERIC kernel and without any compiler flags in make.conf. > > Note that your command does not build ficl nor libstand, > both of which are required for the loader. Did you build > them before? (However, you should get an error message > if one of them is missing.) No i do not see any errors even with pure /usr/obj > > A simple way to check is to use this command: > strings loader | grep /src/ > Compare the output for the working and the non-working > loader. > > > [...] > > client: fmt=elf size=283b0 text=22038 data=4248 bss=60b8 entry=0 > > Mine looks like this: > > client: fmt=elf size=3b3b0 text=342d8 data=5248 bss=60d8 entry=0 > > Clearly your loader.bin ELF binary (called "client" in BTX > terms) is much smaller. Something must be missing. Yes you are right: root@cassini:~# diff -u loader.good loader.bad --- loader.good 2008-02-04 10:46:44.000000000 +0200 +++ loader.bad 2008-02-04 10:47:02.000000000 +0200 @@ -12,22 +12,6 @@ /usr/src/sys/boot/i386/loader/../../common/bcache.c /usr/src/sys/boot/i386/loader/../../common/isapnp.c /usr/src/sys/boot/i386/loader/../../common/pnp.c -/usr/src/sys/boot/i386/loader/../../common/interp_forth.c -/usr/src/sys/boot/ficl/loader.c -/usr/src/sys/boot/ficl/stack.c -/usr/src/sys/boot/ficl/ficl.c -/usr/src/sys/boot/ficl/dict.c -/usr/src/sys/boot/ficl/i386/sysdep.c -/usr/src/sys/boot/ficl/words.c -/usr/src/sys/boot/ficl/tools.c -/usr/src/sys/boot/ficl/search.c -/usr/src/sys/boot/ficl/vm.c -/usr/src/sys/boot/i386/libi386/bootinfo32.c -/usr/src/sys/boot/i386/libi386/bootinfo.c -/usr/src/sys/boot/i386/libi386/biossmap.c -/usr/src/sys/boot/i386/libi386/biospnp.c -/usr/src/sys/boot/i386/libi386/biosdisk.c -/usr/src/sys/boot/i386/libi386/devicename.c /usr/src/lib/libstand/splitfs.c /usr/src/lib/libstand/ext2fs.c /usr/src/lib/libstand/dosfs.c Than it look like Makefile is wrong, because i do not get any errors during the building process. > > You can also check and compare the link commands (that's > the last "cc" command in the make process, only a few lines > above the snippet that you posted). Mine looks like this: > > cc -O2 -fno-strict-aliasing -pipe -DLOADER_NFS_SUPPORT -DBOOT_FORTH > -I/usr/src/sys/boot/i386/loader/../../ficl > -I/usr/src/sys/boot/i386/loader/../../ficl/i386 -DLOADER_GZIP_SUPPORT > -I/usr/src/sys/boot/i386/loader/../../common -I. -Wall > -I/usr/src/sys/boot/i386/loader/.. > -I/usr/src/sys/boot/i386/loader/../btx/lib -ffreestanding > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > -mno-sse3 -static -Ttext 0x0 -nostdlib -o loader.sym > /usr/obj/usr/src/sys/boot/i386/loader/../btx/lib/crt0.o main.o conf.o > vers.o boot.o commands.o console.o devopen.o interp.o interp_backslash.o > interp_parse.o ls.o misc.o module.o panic.o load_elf32.o > load_elf32_obj.o reloc_elf32.o load_elf64.o load_elf64_obj.o > reloc_elf64.o bcache.o isapnp.o pnp.o interp_forth.o > /usr/obj/usr/src/sys/boot/i386/loader/../../ficl/libficl.a > /usr/obj/usr/src/sys/boot/i386/loader/../libi386/libi386.a -lstand > > If you're on amd64, there should be additional options > "-m32 -march=i386 -m elf_i386_fbsd", but other than that > it should look exactly the same. > > Best regards > Oliver -- ====================================================================== - Best regards, Nikolay Pavlov. <<<----------------------------------- ======================================================================