ramosian-glider / sanitizers

0 stars 0 forks source link

asan doesn't compile on Linux with GCC 4.4 #147

Closed ramosian-glider closed 9 years ago

ramosian-glider commented 9 years ago

Originally reported on Google Code with ID 146

What steps will reproduce the problem?
1. Checkout llvm sources rev. 173675  (but could also be reproduced with earlier versions)
2. Try to compile everything using cmake and gcc4.4

What is the expected output? What do you see instead?

It should compile without error. But I get :

[ 19%] /tmp/llvm/projects/compiler-rt/lib/msan/msan_allocator.cc:36:error: ‘__msan::cache’
cannot be thread-local because it has non-POD type ‘__msan::AllocatorCache’
cc1plus: warning: unrecognized command line option "-Wno-c99-extensions"
make[2]: *** [projects/compiler-rt/lib/msan/CMakeFiles/clang_rt.msan-x86_64.dir/msan_allocator.cc.o]
Error 1
make[1]: *** [projects/compiler-rt/lib/msan/CMakeFiles/clang_rt.msan-x86_64.dir/all]
Error 2
make[1]: *** Waiting for unfinished jobs....

FYI I'm using these options for cmake :

cmake -DLLVM_BUILD_32_BITS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON

What version of the product are you using? On what operating system?

❯ uname -a
Linux linux-job 2.6.32-5-amd64 #1 SMP Wed Jan 12 03:40:32 UTC 2011 x86_64 GNU/Linux

❯ gcc --version
gcc (Debian 4.4.5-8) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reported by mkvtoolnix.build.jonthn on 2013-01-28 08:20:32

ramosian-glider commented 9 years ago
can you use a newer gcc? 

Reported by konstantin.s.serebryany on 2013-01-28 08:23:51

ramosian-glider commented 9 years ago
I could use clang 3.1 or 3.2 but GCC is easier for me as I don't have to mess with CFLAGS/LDFLAGS

Reported by mkvtoolnix.build.jonthn on 2013-01-28 10:42:09

ramosian-glider commented 9 years ago
Can you use newer version of GCC (like 4.6.3) instead?

Reported by samsonov@google.com on 2013-01-28 11:14:44

ramosian-glider commented 9 years ago
To be clear : 

  - GCC 4.4 is my first choice and preferred compiler as it's the default one so less
trouble.
  - in any other case I prefer to use clang (as it's easier to build it from scratch)

In any case if you want to use features only available to recent compiler that's okay
I'll comply with that (maybe a #warning/#error in the code would be great) 

Reported by mkvtoolnix.build.jonthn on 2013-01-28 14:08:13

ramosian-glider commented 9 years ago
We'd like to support older compilers but it comes with a cost.
E.g. today we don't have a regular testing process for older compilers, so the code
will rot (for older compiler). 
I don't even have accesses to older gcc handy (and I just failed to build one today)
If you have a patch (presumably to sanitizer_common/sanitizer_allocator.h)
I'd be happy to apply it (if it still works for the newer compilers of course)

Reported by konstantin.s.serebryany on 2013-01-28 14:15:58

ramosian-glider commented 9 years ago
We are not going to fix gcc 4.4 and older builds ourselves nor to set up 
regular testing with old compilers. 
However, we'll be happy to apply patches that fix compilation on any platform.
Please send change lists to llvm-commits@ 

Reported by konstantin.s.serebryany on 2013-02-15 13:10:09

ramosian-glider commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:13:40