sys/boot/i386/boot2 build failure with clang

Dimitry Andric dim at FreeBSD.org
Sun Jul 17 14:03:44 UTC 2011


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.


More information about the freebsd-current mailing list