Re: sys/boot/i386/boot2 build failure with clang

From: Doug Barton <dougb_at_FreeBSD.org>
Date: Sun, 17 Jul 2011 04:27:18 -0700
I have DEBUG_FLAGS+=   -g in my /etc/make.conf. Commenting that out
allows this to work.


Doug


On 07/17/2011 03:11, Doug Barton wrote:
> Howdy,
> 
> Trying to build r224125 with clang, and got this (using no -j):
> 
> ===> 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.000040 secs (12782641 bytes/sec)
> 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/home/svn/head/sys/boot/i386/boot2/../../common
> -I/home/svn/head/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 -m32 -march=i386 -g -std=gnu99   -S -o
> boot2.s.tmp /home/svn/head/sys/boot/i386/boot2/boot2.c
> clang: warning: the clang compiler does not support '-fno-unit-at-a-time'
> clang: warning: argument unused during compilation:
> '-fno-guess-branch-probability'
> clang: warning: argument unused during compilation:
> '-mno-align-long-strings'
> clang: warning: argument unused during compilation: '--param
> max-inline-insns-single=100'
> clang: warning: argument unused during compilation:
> '-mpreferred-stack-boundary=2'
> In file included from /home/svn/head/sys/boot/i386/boot2/boot2.c:172:
> /home/svn/head/sys/boot/i386/boot2/../../common/ufsread.c:232:17:
> warning: cast
>       from 'char *' to 'struct ufs1_dinode *' increases required
> alignment from
>       1 to 4 [-Wcast-align]
>                         memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n,
>                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/svn/head/sys/boot/i386/boot2/../../common/ufsread.c:235:17:
> warning: cast
>       from 'char *' to 'struct ufs2_dinode *' increases required
> alignment from
>       1 to 4 [-Wcast-align]
>                         memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n,
>                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/svn/head/sys/boot/i386/boot2/boot2.c:224:1: warning: no previous
> prototype
>       for function 'main' [-Wmissing-prototypes]
> main(void)
> ^
> /home/svn/head/sys/boot/i386/boot2/boot2.c:352:4: warning: cast from
> 'caddr_t'
>       (aka 'char *') to 'Elf32_Word *' (aka 'unsigned int *') increases
> required
>       alignment from 1 to 4 [-Wcast-align]
>                 *(Elf32_Word *)p = es[i].sh_size;
>                  ^~~~~~~~~~~~~~~
> /home/svn/head/sys/boot/i386/boot2/boot2.c:611:8: warning: cast from
> 'caddr_t'
>       (aka 'char *') to 'uint32_t *' (aka 'unsigned int *') increases
> required
>       alignment from 1 to 4 [-Wcast-align]
>         t1 = *(uint32_t *)PTOV(0x46c);
>               ^~~~~~~~~~~~~~~~~~~~~~~
> 5 warnings generated.
> sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
> rm -f boot2.s.tmp
> as  --32 -o boot2.o boot2.s
> boot2.s: Assembler messages:
> boot2.s:4073: Error: unknown pseudo-op: `.cfi_sections'
> *** Error code 1
> 
> 
> 
> 



-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/
Received on Sun Jul 17 2011 - 09:27:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:15 UTC