[lld] buildbot configuration on using -fsanitize options

Hi All, Chandler,

After listening to Chandlers presentation at Going native 2013,

I think "lld" should add a buildbot configuration to turn on building lld with -fsanitize options and have buildbot configurations to run on

* darwin
* linux (ubuntu).

I was not really sure on if llvm changes use a buildbot with the -fsanitize options turned on / how stable the llvm libraries are when compiled using those options.

Does it make sense to have

* llvm built in the normal way
* just build lld with the options -fsanitize=address,undefined,memory options ?

(or)

* build all the sources including lld with the options -fsanitize=address,undefined,memory

Has anyone done this experiment already ?

Thanks

Shankar Easwaran

There are existing Darwin and Win7 builders, and a few Debian configs that also build lld. I'd support enabling the sanitizers on these builds as is. Also, tsan especially because lld uses threads.

If you'd like an Ubuntu bot, somebody is going to have to provide one.

Alex

Hi Alex,

+ Galina

Ubuntu/Debian should work as well, I wanted one flavor where lld could be built on linux platform.

I will want to have a seperate buildbot to seperate failures if any due to the fsanitize options.

Do you know if llvm itself gets tested as a complete build with the fsanitize options ?

Enabling tsan seems to be a good idea too.

Thanks

Shankar Easwaran

We test it very regularly with all of the sanitizers. We've not been able
to add these bots easily due to infrastructure issues.

Thanks for the info Chandler. I would like to add the extra fsanitize configs to the lld buildbot to detect problems early.

There have been a bunch of temporary string issues, which would have been easily caught by the sanitizer tools.

Thanks

Shankar Easwaran

FYI We have an upstream bootstrap bot (http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap) that does a number of things including running llvm/clang tests under ASan/MSan. Probably we can add a couple of steps that would checkout lld and run check-lld in ASan-ified/MSan-ified build trees.

Does it build with libstdc++? I've got this with fresh clang, -std=c++11:

In file included from ../projects/lld/lib/ReaderWriter/ELF/./SectionChunks.h:19:
In file included from ../projects/lld/include/lld/Core/Parallel.h:28:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/condition_variable:38:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:535:6:
error: no matching constructor for initialization of 'duration' (aka
'std::chrono::duration<long, std::ratio<1, 1000000> >')
          : __d(__t.time_since_epoch())

Hi Evgeniy,

Can you add the step to checkout lld and build and run the unittests then ?

Thanks

Shankar Easwaran

The bootstrap bot currently builds with libstdc++. AFAIU, lld does not
support that.
It would need to be switched to libc++. Also, MSan uses a precompiled,
instrumented libstdc++ binary, which should be replaced with libc++
built from source. We've got a script for it, which is not used at the
moment:

https://code.google.com/p/address-sanitizer/source/browse/trunk/build/scripts/slave/bootstrap/build_libcxx.sh

This looks like a non-trivial amount of work that I would be not have
time for in the near future.
You are welcome to try.