[CFC/CFT] large changes in the loader(8) code

Jan Beich jbeich at tormail.org
Mon Jul 2 10:55:49 UTC 2012


"Andrey V. Elsukov" <bu7cher at yandex.ru> writes:

> On 29.06.2012 15:01, Jan Beich wrote:
>
>>>> So, i have created the branch and committed the changes:
>>>> 	http://svnweb.freebsd.org/base/user/ae/bootcode/
>>>> The patch is here:
>>>> 	http://people.freebsd.org/~ae/boot.diff
>>>
>>> FWIW, I verified it compiles OK with clang, and especially boot2's size
>>> isn't increased at all.
>> Does it boot for you? Same if I build zfs.c with gcc -O0:
>> 
>>   FreeBSD/x86 ZFS enabled bootstrap loader, Revision 1.1
>>   (foo at bar, Tue Jun 26 18:52:52 UTC 2012)
>>   ZFS: can't find pool by guid
>>   ZFS: can't find pool by guid
>> 
>>   can't load 'kernel'
>> 
>
> Does zfsloader without patches compiled with CLANG work for you?

It does. I did test before using

  $ cd /usr/src/sys/boot
  $ env -i __MAKE_CONF= PATH=/bin:/sbin:/usr/bin:/usr/sbin make CC=clang
  $ make install
  <wait a bit for data to sync>
  $ sudo qemu-system-x86_64 -curses -drive file=/dev/ada0 -drive file=/dev/ada1

In gcc -O0 case

  $ touch zfs/zfs.c
  $ rm i386/zfsloader/zfsloader*
  $ echo CFLAGS+=-O0 >>zfs/Makefile
  $ env -i ... make CC=gcc

And for gcc47
  
  $ touch zfs/zfs.c
  $ rm i386/zfsloader/zfsloader*
  $ env -i ... make CC=/usr/local/bin/gcc47 -C zfs

I haven't tried to further track down which flag(s) within -O1 make
zfsloader from your branch work when compiled with base gcc.


More information about the freebsd-current mailing list