clang r163717 (right now) not buildable? (asan_report.cc:282)

Hi all,

I'm doing a pretty plain CMake build of clang, and it seems to not be buildable, giving (on 2 machines):

[ 15%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o
[ 15%] /llvm/llvm/projects/compiler-rt/lib/asan/asan_report.cc:282:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]
}
^
1 error generated.
make[2]: *** [projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o] Error 1

Any one else seeing this?

Thanks,

Sean

Yes, I'm seeing it too.

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists@gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

Hi all,

I'm doing a pretty plain CMake build of clang, and it seems to not be buildable, giving (on 2 machines):

[ 15%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o
[ 15%] /llvm/llvm/projects/compiler-rt/lib/asan/asan_report.cc:282:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]
}
^
1 error generated.
make[2]: *** [projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o] Error 1

Any one else seeing this?

Yes, I'm seeing it too.

I guess this might've been what Daniel Dunbar was trying to suppress
the other day.

What version of clang are you using to build?

- David

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

from Xcode 4.4.1.

Cheers,

What version of clang are you using to build?

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

from Xcode 4.4.1.

Short answer: You may want to build without -Werror, then use the
newly-built clang to self-host (with -Werror, if you like).

Long answer: not sure we have a specific supported compiler list &
what level of support we strive for (with regards to warning clean,
etc). Most people I know running -Werror are doing so with a
selfhosted clang usually in the order of months old at worst, some
rebuild/reinstall every night.

What version of clang are you using to build?

/Applications/Xcode.app/Contents/Developer/Toolchains/

XcodeDefault.xctoolchain/usr/bin/c++

from Xcode 4.4.1.

Short answer: You may want to build without -Werror

I didn't enable -Werror, never do. It must be turned on by default. I can repro with a simple:

cd llvm-bin
CC=cc CXX=c++ cmake ../llvm
make

Long answer: not sure we have a specific supported compiler list &
what level of support we strive for (with regards to warning clean,

But surely the newest Xcode is "new enough"?

Cheers,

Hi all,

I’m doing a pretty plain CMake build of clang, and it seems to not be buildable, giving (on 2 machines):

[ 15%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o
[ 15%] /llvm/llvm/projects/compiler-rt/lib/asan/asan_report.cc:282:1: error: function declared ‘noreturn’ should not return [-Werror,-Winvalid-noreturn]
}
^
1 error generated.
make[2]: *** [projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o] Error 1

Any one else seeing this?

Yes, I’m seeing it too.

I guess this might’ve been what Daniel Dunbar was trying to suppress
the other day.

Yeah, the problem is that old Clang (3.0 is also considered “old” here) incorrectly produces -Winvalid-noreturn
if a function has local variable with noreturn destructor.

Yesterday we’ve added -Werror to default compile flags for AddressSanitizer runtime, so your build breaks there.
Probably it’s not the best idea: as David mentions, developers may use different compilers. We may break many
of them if their weird (or old) compiler produces any kind of warning in ASan code. I’m removing -Werror now.

>
>> Hi all,
>>
>> I'm doing a pretty plain CMake build of clang, and it seems to not be
>> buildable, giving (on 2 machines):
>>
>>
>> [ 15%] Building CXX object
>> projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o
>> [ 15%] /llvm/llvm/projects/compiler-rt/lib/asan/asan_report.cc:282:1:
>> error: function declared 'noreturn' should not return
>> [-Werror,-Winvalid-noreturn]
>> }
>> ^
>> 1 error generated.
>> make[2]: ***
>> [projects/compiler-rt/lib/asan/CMakeFiles/clang_rt.asan_osx_dynamic.dir/asan_report.cc.o]
>> Error 1
>>
>> Any one else seeing this?
>
> Yes, I'm seeing it too.

I guess this might've been what Daniel Dunbar was trying to suppress
the other day.

Yeah, the problem is that old Clang (3.0 is also considered "old" here)
incorrectly produces -Winvalid-noreturn
if a function has local variable with noreturn destructor.

Yesterday we've added -Werror to default compile flags for AddressSanitizer
runtime,

Ah, that would do it.

so your build breaks there.
Probably it's not the best idea: as David mentions, developers may use
different compilers. We may break many
of them if their weird (or old) compiler produces any kind of warning in
ASan code. I'm removing -Werror now.

In the CMake build (& I think the Make build too) at the LLVM level
there's a cmake/configure option for building the whole project as
with -Werror. That's probably the right place for this option (& most
other diagnostic flags, etc, ideally) to live - at some point I want
to bring up a -Werror buildbot (or add it to one of the existing
builders - probably on in a phase2 build) to make this a bit easier to
maintain.

- David

Confirmed fixed. I can now build r163806 with Xcode 4.4.1's clang.

Thanks,