Merging MinGW toolchain patches to 3.7

+cfe-dev to keep it on the list, and Richard

This sounds like a reasonable thing to merge.

Richard, what's your opinion as an owner?

Yes, we should get these changes into 3.7. I’ll look over the patches later today.

Yes, we should get these changes into 3.7. I'll look over the patches
later today.

I'm not very happy about applying patches with no tests to the branch, but,
reluctantly, approved.

Yaron: please add some tests for r242660 and r242667 to trunk. (I also find
it very weird that the MinGW::Arch member has a trailing slash. Is there a
good reason for that?)

Hi Richard,

r242660 + r242666 + r242667 are the current mingw toolchain, should be tested together.
The code test covarage is not complete:

  1. To make the toolchain work automatically, the first stage is detection of the mingw installation dir in MinGW::findGccLibDir(). This part is not covered by any tests as it probes several file system directories outside the LLVM tree using llvm::sys::fs::directory_iterator, we can’t control that using test infrastructure.
    The most reliable way to test this toolchain would be to have a mingw toolchain installed on various bots and run tests using it. I’m open to suggestions how to test MinGW::findGccLibDir() otherwise.

  2. The second stage generates the C and C++ include directories based on GccLibDir found in stage one. This is covered by the tests introduced in r242666 by injecting GccLibDir with --sysroot argument (instead of probing the file system) for both Windows and Linux.

MinGW::Arch has a trainling slash as a small optimization so Arch could be concatenated into a path instead of using sys::path::append. If you find that confusing I can remove the trailing slash and use sys::path::append calls instead, it would not matter much.

Yaron

I've merged the requested changes in r243059, r243061, r243063, and r243064.

Please keep me posted if there are any follow-up commits with tests
that should get merged.

Thanks,
Hans

Hi Richard,

r242660 + r242666 + r242667 are the current mingw toolchain, should be
tested together.
The code test covarage is not complete:

1) To make the toolchain work automatically, the first stage is detection
of the mingw installation dir in MinGW::findGccLibDir(). This part is not
covered by any tests as it probes several file system directories outside
the LLVM tree using llvm::sys::fs::directory_iterator, we can't control
that using test infrastructure.

Please take a look at how other targets handle this (see the various
sysroot trees under test/Driver/Inputs). If the same approach can't work
here, we should figure out how to fix that. The MinGW driver support should
be testable without having a MinGW toolchain installed, otherwise the cost
imposed on people maintaining the driver and Clang in general is too high.

The most reliable way to test this toolchain would be to have a mingw

toolchain installed on various bots and run tests using it. I'm open to
suggestions how to test MinGW::findGccLibDir() otherwise.

2) The second stage generates the C and C++ include directories based
on GccLibDir found in stage one. This *is* covered by the tests introduced
in r242666 by injecting GccLibDir with --sysroot argument (instead of
probing the file system) for both Windows and Linux.

MinGW::Arch has a trainling slash as a small optimization so Arch could be
concatenated into a path instead of using sys::path::append. If you find
that confusing I can remove the trailing slash and use sys::path::append
calls instead, it would not matter much.

There should at least be a comment explaining this in the class definition.
But generally, using the higher-level facilities such as sys::path::append
should be preferred over manually inserting separators into paths, so I'd
prefer you did that. Performance microoptimizations are not especially
relevant for the driver, since it's such a tiny proportion of the cost of a
compilation.

I’ve merged the requested changes in r243059, r243061, r243063, and r243064.

Great thanks Hans, I’ll start testing the branch now :slight_smile:

Any word on r242539 r242540 for compiler-rt ?

Hi Richard,

Both issues implemented in r243098, r243101, r243105 per your suggestions.

It may be of general interest that two builders: sanitizer-x86_64-linux-fast and clang-x86_64-ubuntu-gdb-75 add .svn entries in some (all?) directories which may cause code that does not expect them there to malfunction.

Yaron

I've merged the requested changes in r243059, r243061, r243063, and
r243064.

Great thanks Hans, I'll start testing the branch now :slight_smile:

Any word on r242539 r242540 for compiler-rt ?

Those got merged in r243059.

Some of the original commits were merged together in one go, so the
number of commits to the branch doesn't match the number of commits
merged. Sorry for the confusion.

Hi Richard,

Both issues implemented in r243098, r243101, r243105 per your suggestions.

I'd like to merge these too if possible. Richard?

Many thanks Hans :slight_smile:

I do see it at http://reviews.llvm.org/rL243059

The mirrors however don’t have this for some reason
https://github.com/llvm-mirror/compiler-rt/commits/release_37

even though they are updated every 5 minutes

Many thanks Hans :slight_smile:

I do see it at http://reviews.llvm.org/rL243059

The mirrors however don't have this for some reason
https://github.com/llvm-mirror/compiler-rt/commits/release_37
even though they are updated every 5 minutes

+Anton, it seems http://llvm.org/git/compiler-rt.git’s release_37
branch is stuck at r242848, which means r243059 is missing. Can we
unstuck it somehow?

It may be of general interest that two builders: sanitizer-x86_64-linux-fast and clang-x86_64-ubuntu-gdb-75 add .svn entries in some (all?) directories which may cause code that does not expect them there to malfunction.

I think this depends on the version of SVN that created the tree. Older SVN versions put a .svn in every directory, newer ones do not.

–paulr

Thanks Paul!

Hi Richard,

Both issues implemented in r243098, r243101, r243105 per your suggestions.

Yaron, can you give a complete list of the additional revisions that should
be integrated to the branch, including today's changes? Thanks!

I committed these patches to the mingw toolchain:

r241241 - Support mingw-w64 and mingw.org toolchains at any install location.
r241432 - Teach mingw toolchain the msys2 mingw-w64 distribution C++ dirs.‏
r241485 - Support -pthread in mingw toolchain.
r242121 - Add support for -fuse-ld= in the mingw toolchain driver.
r242150 - Support mingw-w64 toolchain on openSUSE and likely other Linuxes
r242660 - Support mingw toolchain include and lib directories on Arch Linux.‏
r242662 - Fix typo found by Joerg Sonnenberger.
r242667 - Remove erroneous space in “lib64” string constant.
r242766 - Fix mingw toolchain to honor sysroot on Linux and add tests.‏
r243098 - Add extensive tests for the mingw toolchain and remove trailing slash from Arch.‏
r243101 - Try to appease clang buildbot by forcing libstdc++ in mingw.cpp test.
r243105 - Apparently some of the bots add .svn dirs inside the test/Driver/Inputs
r243144 - Base the sys-root/mingw/include path on sysroot and not on /usr
r243153 - Select the highest version of the mingw toolchain found using Generic_GCC::GCCVersion

Reid Kleckner also committed:
r242905 - [mingw] Add support for -rtlib option and -stdlib option to the mingw driver

For my own notes...

I committed these patches to the mingw toolchain:

Committed before 3.7 branch-point:

r241241 - Support mingw-w64 and mingw.org toolchains at any install
location.
r241432 - Teach mingw toolchain the msys2 mingw-w64 distribution C++ dirs.‏
r241485 - Support -pthread in mingw toolchain.
r242121 - Add support for -fuse-ld= in the mingw toolchain driver.
r242150 - Support mingw-w64 toolchain on openSUSE and likely other Linuxes

Already merged:

r242660 - Support mingw toolchain include and lib directories on Arch
Linux.‏
r242662 - Fix typo found by Joerg Sonnenberger.
r242667 - Remove erroneous space in "lib64" string constant.
r242766 - Fix mingw toolchain to honor sysroot on Linux and add tests.‏

Not merged yet; waiting for owner:

r243098 - Add extensive tests for the mingw toolchain and remove trailing
slash from Arch.‏
r243101 - Try to appease clang buildbot by forcing libstdc++ in mingw.cpp
test.
r243105 - Apparently some of the bots add .svn dirs inside the
test/Driver/Inputs
r243144 - Base the sys-root/mingw/include path on sysroot and not on /usr
r243153 - Select the highest version of the mingw toolchain found using
Generic_GCC::GCCVersion

Already merged:

For my own notes...

> I committed these patches to the mingw toolchain:

Committed before 3.7 branch-point:

> r241241 - Support mingw-w64 and mingw.org toolchains at any install
> location.
> r241432 - Teach mingw toolchain the msys2 mingw-w64 distribution C++
dirs.‏
> r241485 - Support -pthread in mingw toolchain.
> r242121 - Add support for -fuse-ld= in the mingw toolchain driver.
> r242150 - Support mingw-w64 toolchain on openSUSE and likely other
Linuxes

Already merged:

> r242660 - Support mingw toolchain include and lib directories on Arch
> Linux.‏
> r242662 - Fix typo found by Joerg Sonnenberger.
> r242667 - Remove erroneous space in "lib64" string constant.
> r242766 - Fix mingw toolchain to honor sysroot on Linux and add tests.‏

Not merged yet; waiting for owner:

> r243098 - Add extensive tests for the mingw toolchain and remove trailing
> slash from Arch.‏
> r243101 - Try to appease clang buildbot by forcing libstdc++ in mingw.cpp
> test.
> r243105 - Apparently some of the bots add .svn dirs inside the
> test/Driver/Inputs
> r243144 - Base the sys-root/mingw/include path on sysroot and not on /usr
> r243153 - Select the highest version of the mingw toolchain found using
> Generic_GCC::GCCVersion

Thanks for the summary, approved for branch.

Merged in r243325.

Thanks,
Hans