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

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 17 Jul 2011 16:03:46 +0200
On 2011-07-17 12:11, Doug Barton wrote:
> Trying to build r224125 with clang, and got this (using no -j):
...
> as  --32 -o boot2.o boot2.s
> boot2.s: Assembler messages:
> boot2.s:4073: Error: unknown pseudo-op: `.cfi_sections'

When using -g, clang outputs directives that are simply too new for our
binutils.  The way that sys/boot/i386/boot2 and zfsboot are processed is
special:

1) The boot2.c code is compiled with -S, to boot2.s.tmp
2) boot2.s.tmp is processed using sed, to remove any alignment
    directives and filler nops, to reduce the code size
3) The resulting boot2.s is assembled, using plain 'as'

In step 3, GNU as chokes on the assembly produced by clang, when you use
certain CFLAGS or DEBUG_FLAGS (-g being one of them).  When compiling .c
to .o files normally, this is never a problem, since clang uses its
integrated assembler to output an object file.

In any case, I have committed a fix in r224131, let me know how that
works out for you.
Received on Sun Jul 17 2011 - 12:03:44 UTC

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