On Thu, Dec 05, 2013 at 11:39:17AM +0400, Konstantin Serebryany wrote:
> On Wed, Dec 4, 2013 at 6:16 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> > On Wed, Dec 04, 2013 at 06:09:56PM +0400, Konstantin Serebryany wrote:
> >> This is a maintenance problem because we can not test if we broke
> >> something during development.
> >> e.g. clang doesn't seem to support -fno-dwarf2-cfi-asm
> >
> > It does, at least both clang 3.3 (from Fedora 19) and clang
> > 3.4 r194685 (which I've built myself some time ago just to look at the
> > use-after-return etc. sanitization).
> 
> That's not what I see in my build:
> % cat asm_test.cc
> void foo() {
>    __asm__ __volatile__(".cfi_adjust_cfa_offset 100");
> }
> % clang -c asm_test.cc -fno-dwarf2-cfi-asm
> % clang -c asm_test.cc
> % gcc -c asm_test.cc
> % gcc -c asm_test.cc -fno-dwarf2-cfi-asm
> asm_test.cc: Assembler messages:
> asm_test.cc:2: Error: CFI instruction used without previous .cfi_startproc
> %

Try clang -fno-dwarf2-cfi-asm -no-integrated-as then?  Guess it's integrated
assembler is buggy and doesn't diagnose obvious errors (which using .cfi_*
directives outside of .cfi_startproc ... .cfi_endproc is).

> I can not test the change in tsan/rtl/tsan_rtl_amd64.S properly
> because I could not make it fail w/o the change, even with
> -fno-dwarf2-cfi-asm
> But looks correct.

To make tsan_rtl_amd64.S actually fail, you'd need assembler that doesn't
support .cfi_* directives at all.  E.g. RHEL5 gas already supports .cfi_*
directives, but not all of them (.cfi_personality/.cfi_lsda), so CFI
directives can be used by the compiler for C code that doesn't need those
.cfi_* directives, but not for C++.

        Jakub

Reply via email to