Re: Broken loader on 7.0-RC1

From: Nikolay Pavlov <qpadla_at_gmail.com>
Date: Mon, 4 Feb 2008 15:26:11 +0200
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_at_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
_at__at_ -12,22 +12,6 _at__at_
 /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. <<<-----------------------------------    
======================================================================  
Received on Mon Feb 04 2008 - 12:26:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:26 UTC