Coder Social home page Coder Social logo

llvm-mingw's Introduction

LLVM MinGW

This is a recipe for reproducibly building a LLVM/Clang/LLD based mingw-w64 toolchain.

Benefits of a LLVM based MinGW toolchain are:

  • Support for targeting ARM/ARM64 (while GCC obviously does support these architectures, it doesn't support Windows on ARM)
  • A single toolchain targeting all four architectures (i686, x86_64, armv7 and arm64) instead of separate compiler binaries for each architecture
  • Support for generating debug info in PDB format
  • Support for Address Sanitizer and Undefined Behaviour Sanitizer
  • Since LLVM 16: Support for Control Flow Guard (-mguard=cf compile and link flags)

Clang on its own can also be used as compiler in the normal GNU binutils based environments though, so the main difference lies in replacing binutils with LLVM based tools.

Releases

The GitHub Releases page contains prebuilt toolchains that can be downloaded and installed by just unpacking them.

They come primarily in two different forms; packages named llvm-mingw-<version>-<crt>-ubuntu-<distro_version>-<arch>.tar.xz are cross compilers, that can be run on Linux, compiling binaries for any of the 4 target Windows architectures. Packages named llvm-mingw-<version>-<crt>-<arch>.zip are native toolchains that run on Windows (with binaries in the specified architecture), but which all can compile binaries for any of the 4 architectures.

The cross compilers come in versions running on either x86_64 or aarch64. (They're built on Ubuntu, but hopefully do run on other contempory distributions as well.)

There are packages with two different choices of CRT (C runtime) - the primary target is UCRT (the Universal C Runtime). The UCRT is available preinstalled since Windows 10, but can be installed on top of Vista or newer. The other legacy alternative is msvcrt, which produces binaries for (and uses) msvcrt.dll, which is a built-in component in all versions of Windows. This allows running directly out of the box on older versions of Windows too, without ensuring that the UCRT is installed, but msvcrt.dll is generally less featureful. Address Sanitizer only works properly with UCRT.

In addition to the downloadable toolchain packges, there are also prebuilt docker linux images containing the llvm-mingw toolchain, available from Docker Hub.

There are also nightly builds with the very latest versions of LLVM and mingw-w64 from git.

Building from source

The toolchain can be compiled for installation in the current Unix environment, fetching sources as needed:

./build-all.sh <target-dir>

It can also be built, reproducibly, into a Docker image:

docker build .

Individual components of the toolchain can be (re)built by running the standalone shellscripts listed within build-all.sh. However, if the source already is checked out, no effort is made to check out a different version (if the build scripts have been updated to prefer a different version) - and likewise, if configure flags in the build-*.sh scripts have changed, you might need to wipe the build directory under each project for the new configure options to be taken into use.

Building in MSYS2

To build in MSYS2, install the following set of packages with pacman -S --needed:

git wget mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake make mingw-w64-x86_64-python3 autoconf libtool

Status

The toolchain currently does support both C and C++, including support for exception handling.

It is in practice new and hasn't been tested with quite as many projects as the regular GCC/binutils based toolchains yet. You might run into issues building non-trivial projects.

Known issues

LLD, the LLVM linker, is what causes most of the major differences to the normal GCC/binutils based MinGW.

  • As this toolchain uses a different CRT and C++ standard library than most mingw toolchains, it is incompatible with object files and static libraries built with other toolchains. Mixing DLLs from other toolchains is supported, but only as long as CRT resources aren't shared across DLL boundaries (no sharing of file handles etc, and memory should be freed by the same DLL that allocated it).
  • The windres replacement, llvm-rc, isn't very mature and doesn't support everything that GNU windres does.
  • The toolchain defaults to using the Universal CRT (which is only available out of the box since Windows 10, but can be installed on Vista or newer) and defaults to targeting Windows 7. These defaults can be changed in build-mingw-w64.sh though.
  • The toolchain uses Windows native TLS support, which doesn't work properly until Windows Vista. This has no effect on code not using thread local variables.
  • The runtime libraries libunwind, libcxxabi and libcxx also assume that the target is Windows 7 or newer.
  • Address Sanitizer doesn't produce working backtraces for i686. Address Sanitizer requires using a PDB file for symbolizing the error location and backtraces.
  • The sanitizers are only supported on x86.
  • LLD doesn't support linker script (in the COFF part of LLD). Linker script can be used for reprogramming how the linker lays out the output, but is in most cases in MinGW setups only used for passing lists of object files to link. Passing lists of files can also be done with response files, which LLD does support. (This was fixed in qmake in v5.12.0, to use response files instead of linker script.)
  • Libtool based projects fail to link with llvm-mingw if the project contains C++. (This often manifests with undefined symbols like ___chkstk_ms, __alloca or ___divdi3.) For such targets, libtool tries to detect which libraries to link by invoking the compiler with $CC -v and picking up the libraries that are linked by default, and then invoking the linker driver with -nostdlib and specifying the default libraries manually. In doing so, libtool fails to detect when clang is using compiler_rt instead of libgcc, because clang refers to it as an absolute path to a static library, instead of specifying a library path with -L and linking the library with -l. Clang is reluctant to changing this behaviour. A bug has been filed with libtool, but no fix has been committed, and as libtool files are shipped with the projects that use them (bundled within the configure script), one has to update the configure script in each project to avoid the issue. This can either be done by installing libtool, patching it and running autoreconf -fi in the project, or by manually applying the fix on the shipped configure script. A patched version of libtool is shipped in MSYS2 at least.
  • Libtool, when running on Windows, prefers using linker script over response files, to pass long lists of object files to the linker driver, but LLD doesn't support linker script (as described above). This issue produces errors like lld-link: error: .libs\libfoobar.la.lnkscript: unknown file type. To fix this, the bundled libtool scripts has to be fixed like explained above, but this fix requires changes both to configure and a separate file named ltmain.{in,sh}. A fix for this is also shipped in MSYS2.

Additionally, one may run into other minor differences between GCC and clang.

PDB support

LLVM does support generating debug info in the PDB format. Since GNU binutils based mingw environments don't support this, there's no predecent for what command line parameters to use for this, and llvm-mingw produces debug info in DWARF format by default.

To produce debug info in PDB format, you currently need to do the following changes:

  • Add -gcodeview to the compilation commands (e.g. in wrappers/clang-target-wrapper.sh), together with using -g as usual to enable debug info in general.
  • Add -Wl,--pdb= to linking commands. This creates a PDB file at the same location as the output EXE/DLL, but with a PDB extension. (By passing -Wl,--pdb=module.pdb one can explicitly specify the name of the output PDB file.)

Even though LLVM supports this, there are some caveats with using it when building in MinGW mode; Microsoft debuggers might have assumptions about the C++ ABI used, which doesn't hold up with the Itanium ABI used in MinGW.

llvm-mingw's People

Contributors

adiantek avatar alvinhochun avatar andarwinux avatar chouquette avatar cjacek avatar dnicolson avatar dtretyakov avatar jdek avatar longnguyen2004 avatar masternobody avatar mati865 avatar mstorsjo avatar nidefawl avatar nolange avatar orgads avatar robux4 avatar rsp4jack avatar russellhaley avatar scr3amer avatar strager avatar thresheek avatar trilader avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

llvm-mingw's Issues

Please add --use-temp-file to windres options.

With mingw64 windres it's used with -D if the defined string has quotes that must be preserved.
It seems that llvm windres does not need this option, so simply accepting and ignoring it may be enough.

Thank you.
Fabio

Building on msys ?

Is it possible ? I have MSYS2 with gcc, llvm, and various dev toolchains installed, but apparently...

 ./build-all.sh  ../llvm
CMake Deprecation Warning at CMakeLists.txt:14 (cmake_policy):
  The OLD behavior for policy CMP0051 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is GNU
-- Found assembler: /mingw64/bin/cc.exe
-- Check for working C compiler: /mingw64/bin/cc.exe
-- Check for working C compiler: /mingw64/bin/cc.exe -- broken
CMake Error at /usr/share/cmake-3.12.4/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/mingw64/bin/cc.exe"

  is not able to compile a simple test program.

for information :

$ cc.exe -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/7.3.0/lto-wrapper.exe
Target: x86_64-pc-msys
Configured with: /msys_scripts/gcc/src/gcc-7.3.0/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --with-tune=generic --disable-multilib --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --disable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 7.3.0 (GCC)

and building "simple test programs" (int main() { }) works fine with it

gnu binutils can not recognized the library create by llvm-dlltool

use ld.bfd.exe will link failed, and run nm reports many file format not recognized

nm-new.exe --version
GNU nm (GNU Binutils) 2.31.1
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
nm-new.exe lib64/libmsvcrt.a > /dev/null
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
E:\llvm8\bin\nm-new.exe: api-ms-win-crt-conio-l1-1-0.dll: file format not recognized
...

try/catch not work correctly with i686 dwarf exceptions

#include <iostream>

int main() {
  try {
    std::locale loc("test");
  } catch (std::runtime_error& e) {
    std::cerr << "Caught " << e.what() << std::endl;
    std::cerr << "Type " << typeid(e).name() << std::endl;
  } catch (...) {
    std::cerr << "catch all" << std::endl;
  }

  return 0;
}

sismple test program
with static libcxx result

Caught collate_byname<char>::collate_byname failed to construct for test
Type St13runtime_error

with shared libcxx result

terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for test

Linking with dll doesn't work with ld.lld?

So I've run the script, and then "transplanted" ld.lld into my existing MXE system, and then tried recompiling with -fuse-ld=lld, and everything seems to work great (25x speedup in linking, which is ridiculous).

The only problem is, when I try to make it dynamic link with a .dll, lld can't seem to find the .dll. The same invocation without -fuse-ld=lld works, and ld.bfd seems to be able to find the supplied .dll.

With lld, I got the message:
lld: error: unable to find library -ldiscord_game_sdk

Any idea what is possibly causing this?

[msys2 build] build fails during build-compiler-rt.sh

$ ./build-compiler-rt.sh $PWD/llvm
./build-compiler-rt.sh: line 29: /c/dev/llvm/llvm-mingw/llvm/bin/clang: No such file or directory
dirname: missing operand
Try 'dirname --help' for more information.
dirname: missing operand
Try 'dirname --help' for more information.
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.

I suppose it should be clang.exe instead of clang here :

CLANG_VERSION=$(basename $(dirname $(dirname $(dirname $($PREFIX/bin/clang --print-libgcc-file-name -rtlib=compiler-rt)))))

how do you handle this "cross-platformly" ?

DCMAKE_CROSSCOMPILE flag in build-llvm.sh

First off, great project I find it tremendously useful and have it integrated into my core CI build system. Very light weight and easy to use.

I noticed a compile warning on LLVM compile Manually-specified variables were not used by the project: CMAKE_CROSSCOMPILE upon inspection of LLVM sources I found reference to the DCMAKE_CROSSCOMPILING flag (note the 'ING'). Compiling the project using this flag instead removed the warning. As a counter test I removed the flag all together (the build quickly failed).

[LLD] Support `--enable-long-section-names`

I don't know if it's required for LLD (maybe stub would suffice) but Rust hardcodes this flag for compatibility with older LD versions
since it's MinGW target early days.
It could be possible to drop this flag by now but it'd require a lot of testing. Maybe it'd make sense for LLD to implement this flag (or stub) for feature parity with LD?

This blocks usage of Rust MinGW target with LLD.

The linker fails to recognize DLL shared libraries with CMake

Hey, thanks for the toolchain, I found it quite useful!

I've encountered a few minor problems with the linker using CMake due to some differences with the original toolchain:

  • Using find_library() with target_link_libraries() function to find and link against a static or shared library in CMake leads to the following error: lld-link: error: library.dll: bad file type. Did you specify a DLL instead of an import library? (unlike the original MinGW or MSVC, this toolchain handles only static libraries that way).
  • Using target_link_libraries(application pthread) function to link against POSIX threads leads to: lld-link: error: undefined symbol: pthread_create while -lpthread argument works just fine.

LLDB support?

Never tried that but LLDB status say it works on Windows X86 and some articles on the web described how to set up it. Is it possible to include LLDB in this build?
I can not test now but if there are no additional dependencies (python maybe?) it should be just a:

diff --git a/build-llvm.sh b/build-llvm.sh
index d1d848c..e08599d 100755
--- a/build-llvm.sh
+++ b/build-llvm.sh
@@ -121,7 +121,7 @@ MINGW*)
     # path names are included, in assert messages), allowing ccache to speed
     # up compilation.
     cd tools
-    for p in clang lld; do
+    for p in clang lld lldb; do
         if [ ! -e $p ]; then
             ln -s ../../$p .
         fi
@@ -137,7 +137,7 @@ cmake \
     -DCMAKE_INSTALL_PREFIX="$PREFIX" \
     -DCMAKE_BUILD_TYPE=Release \
     -DLLVM_ENABLE_ASSERTIONS=$ASSERTS \
-    ${EXPLICIT_PROJECTS+-DLLVM_ENABLE_PROJECTS="clang;lld"} \
+    ${EXPLICIT_PROJECTS+-DLLVM_ENABLE_PROJECTS="clang;lld;lldb"} \
     -DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86" \
     -DLLVM_INSTALL_TOOLCHAIN_ONLY=$TOOLCHAIN_ONLY \
     -DLLVM_TOOLCHAIN_TOOLS="llvm-ar;llvm-ranlib;llvm-objdump;llvm-rc;llvm-cvtres;llvm-nm;llvm-strings;llvm-readobj;llvm-dlltool;llvm-pdbutil;llvm-objcopy;llvm-strip;llvm-cov;llvm-profdata;llvm-addr2line" \

Unexpected script behavior

For someone that did not read the script before using it, it might be really
unexpected that extract-docker.sh does a rm -rf $dir, maybe add
info to the help output that it does that?

Releases require Vista or later

I request release binaries for 32bit x86 be built using the compiler options -Xlinker /subsystem:console,4.0 and -march=pentium to enable higher compatibility with OSes and machines.

Only people who want to build on XP, Win2K and NT4 will use the 32-bit builds to start with so it's fine if it's a little slower because of the architectural compatibility.

Performance Regression

I'm seeing a 20x slowdown on the latest revision (ca329c1)
compared to 053c581.
I rebuilt both revisions of the toolchain on the same system just now and still see regression.

I'm building on Ubuntu like this:

mkdir /opt/build && cd /opt/build
mkdir toolchain-native
mkdir toolchain-win
git clone https://github.com/mstorsjo/llvm-mingw.git
cd llvm-mingw
./build-all.sh /opt/build/toolchain-native
./build-cross-tools.sh /opt/build/toolchain-native /opt/build/toolchain-win x86_64

A newer release build (with disabled asserts) would be much appreciated

about memory leaks

I looked at source code, e.g.,windres-wrapper.c, clang-target-wrapper.c.
I see a lot of _tcsdup and malloc function calls, but without free, and it will lead to memory leaks.

Share openmp support

I create two patch to build openmp with mingw clang on window https://reviews.llvm.org/D53397 and https://reviews.llvm.org/D53422
I share cmake build config here, currently only supports compiling under windows, because need masm compile asm code.

i686

cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=i686-w64-mingw32-clang -DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ -DCMAKE_ASM_MASM_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x86/ml.exe" -DCMAKE_RC_COMPILER=E:/llvm8/bin/i686-w64-mingw32-windres.exe -DCMAKE_AR=E:/llvm8/bin/llvm-ar.exe -DCMAKE_RANLIB=E:/llvm8/bin/llvm-ranlib.exe -DOPENMP_LLVM_LIT_EXECUTABLE=L:/llvm8build/llvm/bin/llvm-lit.py -DOPENMP_FILECHECK_EXECUTABLE=L:/llvm8build/llvm/bin/FileCheck.exe -DCMAKE_INSTALL_PREFIX=E:/llvm8 E:/Source/git/llvm-project/openmp

x86_64

cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_ASM_MASM_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/ml64.exe" -DCMAKE_AR=E:/llvm8/bin/llvm-ar.exe -DCMAKE_RANLIB=E:/llvm8/bin/llvm-ranlib.exe -DOPENMP_LLVM_LIT_EXECUTABLE=L:/llvm8build/llvm/bin/llvm-lit.py -DOPENMP_FILECHECK_EXECUTABLE=L:/llvm8build/llvm/bin/FileCheck.exe -DCMAKE_INSTALL_PREFIX=E:/llvm8 E:/Source/git/llvm-project/openmp

test result

[0/1] Running libomp tests
-- Testing: 171 tests, 8 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 62.85s
********************
Unsupported Tests (71):
    libomp :: env/kmp_aff_disable_hwloc.c
    libomp :: ompt/cancel/cancel_parallel.c
    libomp :: ompt/cancel/cancel_taskgroup.c
    libomp :: ompt/cancel/cancel_worksharing.c
    libomp :: ompt/loadtool/tool_available/tool_available.c
    libomp :: ompt/loadtool/tool_available_search/tool_available_search.c
    libomp :: ompt/loadtool/tool_not_available/tool_not_available.c
    libomp :: ompt/misc/api_calls_from_other_thread.cpp
    libomp :: ompt/misc/api_calls_misc.c
    libomp :: ompt/misc/api_calls_places.c
    libomp :: ompt/misc/control_tool.c
    libomp :: ompt/misc/interoperability.cpp
    libomp :: ompt/misc/threads.c
    libomp :: ompt/misc/threads_nested.c
    libomp :: ompt/misc/unset_callback.c
    libomp :: ompt/parallel/dynamic_enough_threads.c
    libomp :: ompt/parallel/dynamic_not_enough_threads.c
    libomp :: ompt/parallel/max_active_levels_serialized.c
    libomp :: ompt/parallel/nested.c
    libomp :: ompt/parallel/nested_lwt.c
    libomp :: ompt/parallel/nested_serialized.c
    libomp :: ompt/parallel/nested_thread_num.c
    libomp :: ompt/parallel/no_thread_num_clause.c
    libomp :: ompt/parallel/normal.c
    libomp :: ompt/parallel/not_enough_threads.c
    libomp :: ompt/parallel/parallel_if0.c
    libomp :: ompt/parallel/serialized.c
    libomp :: ompt/synchronization/barrier/explicit.c
    libomp :: ompt/synchronization/barrier/for_loop.c
    libomp :: ompt/synchronization/barrier/for_simd.c
    libomp :: ompt/synchronization/barrier/implicit_task_data.c
    libomp :: ompt/synchronization/barrier/parallel_region.c
    libomp :: ompt/synchronization/barrier/sections.c
    libomp :: ompt/synchronization/barrier/single.c
    libomp :: ompt/synchronization/critical.c
    libomp :: ompt/synchronization/flush.c
    libomp :: ompt/synchronization/lock.c
    libomp :: ompt/synchronization/master.c
    libomp :: ompt/synchronization/nest_lock.c
    libomp :: ompt/synchronization/ordered.c
    libomp :: ompt/synchronization/taskgroup.c
    libomp :: ompt/synchronization/taskwait.c
    libomp :: ompt/synchronization/test_lock.c
    libomp :: ompt/synchronization/test_nest_lock.c
    libomp :: ompt/synchronization/test_nest_lock_parallel.c
    libomp :: ompt/tasks/dependences.c
    libomp :: ompt/tasks/explicit_task.c
    libomp :: ompt/tasks/serialized.c
    libomp :: ompt/tasks/task_in_joinbarrier.c
    libomp :: ompt/tasks/task_types.c
    libomp :: ompt/tasks/task_types_serialized.c
    libomp :: ompt/tasks/taskloop.c
    libomp :: ompt/tasks/taskyield.c
    libomp :: ompt/tasks/untied_task.c
    libomp :: ompt/worksharing/for/auto.c
    libomp :: ompt/worksharing/for/auto_serialized.c
    libomp :: ompt/worksharing/for/auto_split.c
    libomp :: ompt/worksharing/for/dynamic.c
    libomp :: ompt/worksharing/for/dynamic_serialized.c
    libomp :: ompt/worksharing/for/dynamic_split.c
    libomp :: ompt/worksharing/for/guided.c
    libomp :: ompt/worksharing/for/guided_serialized.c
    libomp :: ompt/worksharing/for/guided_split.c
    libomp :: ompt/worksharing/for/runtime.c
    libomp :: ompt/worksharing/for/runtime_serialized.c
    libomp :: ompt/worksharing/for/runtime_split.c
    libomp :: ompt/worksharing/for/static.c
    libomp :: ompt/worksharing/for/static_serialized.c
    libomp :: ompt/worksharing/for/static_split.c
    libomp :: ompt/worksharing/sections.c
    libomp :: ompt/worksharing/single.c

********************
Expected Failing Tests (1):
    libomp :: worksharing/for/omp_for_bigbounds.c

  Expected Passes    : 99
  Expected Failures  : 1
  Unsupported Tests  : 71

shared build lib++abi

First, sorry for my bad English.

Why I want build shared libc++abi? I think this is more standard, maybe I am wrong, but I still want to write my thoughts. If successful we should not merge libc++abi into libc++ both static and shared, and override AddCXXStdlibLibArgs function add -lc++abi and -lunwind in MinGW.cpp like WebAssembly.cpp#L143 and CloudABI.cpp#L116 done.

Currently shared build libc++ static linked libc++abi, because libc++abi depend thread_support, tls , new/delete related function export from libc++, if build shared libc++abi will lead to circular dependence.
An ugly implementation is:

  1. build shared libc++ with static libc++abi first
  2. build shared libc++abi linked to shared libc++ use bfd linker with --allow-multiple-definition (because lld does not support --allow-multiple-definition with coff target)
  3. rebuild shared libc++ link with shared libc++abi
  4. rebuild shared libc++abi.

I successfully build this ugly implementation and it seems to work fine.

If we want to build a good implementation, we need to fix thread_support, tls , new/delete related functions dependence.

  1. thread_support related function need by cxa_guard.cpp, Currently the thread_support used via win32 thread API from libcxx, but after D42214, the win32 thread API move into a .cpp file to avoid polluting the namespace of users of with the definitions in windows.h, but this change broken libc++abi's dependency on thread_support, because this change causes the thread_support related function to change from inline function to export function.
    if move win32 thread API from libc++ to libc++abi will solve this issue, but will broken MSVC build, because MSVC not need libc++abi.
    I tried make a copy of thread_win32.cpp into libc++abi, lead to a new issue, thread_win32.cpp#L121 need system_clock::now() exported from libc++, to avoid this issue need copy system_clock::now() implementation.
  2. the tls related function need by cxa_exception_storage.cpp, can easy solve by define HAS_THREAD_LOCAL use thread_local avoid dependency on tls related function, see cxa_exception_storage.cpp#L28
  3. the new/delete related function need by some class in libc++abi, can solve by define LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON when do cmake.

now I successfully build libc++abi without libc++ dependence. but still have a issue, both libc++ and libc++abi export thread_support and new/delete related function, in ld parameters if -lc++abi before than -lc++, the related thread_support and new/delete function will link to libc++abi.

Another good implementation is use windows pthread implementation to avoid win32 thread API export from both libc++ and libc++abi, but D42214 and _LIBCPP_SAFE_STATIC defined at __config#L1239 broken windows pthread build. D42214 add thread_win32.cpp in src/support/win32, but in lib/CMakeLists.txt#L7 it include all cpp file in src/support/win32, even if defined LIBCXX_HAS_WIN32_THREAD_API=OFF. winpthreads library defind PTHREAD_*_INITIALIZER at pthread.h#l282 are incompatible with _LIBCPP_SAFE_STATIC. after solving these two issue, I successful build libc++ and libc++abi with winpthreads library.

demo build, test source from this repo, thread.exe build from cppreference example
abi_with_win32_thread.zip
abi_with_pthread.zip

Compiling in a MinGW environment: MinGW CRT compilation phase fails

I'm attempting to run the scripts in a MinGW/MSys2 environement.

The MinGW CRT compilation phase fails:
EDIT: Ignore the folder name mingw-5.0.3 as its actually a git checkout of current master.

mv -f intrincs/.deps/lib64_libkernel32_a-ilockadd64.Tpo intrincs/.deps/lib64_libkernel32_a-ilockadd64.Po
/d/mingw-bootstrap/prefix/bin/clang -DHAVE_CONFIG_H -I. -I../mingw-5.0.3/mingw-w64-crt  -m64 -I../mingw-5.0.3/mingw-w64-crt/include -D_CRTBLD -I/d/mingw-bootstrap/prefix/x86_64-w64-mingw32/include  -pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -fdwarf-exceptions -target x86_64-w64-mingw32 -MT intrincs/lib64_libkernel32_a-readgsword.o -MD -MP -MF intrincs/.deps/lib64_libkernel32_a-readgsword.Tpo -c -o intrincs/lib64_libkernel32_a-readgsword.o `test -f 'intrincs/readgsword.c' || echo '../mingw-5.0.3/mingw-w64-crt/'`intrincs/readgsword.c
/d/mingw-bootstrap/prefix/bin/clang -DHAVE_CONFIG_H -I. -I../mingw-5.0.3/mingw-w64-crt  -m64 -I../mingw-5.0.3/mingw-w64-crt/include -D_CRTBLD -I/d/mingw-bootstrap/prefix/x86_64-w64-mingw32/include  -pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -fdwarf-exceptions -target x86_64-w64-mingw32 -MT intrincs/lib64_libkernel32_a-readgsdword.o -MD -MP -MF intrincs/.deps/lib64_libkernel32_a-readgsdword.Tpo -c -o intrincs/lib64_libkernel32_a-readgsdword.o `test -f 'intrincs/readgsdword.c' || echo '../mingw-5.0.3/mingw-w64-crt/'`intrincs/readgsdword.c
../mingw-5.0.3/mingw-w64-crt/intrincs/rdtsc.c:12:18: error: definition of builtin function '__rdtsc'
unsigned __int64 __rdtsc(void)
                 ^
1 warning and 1 error generated.
make[1]: *** [Makefile:28152: intrincs/lib64_libkernel32_a-rdtsc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 warning generated.
In file included from ../mingw-5.0.3/mingw-w64-crt/intrincs/readgsword.c:4:
In file included from D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\intrin.h:38:
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: warning: incompatible redeclaration of library function '_setjmp' [-Wincompatible-library-redeclaration]
  int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf _Buf, void *_Ctx);
                                                              ^
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: note: '_setjmp' is a builtin with type 'int (_JBTYPE *)' (aka 'int (struct _SETJMP_FLOAT128 *)')
mv -f intrincs/.deps/lib64_libkernel32_a-readgsbyte.Tpo intrincs/.deps/lib64_libkernel32_a-readgsbyte.Po
In file included from ../mingw-5.0.3/mingw-w64-crt/intrincs/readgsdword.c:4:
In file included from D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\intrin.h:38:
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: warning: incompatible redeclaration of library function '_setjmp' [-Wincompatible-library-redeclaration]
  int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf _Buf, void *_Ctx);
                                                              ^
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: note: '_setjmp' is a builtin with type 'int (_JBTYPE *)' (aka 'int (struct _SETJMP_FLOAT128 *)')
1 warning generated.
mv -f intrincs/.deps/lib64_libkernel32_a-readgsword.Tpo intrincs/.deps/lib64_libkernel32_a-readgsword.Po
1 warning generated.
mv -f intrincs/.deps/lib64_libkernel32_a-readgsdword.Tpo intrincs/.deps/lib64_libkernel32_a-readgsdword.Po
rm lib64/msvcr90d.def lib64/msvcr90.def lib64/msvcr100.def lib64/msvcr110.def lib64/msvcr120d.def lib64/msvcr120.def
make[1]: Leaving directory '/d/mingw-bootstrap/_mingw/_build'
make: *** [Makefile:7778: all] Error 2

output executable does not have '.exe' extension

When using MinGW with GCC and running gcc test.c -o test I got test.exe output executable.
The same command with this toolchain produce test file without .exe extension.
I'm pretty sure it is not correct place for this issue, but I think you can point me in right direction to report it.

libcxx build fails due to "libc++"

When I tried to run build-libcxx.sh script, I get this error:

`./build-libcxx.sh --disable-shared /d/mingw-llvm
-- The C compiler identification is Clang 9.0.0
-- The CXX compiler identification is Clang 9.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
-- Found LLVM_CONFIG_PATH as D:/mingw-llvm/bin/llvm-config.exe
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Failed
CMake Error at D:/mingw-llvm/lib/cmake/llvm/CheckCompilerVersion.cmake:80 (message):
libstdc++ version must be at least 4.8.
Call Stack (most recent call first):
D:/mingw-llvm/lib/cmake/llvm/HandleLLVMOptions.cmake:9 (include)
CMakeLists.txt:80 (include)

-- Configuring incomplete, errors occurred!
See also "D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeOutput.log".
See also "D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeError.log".`

CMakeOutput.log:

`The target system is: Windows - -
The host system is: Windows - 10.0.18850 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: D:/mingw-llvm/bin/i686-w64-mingw32-clang.exe
Build flags: -Wno-dll-attribute-on-redeclaration;-O2;-I/d/ffbuild/llvm/llvm-mingw/libcxx/include
Id flags:

The output was:
0

Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.exe"

The C compiler identification is Clang, found in "D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/3.14.0-rc4/CompilerIdC/a.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: D:/mingw-llvm/bin/i686-w64-mingw32-clang++.exe
Build flags: -Wno-dll-attribute-on-redeclaration;-O2;-I/d/ffbuild/llvm/llvm-mingw/libcxx/include
Id flags: -c

The output was:
0

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o"

The CXX compiler identification is Clang, found in "D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/3.14.0-rc4/CompilerIdCXX/CMakeCXXCompilerId.o"

Detecting C compiler ABI info compiled with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_80b96/fast
/usr/bin/make -f CMakeFiles/cmTC_80b96.dir/build.make CMakeFiles/cmTC_80b96.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -v -o CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.obj -c /C/CMake/share/cmake-3.14/Modules/CMakeCCompilerABI.c
clang version 9.0.0 (trunk)

Target: i686-w64-windows-gnu

Thread model: posix

InstalledDir: D:\mingw-llvm\bin

D:/mingw-llvm/bin/clang-9.exe -cc1 -triple i686-w64-windows-gnu -emit-obj -disable-free -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -v -coverage-notes-file D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.gcno -resource-dir D:/mingw-llvm/lib/clang/9.0.0 -I D:/ffbuild/llvm/llvm-mingw/libcxx/include -internal-isystem D:/mingw-llvm/lib/clang/9.0.0/include -internal-isystem D:/mingw-llvm/i686-w64-mingw32/include -internal-isystem D:/mingw-llvm/include -O2 -Wno-dll-attribute-on-redeclaration -fdebug-compilation-dir D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fsjlj-exceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.obj -x c C:/CMake/share/cmake-3.14/Modules/CMakeCCompilerABI.c -faddrsig

clang -cc1 version 9.0.0 based upon LLVM 9.0.0svn default target x86_64-w64-mingw32

#include "..." search starts here:

#include <...> search starts here:

D:/ffbuild/llvm/llvm-mingw/libcxx/include

D:/mingw-llvm/lib/clang/9.0.0/include

D:/mingw-llvm/i686-w64-mingw32/include

D:/mingw-llvm/include

End of search list.

Linking C executable cmTC_80b96.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_80b96.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_80b96.dir/objects.a @CMakeFiles/cmTC_80b96.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -v -Wl,--whole-archive CMakeFiles/cmTC_80b96.dir/objects.a -Wl,--no-whole-archive -o cmTC_80b96.exe -Wl,--out-implib,libcmTC_80b96.dll.a -Wl,--major-image-version,0,--minor-image-version,0
clang version 9.0.0 (trunk)

Target: i686-w64-windows-gnu

Thread model: posix

InstalledDir: D:\mingw-llvm\bin

D:/mingw-llvm/bin/ld.lld -m i386pe -Bdynamic -o cmTC_80b96.exe D:/mingw-llvm/i686-w64-mingw32/lib/crt2.o D:/mingw-llvm/i686-w64-mingw32/lib/crtbegin.o -LD:/mingw-llvm/i686-w64-mingw32/lib -LD:/mingw-llvm/lib -LD:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib --whole-archive CMakeFiles/cmTC_80b96.dir/objects.a --no-whole-archive --out-implib libcmTC_80b96.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a -lmoldname -lmingwex -lmsvcrt D:/mingw-llvm/i686-w64-mingw32/lib/crtend.o

make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'

Parsed C implicit include dir info from above output: rv=done
found start of include info
found start of implicit include info
add: [D:/ffbuild/llvm/llvm-mingw/libcxx/include
]
add: [D:/mingw-llvm/lib/clang/9.0.0/include
]
add: [D:/mingw-llvm/i686-w64-mingw32/include
]
add: [D:/mingw-llvm/include
]
end of search list found
implicit include dirs: [D:/ffbuild/llvm/llvm-mingw/libcxx/include
;D:/mingw-llvm/lib/clang/9.0.0/include
;D:/mingw-llvm/i686-w64-mingw32/include
;D:/mingw-llvm/include
]

Parsed C implicit link information from above output:
link line regex: [^( |.[/])(i686-w64-mingw32-ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_80b96/fast ]
ignore line: [/usr/bin/make -f CMakeFiles/cmTC_80b96.dir/build.make CMakeFiles/cmTC_80b96.dir/build]
ignore line: [make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp']
ignore line: [Building C object CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.obj]
ignore line: [/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -v -o CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.obj -c /C/CMake/share/cmake-3.14/Modules/CMakeCCompilerABI.c]
ignore line: [clang version 9.0.0 (trunk)
]
ignore line: [Target: i686-w64-windows-gnu
]
ignore line: [Thread model: posix
]
ignore line: [InstalledDir: D:\mingw-llvm\bin
]
ignore line: [ D:/mingw-llvm/bin/clang-9.exe -cc1 -triple i686-w64-windows-gnu -emit-obj -disable-free -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -v -coverage-notes-file D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.gcno -resource-dir D:/mingw-llvm/lib/clang/9.0.0 -I D:/ffbuild/llvm/llvm-mingw/libcxx/include -internal-isystem D:/mingw-llvm/lib/clang/9.0.0/include -internal-isystem D:/mingw-llvm/i686-w64-mingw32/include -internal-isystem D:/mingw-llvm/include -O2 -Wno-dll-attribute-on-redeclaration -fdebug-compilation-dir D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fsjlj-exceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o CMakeFiles/cmTC_80b96.dir/CMakeCCompilerABI.c.obj -x c C:/CMake/share/cmake-3.14/Modules/CMakeCCompilerABI.c -faddrsig
]
ignore line: [clang -cc1 version 9.0.0 based upon LLVM 9.0.0svn default target x86_64-w64-mingw32
]
ignore line: [#include "..." search starts here:
]
ignore line: [#include <...> search starts here:
]
ignore line: [ D:/ffbuild/llvm/llvm-mingw/libcxx/include
]
ignore line: [ D:/mingw-llvm/lib/clang/9.0.0/include
]
ignore line: [ D:/mingw-llvm/i686-w64-mingw32/include
]
ignore line: [ D:/mingw-llvm/include
]
ignore line: [End of search list.
]
ignore line: [Linking C executable cmTC_80b96.exe]
ignore line: [/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_80b96.dir/objects.a]
ignore line: [/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_80b96.dir/objects.a @CMakeFiles/cmTC_80b96.dir/objects1.rsp]
ignore line: [/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -v -Wl,--whole-archive CMakeFiles/cmTC_80b96.dir/objects.a -Wl,--no-whole-archive -o cmTC_80b96.exe -Wl,--out-implib,libcmTC_80b96.dll.a -Wl,--major-image-version,0,--minor-image-version,0 ]
ignore line: [clang version 9.0.0 (trunk)
]
ignore line: [Target: i686-w64-windows-gnu
]
ignore line: [Thread model: posix
]
ignore line: [InstalledDir: D:\mingw-llvm\bin
]
link line: [ D:/mingw-llvm/bin/ld.lld -m i386pe -Bdynamic -o cmTC_80b96.exe D:/mingw-llvm/i686-w64-mingw32/lib/crt2.o D:/mingw-llvm/i686-w64-mingw32/lib/crtbegin.o -LD:/mingw-llvm/i686-w64-mingw32/lib -LD:/mingw-llvm/lib -LD:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib --whole-archive CMakeFiles/cmTC_80b96.dir/objects.a --no-whole-archive --out-implib libcmTC_80b96.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a -lmoldname -lmingwex -lmsvcrt D:/mingw-llvm/i686-w64-mingw32/lib/crtend.o
]
arg [D:/mingw-llvm/bin/ld.lld] ==> ignore
arg [-m] ==> ignore
arg [i386pe] ==> ignore
arg [-Bdynamic] ==> ignore
arg [-o] ==> ignore
arg [cmTC_80b96.exe] ==> ignore
arg [D:/mingw-llvm/i686-w64-mingw32/lib/crt2.o] ==> ignore
arg [D:/mingw-llvm/i686-w64-mingw32/lib/crtbegin.o] ==> ignore
arg [-LD:/mingw-llvm/i686-w64-mingw32/lib] ==> dir [D:/mingw-llvm/i686-w64-mingw32/lib]
arg [-LD:/mingw-llvm/lib] ==> dir [D:/mingw-llvm/lib]
arg [-LD:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib] ==> dir [D:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib]
arg [--whole-archive] ==> ignore
arg [CMakeFiles/cmTC_80b96.dir/objects.a] ==> ignore
arg [--no-whole-archive] ==> ignore
arg [--out-implib] ==> ignore
arg [libcmTC_80b96.dll.a] ==> ignore
arg [--major-image-version] ==> ignore
arg [0] ==> ignore
arg [--minor-image-version] ==> ignore
arg [0] ==> ignore
arg [-lmingw32] ==> lib [mingw32]
arg [D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a] ==> lib [D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a]
arg [-lmoldname] ==> lib [moldname]
arg [-lmingwex] ==> lib [mingwex]
arg [-lmsvcrt] ==> lib [msvcrt]
arg [-lpthread] ==> lib [pthread]
arg [-ladvapi32] ==> lib [advapi32]
arg [-lshell32] ==> lib [shell32]
arg [-luser32] ==> lib [user32]
arg [-lkernel32] ==> lib [kernel32]
arg [-lmingw32] ==> lib [mingw32]
arg [D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a] ==> lib [D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a]
arg [-lmoldname] ==> lib [moldname]
arg [-lmingwex] ==> lib [mingwex]
arg [-lmsvcrt] ==> lib [msvcrt]
arg [D:/mingw-llvm/i686-w64-mingw32/lib/crtend.o] ==> ignore
remove lib [D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a]
remove lib [msvcrt]
remove lib [D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a]
remove lib [msvcrt]
collapse library dir [D:/mingw-llvm/i686-w64-mingw32/lib] ==> [D:/mingw-llvm/i686-w64-mingw32/lib]
collapse library dir [D:/mingw-llvm/lib] ==> [D:/mingw-llvm/lib]
collapse library dir [D:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib] ==> [D:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib]
implicit libs: [mingw32;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;mingw32;moldname;mingwex]
implicit dirs: [D:/mingw-llvm/i686-w64-mingw32/lib;D:/mingw-llvm/lib;D:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib]
implicit fwks: []

Detecting C [-std=c11] compiler features compiled with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_da0ec/fast
/usr/bin/make -f CMakeFiles/cmTC_da0ec.dir/build.make CMakeFiles/cmTC_da0ec.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_da0ec.dir/feature_tests.c.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -std=c11 -o CMakeFiles/cmTC_da0ec.dir/feature_tests.c.obj -c /D/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/feature_tests.c
Linking C executable cmTC_da0ec.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_da0ec.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_da0ec.dir/objects.a @CMakeFiles/cmTC_da0ec.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -Wl,--whole-archive CMakeFiles/cmTC_da0ec.dir/objects.a -Wl,--no-whole-archive -o cmTC_da0ec.exe -Wl,--out-implib,libcmTC_da0ec.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_da0ec.dir/linklibs.rsp
make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'

Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:1c_static_assert
Feature record: C_FEATURE:1c_variadic_macros

Detecting C [-std=c99] compiler features compiled with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_b463f/fast
/usr/bin/make -f CMakeFiles/cmTC_b463f.dir/build.make CMakeFiles/cmTC_b463f.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b463f.dir/feature_tests.c.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -std=c99 -o CMakeFiles/cmTC_b463f.dir/feature_tests.c.obj -c /D/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/feature_tests.c
Linking C executable cmTC_b463f.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_b463f.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_b463f.dir/objects.a @CMakeFiles/cmTC_b463f.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -Wl,--whole-archive CMakeFiles/cmTC_b463f.dir/objects.a -Wl,--no-whole-archive -o cmTC_b463f.exe -Wl,--out-implib,libcmTC_b463f.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_b463f.dir/linklibs.rsp
make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'

Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:1c_variadic_macros

Detecting C [-std=c90] compiler features compiled with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_15bd5/fast
/usr/bin/make -f CMakeFiles/cmTC_15bd5.dir/build.make CMakeFiles/cmTC_15bd5.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_15bd5.dir/feature_tests.c.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -std=c90 -o CMakeFiles/cmTC_15bd5.dir/feature_tests.c.obj -c /D/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/feature_tests.c
Linking C executable cmTC_15bd5.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_15bd5.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_15bd5.dir/objects.a @CMakeFiles/cmTC_15bd5.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -Wl,--whole-archive CMakeFiles/cmTC_15bd5.dir/objects.a -Wl,--no-whole-archive -o cmTC_15bd5.exe -Wl,--out-implib,libcmTC_15bd5.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_15bd5.dir/linklibs.rsp
make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'

Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:0c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:0c_variadic_macros

`

CMakeError.log:

`Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: D:/mingw-llvm/bin/i686-w64-mingw32-clang++.exe
Build flags: -Wno-dll-attribute-on-redeclaration;-O2;-I/d/ffbuild/llvm/llvm-mingw/libcxx/include
Id flags:

The output was:
1
lld: error: unable to find library -lc++
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Detecting CXX compiler ABI info failed to compile with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_48a15/fast
/usr/bin/make -f CMakeFiles/cmTC_48a15.dir/build.make CMakeFiles/cmTC_48a15.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_48a15.dir/CMakeCXXCompilerABI.cpp.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang++.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -v -o CMakeFiles/cmTC_48a15.dir/CMakeCXXCompilerABI.cpp.obj -c /C/CMake/share/cmake-3.14/Modules/CMakeCXXCompilerABI.cpp
clang version 9.0.0 (trunk)

Target: i686-w64-windows-gnu

Thread model: posix

InstalledDir: D:\mingw-llvm\bin

D:/mingw-llvm/bin/clang-9.exe -cc1 -triple i686-w64-windows-gnu -emit-obj -disable-free -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -v -coverage-notes-file D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_48a15.dir/CMakeCXXCompilerABI.cpp.gcno -resource-dir D:/mingw-llvm/lib/clang/9.0.0 -I D:/ffbuild/llvm/llvm-mingw/libcxx/include -internal-isystem D:/mingw-llvm/i686-w64-mingw32/include/c++/v1 -internal-isystem D:/mingw-llvm/include/c++/v1 -internal-isystem D:/mingw-llvm/lib/clang/9.0.0/include -internal-isystem D:/mingw-llvm/i686-w64-mingw32/include -internal-isystem D:/mingw-llvm/include -O2 -Wno-dll-attribute-on-redeclaration -fdeprecated-macro -fdebug-compilation-dir D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fsjlj-exceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o CMakeFiles/cmTC_48a15.dir/CMakeCXXCompilerABI.cpp.obj -x c++ C:/CMake/share/cmake-3.14/Modules/CMakeCXXCompilerABI.cpp -faddrsig

clang -cc1 version 9.0.0 based upon LLVM 9.0.0svn default target x86_64-w64-mingw32

ignoring nonexistent directory "D:\mingw-llvm\i686-w64-mingw32\include\c++\v1"

ignoring nonexistent directory "D:\mingw-llvm\include\c++\v1"

#include "..." search starts here:

#include <...> search starts here:

D:/ffbuild/llvm/llvm-mingw/libcxx/include

D:/mingw-llvm/lib/clang/9.0.0/include

D:/mingw-llvm/i686-w64-mingw32/include

D:/mingw-llvm/include

End of search list.

Linking CXX executable cmTC_48a15.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_48a15.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_48a15.dir/objects.a @CMakeFiles/cmTC_48a15.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang++.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -v -Wl,--whole-archive CMakeFiles/cmTC_48a15.dir/objects.a -Wl,--no-whole-archive -o cmTC_48a15.exe -Wl,--out-implib,libcmTC_48a15.dll.a -Wl,--major-image-version,0,--minor-image-version,0
clang version 9.0.0 (trunk)

Target: i686-w64-windows-gnu

Thread model: posix

InstalledDir: D:\mingw-llvm\bin

D:/mingw-llvm/bin/ld.lld -m i386pe -Bdynamic -o cmTC_48a15.exe D:/mingw-llvm/i686-w64-mingw32/lib/crt2.o D:/mingw-llvm/i686-w64-mingw32/lib/crtbegin.o -LD:/mingw-llvm/i686-w64-mingw32/lib -LD:/mingw-llvm/lib -LD:/mingw-llvm/i686-w64-mingw32/sys-root/mingw/lib --whole-archive CMakeFiles/cmTC_48a15.dir/objects.a --no-whole-archive --out-implib libcmTC_48a15.dll.a --major-image-version 0 --minor-image-version 0 -lc++ -lmingw32 D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 D:/mingw-llvm/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a -lmoldname -lmingwex -lmsvcrt D:/mingw-llvm/i686-w64-mingw32/lib/crtend.o

lld: error: unable to find library -lc++

clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [CMakeFiles/cmTC_48a15.dir/build.make:89: cmTC_48a15.exe] Error 1
make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_48a15/fast] Error 2

Detecting CXX [-std=c++2a] compiler features failed to compile with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_5539b/fast
/usr/bin/make -f CMakeFiles/cmTC_5539b.dir/build.make CMakeFiles/cmTC_5539b.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_5539b.dir/feature_tests.cxx.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang++.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -std=c++2a -o CMakeFiles/cmTC_5539b.dir/feature_tests.cxx.obj -c /D/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_5539b.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_5539b.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_5539b.dir/objects.a @CMakeFiles/cmTC_5539b.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang++.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -Wl,--whole-archive CMakeFiles/cmTC_5539b.dir/objects.a -Wl,--no-whole-archive -o cmTC_5539b.exe -Wl,--out-implib,libcmTC_5539b.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_5539b.dir/linklibs.rsp
lld: error: unable to find library -lc++

clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [CMakeFiles/cmTC_5539b.dir/build.make:90: cmTC_5539b.exe] Error 1
make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_5539b/fast] Error 2

Performing C++ SOURCE FILE Test LLVM_LIBSTDCXX_MIN failed with the following output:
Change Dir: D:/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp

Run Build Command(s):E:/msys64/usr/bin/make.exe cmTC_f5bf3/fast
/usr/bin/make -f CMakeFiles/cmTC_f5bf3.dir/build.make CMakeFiles/cmTC_f5bf3.dir/build
make[1]: Entering directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f5bf3.dir/src.cxx.obj

/D/mingw-llvm/bin/i686-w64-mingw32-clang++.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -DLLVM_LIBSTDCXX_MIN -std=c++0x -o CMakeFiles/cmTC_f5bf3.dir/src.cxx.obj -c /D/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTC_f5bf3.exe

/C/CMake/bin/cmake.exe -E remove -f CMakeFiles/cmTC_f5bf3.dir/objects.a
/D/mingw-llvm/bin/llvm-ar cr CMakeFiles/cmTC_f5bf3.dir/objects.a @CMakeFiles/cmTC_f5bf3.dir/objects1.rsp
/D/mingw-llvm/bin/i686-w64-mingw32-clang++.exe -Wno-dll-attribute-on-redeclaration -O2 -I/d/ffbuild/llvm/llvm-mingw/libcxx/include -DLLVM_LIBSTDCXX_MIN -std=c++0x -Wl,--whole-archive CMakeFiles/cmTC_f5bf3.dir/objects.a -Wl,--no-whole-archive -o cmTC_f5bf3.exe -Wl,--out-implib,libcmTC_f5bf3.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_f5bf3.dir/linklibs.rsp
lld: error: unable to find library -lc++

clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [CMakeFiles/cmTC_f5bf3.dir/build.make:90: cmTC_f5bf3.exe] Error 1
make[1]: Leaving directory '/d/ffbuild/llvm/llvm-mingw/libunwind/build-i686-static/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_f5bf3/fast] Error 2

Source file was:

#include
#if defined(GLIBCXX)
#if GLIBCXX < 20130322
#error Unsupported libstdc++ version
#endif
#endif
#if defined(GLIBCXX)
extern const char _ZNKSt17bad_function_call4whatEv[];
const char *chk = _ZNKSt17bad_function_call4whatEv;
#else
const char *chk = "";
#endif
int main() { ++chk; return 0; }

`

Seemingly, clang cannot find libc++, even when building libc++ itself. What shoul I do now?

Note: Why we not building libunwind always static and link it into libc++ shared?

Cannot build dbus with clang

Dbus 1.13.12, building with autotools. It's compiled with gcc successfully, but with clang there are lots of undefined reference errors.

 CXX      dbus-init-win.lo
  CC       dbus-spawn-win.lo
  CC       dbus-pollable-set.lo
  CC       dbus-pollable-set-poll.lo
  CC       dbus-string-util.lo
  CC       dbus-sysdeps-util.lo
  CXXLD    libdbus-init-win.la
  CCLD     libdbus-1.la

*** Warning: linker path does not have real file for library -lws2_32.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libws2_32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /d/mingw-llvm/x86_64-w64-mingw32/bin/libc++.dll

*** Warning: linker path does not have real file for library -liphlpapi.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libiphlpapi and none of the candidates passed a file format test
*** using a file magic. Last file checked: /d/mingw-llvm/x86_64-w64-mingw32/bin/libc++.dll

*** Warning: linker path does not have real file for library -ldbghelp.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libdbghelp and none of the candidates passed a file format test
*** using a file magic. Last file checked: /d/mingw-llvm/x86_64-w64-mingw32/bin/libc++.dll
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
  CCLD     libdbus-internal.la

*** Warning: This system cannot link to static lib archive libdbus-1.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
make[3]: Leaving directory '/d/evince/dbus-1.13.12/dbus'
make[2]: Leaving directory '/d/evince/dbus-1.13.12/dbus'
Making all in bus
make[2]: Entering directory '/d/evince/dbus-1.13.12/bus'
  CC       main.o
  CC       activation.lo
  CC       apparmor.lo
  CC       audit.lo
  CC       bus.lo
  CC       config-loader-expat.lo
  CC       config-parser.lo
  CC       config-parser-common.lo
  CC       connection.lo
  CC       containers.lo
  CC       desktop-file.lo
  CC       dir-watch-default.lo
  CC       dispatch.lo
  CC       driver.lo
  CC       expirelist.lo
  CC       policy.lo
  CC       selinux.lo
  CC       services.lo
  CC       signals.lo
  CC       stats.lo
  CC       test.lo
  CC       utils.lo
  CCLD     libdbus-daemon-internal.la

*** Warning: This system cannot link to static lib archive ../dbus/libdbus-1.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This system cannot link to static lib archive /d/evince/dbus-1.13.12/dbus/libdbus-1.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
  CCLD     dbus-daemon.exe
lld-link: error: undefined symbol: __imp__dbus_string_init
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(introspect)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(process_config_every_time)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_log)
>>> referenced 36 more times

lld-link: error: undefined symbol: __imp__dbus_string_append
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(process_config_every_time)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_log)
>>> referenced 37 more times

lld-link: error: undefined symbol: __imp__dbus_pipe_invalidate
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)

lld-link: error: undefined symbol: __imp__dbus_pipe_init_stdout
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)

lld-link: error: undefined symbol: __imp__dbus_string_parse_int
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_content)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(append_rule_from_element)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(append_rule_from_element)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(append_rule_from_element)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(append_rule_from_element)

lld-link: error: undefined symbol: __imp__dbus_pipe_init
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)

lld-link: error: undefined symbol: __imp__dbus_string_free
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(introspect)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced 71 more times

lld-link: error: undefined symbol: __imp_dbus_error_init
>>> referenced by main.o:(main)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_check_security_policy)
>>> referenced by libdbus-daemon-internal.a(driver.o):(bus_driver_handle_hello)
>>> referenced by libdbus-daemon-internal.a(driver.o):(bus_driver_handle_add_match)
>>> referenced by libdbus-daemon-internal.a(dbus-sysdeps-util-win.o):(_dbus_win_stderr_win_error)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connection_disconnected)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connections_setup_connection)
>>> referenced by libdbus-daemon-internal.a(services.o):(bus_registry_acquire_service)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_content)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(include_file)
>>> referenced 11 more times

lld-link: error: undefined symbol: __imp__dbus_warn
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(main)
>>> referenced by main.o:(introspect)
>>> referenced by libdbus-daemon-internal.a(dbus-mainloop.o):(_dbus_loop_remove_watch)
>>> referenced by libdbus-daemon-internal.a(dbus-mainloop.o):(_dbus_loop_remove_timeout)
>>> referenced by libdbus-daemon-internal.a(dbus-mainloop.o):(_dbus_loop_iterate)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_start_element)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_start_element)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(append_rule_from_element)
>>> referenced 1 more times

lld-link: error: undefined symbol: __imp_dbus_error_free
>>> referenced by main.o:(main)
>>> referenced by libdbus-daemon-internal.a(dbus-sysdeps-util-win.o):(_dbus_win_stderr_win_error)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connection_disconnected)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connections_setup_connection)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_transaction_send_from_driver)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_start_element)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_content)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(bus_config_parser_content)
>>> referenced by libdbus-daemon-internal.a(config-parser.o):(include_file)
>>> referenced by libdbus-daemon-internal.a(activation.o):(bus_activation_reload)
>>> referenced 15 more times

lld-link: error: undefined symbol: __imp_dbus_set_error
>>> referenced by libdbus-daemon-internal.a(apparmor.o):(bus_apparmor_set_mode_from_config)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_check_security_policy)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_check_security_policy)
>>> referenced by libdbus-daemon-internal.a(bus.o):(complain_about_message)
>>> referenced by libdbus-daemon-internal.a(driver.o):(bus_driver_get_conn_helper)
>>> referenced by libdbus-daemon-internal.a(driver.o):(bus_driver_handle_message)
>>> referenced 89 more times

lld-link: error: undefined symbol: __imp_dbus_connection_set_max_received_size
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_add_incoming_connection)

lld-link: error: undefined symbol: __imp_dbus_connection_set_max_message_size
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_add_incoming_connection)

lld-link: error: undefined symbol: __imp_dbus_connection_set_max_received_unix_fds
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_add_incoming_connection)

lld-link: error: undefined symbol: __imp_dbus_connection_set_max_message_unix_fds
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_add_incoming_connection)

lld-link: error: undefined symbol: __imp_dbus_connection_set_allow_anonymous
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_add_incoming_connection)

lld-link: error: undefined symbol: __imp_dbus_connection_close
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_add_incoming_connection)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connections_unref)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connections_unref)
>>> referenced by libdbus-daemon-internal.a(connection.o):(pending_unix_fds_timeout_cb)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connections_expire_incomplete)
>>> referenced by libdbus-daemon-internal.a(dispatch.o):(bus_dispatch_message_filter)
>>> referenced by libdbus-daemon-internal.a(dispatch.o):(bus_dispatch_message_filter)

lld-link: error: undefined symbol: __imp_dbus_malloc0
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_setup_server)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_new)
>>> referenced by libdbus-daemon-internal.a(dbus-mainloop.o):(_dbus_loop_new)
>>> referenced by libdbus-daemon-internal.a(dbus-mainloop.o):(_dbus_loop_add_watch)
>>> referenced by libdbus-daemon-internal.a(dbus-sysdeps-util-win.o):(_dbus_directory_open)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connection_disconnected)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_transaction_new)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_connections_new)
>>> referenced by libdbus-daemon-internal.a(connection.o):(bus_pending_reply_expired)
>>> referenced 56 more times

lld-link: error: undefined symbol: __imp_dbus_server_set_data
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_setup_server)

lld-link: error: undefined symbol: __imp_dbus_server_set_watch_functions
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_setup_server)
>>> referenced by libdbus-daemon-internal.a(bus.o):(bus_context_shutdown)

lld-link: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:903: dbus-daemon.exe] Error 1
make[2]: Leaving directory '/d/evince/dbus-1.13.12/bus'
make[1]: *** [Makefile:693: all-recursive] Error 1
make[1]: Leaving directory '/d/evince/dbus-1.13.12'
make: *** [Makefile:560: all] Error 2

windres-wrapper not work with space between -D and define value

cmake gen windres command

E:\llvm8\bin\windres.exe  -O coff -Domp_EXPORTS -IL:/llvm8build/openmp/build-x86_64-clang/runtime/src -IE:/Source/git/llvm-project/openmp/runtime/src -IE:/Source/git/llvm-project/openmp/runtime/src/i18n -IE:/Source/git/llvm-project/openmp/runtime/src/include/50 -IE:/Source/git/llvm-project/openmp/runtime/src/thirdparty/ittnotify -D _CRT_SECURE_NO_WARNINGS -D _CRT_SECURE_NO_DEPRECATE -D _WINDOWS -D _WINNT -D _WIN32_WINNT=0x0501 -D _USRDLL L:/llvm8build/openmp/build-x86_64-clang/runtime/src/libomp.rc runtime/src/CMakeFiles/omp.dir/libomp.rc.obj

get following error windres: error: rip: `_WINDOWS'
If I manual remove space between -D and define value it works normally

Getting Error When Using "std::filesystem" with Clang++-9 Cross Compile From Ubuntu 16.04

Hello devs,

I am currently getting an error when compiling an executable for x86_64-w64-mingw32 that uses the std::filesystem library, using Clang++-9. Here is the sample code I am trying to compile:

#include <iostream>
#include <filesystem>
                                                                                                                                                                                                                           
namespace fs = std::filesystem;                                                                                                                                                                                                                 

int main() {
    std::cout << "Current path is " << fs::current_path() << '\n';
}

The linker is complaining about missing symbols. Here's the output I am getting from the linker:

lld-link: error: undefined symbol: _ZNSt3__14__fs10filesystem14__current_pathEPNS_10error_codeE
>>> referenced by /tmp/test-689beb.o:(_ZNSt3__14__fs10filesystem12current_pathEv)
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

As I remember, std::filesystem is now part of G++-9/Clang++9, without relying on libstdc++fs to be linked against to.

bad codegen / problem with exceptions

hi,
following my comment here: #8 (comment)

I tried to make the smallest repro I could for the problem I have ; here it is :
repro-except.zip

The build.sh script will build a code and launch the program in the case which causes the problem (segfault while unwinding). There are a bunch of files but the actual stack trace is very short and only spans two files (main.cpp and parser/sourcereader.cpp):

Thread 1 hit Catchpoint 1 (exception thrown), 0x0000000140010a90 in __cxa_throw ()
(gdb) bt
#0  0x0000000140010a90 in __cxa_throw ()
#1  0x000000014000657d in SourceReader::parseLocal (this=<optimized out>,
    fname=<optimized out>) at C:/dev/repro-except/parser\sourcereader.cpp:93
#2  0x0000000140006235 in SourceReader::parseFile (this=<optimized out>,
    fname=<optimized out>) at C:/dev/repro-except/parser\sourcereader.cpp:84
#3  0x000000014000c4fa in compileFaustFactory (argc=<optimized out>,
    argv=0x524250, name=<optimized out>, dsp_content=<optimized out>,
    error_msg=..., generate=<optimized out>)
    at C:/dev/repro-except\main.cpp:21
#4  0x000000014000c668 in main (argc=<optimized out>,
    argv=0x140012260 <typeinfo for faustexception>)
    at C:/dev/repro-except\main.cpp:33

The smallest change to the code path, for instance changing parseLocal from

Tree SourceReader::parseLocal(const char* fname)
{
    stringstream error;

    throw faustexception("blah");
    return gGlobal->gResult;
}

to

Tree SourceReader::parseLocal(const char* fname)
{
    throw faustexception("blah");
    return gGlobal->gResult;
}

or removing the untaken if branch in sourcereader.cpp:79, makes the problem go away.

Also, it works at -O1, it's only starting from -O2 that it fails.

The same code works fine with clang on both linux and macos.

Crash when using `std::regex_constants::icase` under wine

Hi,

I have a systematic crash when I try to use std::regex with the case insensitive flag.
Here's a minimal sample:

#include <regex>
#include <iostream>

int main()
{
        std::regex re{
            "\\bremoveme\\b",
            std::regex_constants::icase | std::regex_constants::ECMAScript,
        };

        std::string input = "Hello world removeme";
        auto res = std::regex_replace( input, re, "" );
        std::cout << "in:\t" << input << std::endl;
        std::cout << "out:\t" << res << std::endl;
}

Just instanciating the regex is enough to trigger the crash, but removing std::regex_constants::icase will make the crash go away

Here's the wine output:

wine: Unhandled page fault on read access to 0x000000e5 at address 0x14003b98b (thread 0036), starting debugger...
0038:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0038:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
Unhandled exception: page fault on read access to 0x000000e5 in 64-bit code (0x000000014003b98b).
0038:fixme:dbghelp:elf_search_auxv can't find symbol in module
Register dump:
 rip:000000014003b98b rsp:000000000023f6e0 rbp:000000000023fc90 eflags:00010293 (  R- --  I S -A- -C)
 rax:0000000000000001 rbx:0000000000000001 rcx:0000000000000072 rdx:0000000000243372
 rsi:0000000000243372 rdi:000000000000000d  r8:0000000000242020  r9:0000000000243280 r10:0000000000243310
 r11:0000000000243348 r12:0000000000000000 r13:0000000000000000 r14:0000000000241fc0 r15:0000000000000001
Stack dump:
0x000000000023f6e0:  0000000000ffffff ffffffff00ffffff
0x000000000023f6f0:  0000000000000000 00007f43489c6547
0x000000000023f700:  0000000000000000 0000000000000000
0x000000000023f710:  0000000000010610 000000014000daf9
0x000000000023f720:  0000000000000000 0000000000000000
0x000000000023f730:  0000000000000000 0000000000000000
0x000000000023f740:  00000001400ade18 7200000000243280
0x000000000023f750:  00000001400d0350 000000014000d97f
0x000000000023f760:  0000000000202020 0000000000000000
0x000000000023f770:  0000000000000000 0000000000000000
0x000000000023f780:  0000000000243360 720000000023fca0
0x000000000023f790:  000000000023fca0 000000014000d7fd
Backtrace:
=>0 0x000000014003b98b in a (+0x3b98b) (0x000000000023fc90)
  1 0x000000014000daf9 in a (+0xdaf8) (0x000000000023fc90)
  2 0x000000014000d97f in a (+0xd97e) (0x000000000023fc90)
  3 0x000000014000d7fd in a (+0xd7fc) (0x000000000023fc90)
  4 0x000000014000d1e9 in a (+0xd1e8) (0x000000000023fc90)
  5 0x000000014000c3e3 in a (+0xc3e2) (0x000000000023fc90)
  6 0x0000000140004508 in a (+0x4507) (0x000000000023fc90)
  7 0x0000000140003d1b in a (+0x3d1a) (0x000000000023fc90)
  8 0x0000000140003961 in a (+0x3960) (0x000000000023fc90)
  9 0x0000000140002198 in a (+0x2197) (0x000000000023fc90)
  10 0x0000000140001e26 in a (+0x1e25) (0x000000000023fc90)
  11 0x0000000140001747 in a (+0x1746) (0x000000000023fc90)
  12 0x00000001400014d4 in a (+0x14d3) (0x000000000023fc90)
  13 0x00000001400013fa in a (+0x13f9) (0x000000000023ffd0)
  14 0x000000014000145b in a (+0x145a) (0x000000000023ffd0)
  15 0x000000007b481921 PowerClearRequest+0x1580() in kernel32 (0x000000000023ffd0)
0x000000014003b98b: movzwl      (%rax,%rcx,2),%eax
Modules:
Module  Address                                 Debug info      Name (39 modules)
ELF             7b400000-        7b832000       Dwarf           kernel32<elf>
  \-PE          7b420000-        7b832000       \               kernel32
ELF             7bc00000-        7bd2e000       Deferred        ntdll<elf>
  \-PE          7bc20000-        7bd2e000       \               ntdll
ELF             7c000000-        7c005000       Deferred        <wine-loader>
PE             140000000-       140114000       Dwarf           a
ELF         7f43487ef000-    7f434881f000       Deferred        libtinfo.so.6
ELF         7f434881f000-    7f4348849000       Deferred        libncurses.so.6
ELF         7f4348849000-    7f434885f000       Deferred        api-ms-win-crt-environment-l1-1-0<elf>
  \-PE      7f4348850000-    7f434885f000       \               api-ms-win-crt-environment-l1-1-0
ELF         7f434885f000-    7f434887a000       Deferred        api-ms-win-crt-math-l1-1-0<elf>
  \-PE      7f4348870000-    7f434887a000       \               api-ms-win-crt-math-l1-1-0
ELF         7f434887a000-    7f4348892000       Deferred        api-ms-win-crt-convert-l1-1-0<elf>
  \-PE      7f4348880000-    7f4348892000       \               api-ms-win-crt-convert-l1-1-0
ELF         7f4348892000-    7f43488ab000       Deferred        api-ms-win-crt-multibyte-l1-1-0<elf>
  \-PE      7f43488a0000-    7f43488ab000       \               api-ms-win-crt-multibyte-l1-1-0
ELF         7f43488ab000-    7f43488c1000       Deferred        api-ms-win-crt-time-l1-1-0<elf>
  \-PE      7f43488b0000-    7f43488c1000       \               api-ms-win-crt-time-l1-1-0
ELF         7f43488c1000-    7f43488d7000       Deferred        api-ms-win-crt-locale-l1-1-0<elf>
  \-PE      7f43488d0000-    7f43488d7000       \               api-ms-win-crt-locale-l1-1-0
ELF         7f43488d7000-    7f43488ef000       Deferred        api-ms-win-crt-string-l1-1-0<elf>
  \-PE      7f43488e0000-    7f43488ef000       \               api-ms-win-crt-string-l1-1-0
ELF         7f43488ef000-    7f4348907000       Deferred        api-ms-win-crt-stdio-l1-1-0<elf>
  \-PE      7f4348900000-    7f4348907000       \               api-ms-win-crt-stdio-l1-1-0
ELF         7f4348907000-    7f434891e000       Deferred        api-ms-win-crt-runtime-l1-1-0<elf>
  \-PE      7f4348910000-    7f434891e000       \               api-ms-win-crt-runtime-l1-1-0
ELF         7f434891e000-    7f4348954000       Deferred        api-ms-win-crt-private-l1-1-0<elf>
  \-PE      7f4348930000-    7f4348954000       \               api-ms-win-crt-private-l1-1-0
ELF         7f4348954000-    7f4348a80000       Deferred        ucrtbase<elf>
  \-PE      7f4348980000-    7f4348a80000       \               ucrtbase
ELF         7f4348b80000-    7f4348b96000       Deferred        api-ms-win-crt-heap-l1-1-0<elf>
  \-PE      7f4348b90000-    7f4348b96000       \               api-ms-win-crt-heap-l1-1-0
ELF         7f4348c96000-    7f4348caa000       Deferred        libnss_files.so.2
ELF         7f434918f000-    7f43491a9000       Deferred        libgcc_s.so.1
ELF         7f43491a9000-    7f43492ee000       Deferred        libm.so.6
ELF         7f43492f0000-    7f43492f5000       Deferred        libdl.so.2
ELF         7f43492f5000-    7f43494b5000       Deferred        libc.so.6
ELF         7f43494b5000-    7f43494d6000       Deferred        libpthread.so.0
ELF         7f4349689000-    7f43496b3000       Deferred        ld-linux-x86-64.so.2
Threads:
process  tid      prio (all id:s are in hex)
0000000e services.exe
        00000031    0
        0000002c    0
        00000028    0
        00000025    0
        0000001f    0
        00000019    0
        00000018    0
        00000017    0
        00000010    0
        0000000f    0
00000011 explorer.exe
        00000016    0
        00000015    0
        00000012    0
00000013 mscorsvw.exe
        0000001c    0
        0000001b    0
        0000001a    0
        00000014    0
0000001d mscorsvw.exe
        00000022    0
        00000021    0
        00000020    0
        0000001e    0
00000023 winedevice.exe
        00000027    0
        00000026    0
        00000024    0
0000002a plugplay.exe
        0000002e    0
        0000002d    0
        0000002b    0
0000002f winedevice.exe
        00000034    0
        00000033    0
        00000032    0
        00000030    0
00000035 (D) Z:\tmp\a.exe
        00000036    0 <==
System information:
    Wine build: wine-4.0.2 (Debian 4.0.2-1)
    Platform: x86_64
    Version: Windows 5.1 (0)
    Host system: Linux
    Host version: 4.19.0-6-amd64

For what it's worth, enclosing the entire test in a try {} catch ( ... ) {} still crashes, but the output is much more concise:

terminating with uncaught foreign exception

abnormal program termination

Here's the compile line, even though it's nothing fancy:

videolan@090b49437f4a:/tmp$ x86_64-w64-mingw32-g++ test.cpp -static
videolan@090b49437f4a:/tmp$ x86_64-w64-mingw32-g++ -v
clang version 9.0.0 (https://github.com/llvm/llvm-project.git 0399d5a9682b3cef71c653373e38890c63c4c365)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: /opt/llvm-mingw/bin

I'm not entirely sure if this is the correct place to report this, but I'll gladly take any input on what can be done to fix this!

Thanks,

Support using system clang

I'd be nice to have an option to use the clang and LLVM tools provided by my distro with this toolchain. Do you think that'd be feasible?

[msys2 build] LLVM "install" step fails

With errors such as

ln: impossible de créer le lien symbolique 'i686-w64-mingw32-ar.exe': No such file or directory
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-ranlib.exe': No such file or directory
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-nm.exe': No such file or directory
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-strings.exe': No such file or directory
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-ar.exe': No such file or directory
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-ranlib.exe': No such file or directory
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-nm.exe': No such file or directory
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-strings.exe': No such file or directory
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-ar.exe': No such file or directory
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-ranlib.exe': No such file or directory
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-nm.exe': No such file or directory
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-strings.exe': No such file or directory
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-ar.exe': No such file or directory
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-ranlib.exe': No such file or directory
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-nm.exe': No such file or directory
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-strings.exe': No such file or directory
mv: impossible d'évaluer 'clang.exe': No such file or directory

(the errors say "unable to create the symbolic link 'whatever.exe'"). The files exist in my /mingw64/bin.

A lot of files maange to be installed, though.

Collaboration opertunity with Nixpkgs/NixOS

Nixpkgs supports cross compilation to many targets, and I've been trying to add Windows to the list: NixOS/nixpkgs#72366

In the process I've been some patches to LLVM you may be interested in:

Also, rather than use MinGW headers/libs, I've automated the downloading of various Windows SDK / Visual Studio components, through the JSON manifest Microsoft makes available.

Next, I'm trying to get CMake to not get confused with this combination (it was fine until I switched from lld-link to ld.lld, hmm).

List build requirements.

I have yet to get llvm-mingw to build but I've noticed that the git-svn extension was required. A list of dependencies would be nice.

Consider using release tarballs to avoid relying on versioning software.

no symbol export when dllexport class does not have key function

I'm experiencing this issue when compiling qt, some class defined whole class in header, e.g.(qabstractlayoutstyleinfo_p.h,qcanbusfactory.h). When build with clang will link failed because no symbols were exported.
Here is a sample test.
export.h

#ifndef EXPORT_H
#define EXPORT_H

#include <iostream>

#ifdef BUILD_SHARED
#define EXPORT __attribute__((dllexport))
#else
#define EXPORT __attribute__((dllimport))
#endif

class EXPORT Test {
 public:
  virtual ~Test() {};
  virtual void test() { std::cout << "Test::test()" << std::endl; };
};

#endif  // EXPORT_H

export.cpp

#include "export.h"

compile export.cpp with follow command

clang++ -c -DBUILD_SHARED export.cpp -o export.o

and run

llvm-nm export.o

show

00000000 a @feat.00

no symbol exported.
if build use g++

g++ -c -DBUILD_SHARED export.cpp -o exportgcc.o

and run

llvm-nm exportgcc.o

show

00000040 t __GLOBAL__sub_I_export.cpp
00000012 t __Z41__static_initialization_and_destruction_0ii
00000000 T __ZN4Test4testEv
00000000 T __ZN4TestD0Ev
00000000 T __ZN4TestD1Ev
         U __ZNSolsEPFRSoS_E
         U __ZNSt8ios_base4InitC1Ev
         U __ZNSt8ios_base4InitD1Ev
         U __ZSt4cout
         U __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
00000000 r __ZStL19piecewise_construct
00000000 b __ZStL8__ioinit
         U __ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
00000000 R __ZTI4Test
00000000 R __ZTS4Test
00000000 R __ZTV4Test
         U __ZTVN10__cxxabiv117__class_type_infoE
         U __ZdlPvj
00000000 t ___tcf_0
         U _atexit

shared link llvm (this is a discussion not a issue)

Current trunk version lld not support -Wl,--version-script on mingw target but support -Wl,--export-all-symbols, after modify llvm-shlib's (CmakeLists.txt), I can build shared version LLVM.dll.
Current build linked static llvm lib, will cost a lot of space(I tried build latest trunk and full install without strip the bin directory cost 1733 MB). then I tried build with LLVM_LINK_LLVM_DYLIB=ON, have 4 file link failed(failed.log), and can fix by modify CMakeLists.txt, after fix and install the result bin directory only 503 MB.
I tried use shared link version toolchain build some example code, can generate executables and run normally, but the ld.lld hang on exit. but a strange phenomenon is that when I use the Sysinternals process explorer to view ld.lld threads, the ld.lld will automatically quit.
Has anyone tried shared link llvm?

Build instructions

Had a rather hard time finding out how to build this myself, i suggest a small tutorial on how to go about it, whats needed (build chain) what must be avoided (compilers on path) for all the different build tools (docker Msys2 etc.).

Also there seems to be one small bug when doing ./build-all.sh $someprefix,
the wrapper script tries to create a symlink to a non existing widl.exe which is build later.

Some symbols generated by the toolchain cannot be found by GetProcAddress

Here is my case :

lib.cpp:

class __declspec(dllexport) foo {
foo();
virtual ~foo();
};
foo::foo() { }
foo::~foo() { }

app.cpp

#include <windows.h>
#include <cassert>

int main() {
  auto module = LoadLibrary("foo.dll");
  assert(module);
  auto addr = GetProcAddress(module, "_ZTI3foo"); // e.g. typeinfo for foo
  assert(addr != 0);
}

even though nm shows that the symbol is there.
Would you have any idea of what causes this behaviour and what would be ways to get the address of this symbol ? The only difference I can see is that the symbol is marked as being in the read-only section by nm. I could not find a way to put it in the "standard", text section where I guess GetProcAddress may be looking.

does mingw target support lto link?

I tried to do lto link, but I got the following error clang++: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker. Then I tried clang-cl driver with lto, it works fine. does mingw target support lto link?

OpenSSL compilation

Seems the windres wrapper is missing something when compiling openssl with clang

windres  --target=pe-x86-64  -o apps/openssl.res.o apps/openssl.rc
D:\msys64\mingw64\bin\pe-x86-64-clang: No such file or directory

Simple program parsing doubles segfaults

Given :

#include <iostream>

int main() {
    double d;
    try {
    std::cin >> d;
    std::cout << "\n got: " << d << "\n";
    } catch(...) { 
    }
}

and

clang++ -O0 -g test.cpp

I get

$ ./a.exe                                                                                                                                                              
123                                                                                                                                                                    
terminating with uncaught foreign exception

when running under gdb it gives the following :

#0  0x000000000097a44a in std::__1::__num_put::__widen_and_group_float(char*, char*, char*, char*, char*&, char*&, std::__1::locale const&) ()                      from C:\score-sdk\toolchain\bin\libc++.dll                                                                                                                          
#1  0x0000000000940dbf in std::__1::num_put > >::do_put(std::__1::ostreambuf_iterator :__1::char_traits >, std::__1::ios_base&, char, double) const ()                                                                                                    from C:\score-sdk\toolchain\bin\libc++.dll                                                                                                                          
#2  0x000000000095d7cb in std::__1::basic_ostream >::operator<<(double) () from C:\score-sdk\toolchain\bin\libc++.dll                #3  0x0000000140001509 in main () at test.cpp:7

(this is with the toolchain that you sent me the other day)

I suppose there is the possibility of a bug in libc++ but this algorithm (__widen_and_group_float) has not been changed very often : https://github.com/llvm-mirror/libcxx/commits/23e4ddc020b8515c672e727972382c0b13d8314b/include/locale

note that outside of this I was able to build & run fairly complex Qt/C++17-based software, so it's really an isolated problem. I wonder if there could be a link with locale handling though, because this always causes lots and lots of problems in my experience.

Compiler-RT library name issue

Compiler-RT builds successfully but resulting library name does have filename extension as "lib", instead of "a". So at the end of script, process fails.

Using MSYS2 64 bit environment for running scripts.

clang_rt obscured

I was eventually informed that clang_rt is the correct replacement for libgcc but it is not included with all the rest of the libraries. Instead I found using -v while linking that it's located somewhere else entirely. I would recommend moving it so that it can be included via -lclang_rt like the other libraries.

Also, I think it's worth making a FAQ or wiki so that others don't find this pitfall.

Update due to LLVM moving to github

Hi there,

I have two suggestions based on the fact that LLVM is migrating to Github:

  1. The new monolithic repo is https://github.com/llvm/llvm-project.git. That contains all LLVM tools and projects in a single repository. I suggest cloning that instead of llvm-mirror.
  2. in build-llvm.sh, clang and lld are cloned into llvm/tools for LLVM's cmake build to pick them up. Official documentation says, they should be parallel to llvm and projects enabled via LLVM_ENABLE_PROJECTS variable. E.g. using the new monolithic repo, it would simply be:
    -DLLVM_ENABLE_PROJECTS="clang;lld" to compile clang and lld.

HEAD LLD is broken on LTO + GNU (mingw32) ABI

I'm extremely sorry reporting the problem here, it's because I suspect it would, perhaps, never be addressed if reported at LLVM Bugzilla.

If I replace lld.ld.exe from your llvm-mingw 9.0 distro with fresh HEAD lld and build the following hello.cpp:

#include <iostream>

int main ()
{
    std::cout << "Hello, world" << std::endl;
    return 0;
}

with x86_64-w64-mingw32-clang++.exe -O3 -flto -fuse-ld=lld hello.cpp -o hello.exe

I get:

lld-link: error: undefined symbol: std::__1::cout
>>> referenced by hello.cpp
>>>               C:\Users\xxxx\AppData\Local\Temp\hello-d0c197.o

lld-link: error: undefined symbol: std::__1::ctype<char>::id
>>> referenced by hello.cpp
>>>               C:\Users\xxxx\AppData\Local\Temp\hello-d0c197.o
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

The are no problems with your stock lld 9.0, there are no problems with HEAD lld when using msvc ABI, and there are no problems with any lld if no LTO is used. The only failing configuration is HEAD lld + LTO + GNU ABI (and linking against libc++.dll.a import library).

I suspect the problem is caused by llvm/llvm-project@51dcb29, but can't quite figure what's going on here.

AFAIUI, linker fails on entries if import library contains __imp_-decorated symbol only, which happen to be those exported as data (or they aren't? should data items be exported using runtime pseudo relocs? I don't understand how all this machinery works, sorry).

std::cout print double value crash

#include <cstdio>
#include <iostream>

int main() {
  double test = 1.0 / 3.0;
  std::printf("%f\n", test);
  std::cout << test << std::endl;
  return 0;
}

build with clang++ double.cpp , run with ./a.exe output

0.333333
terminating with uncaught foreign exception

gdb back trace

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000180079b4a in std::__1::__num_put<char>::__widen_and_group_float(char*, char*, char*, char*, char*&, char*&, std::__1::locale const&) ()
   from E:\llvm8\bin\libc++.dll
(gdb) bt
#0  0x0000000180079b4a in std::__1::__num_put<char>::__widen_and_group_float(char*, char*, char*, char*, char*&, char*&, std::__1::locale const&) ()
   from E:\llvm8\bin\libc++.dll
#1  0x000000018003f48f in std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, double) const ()
   from E:\llvm8\bin\libc++.dll
#2  0x000000018005cc7b in std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(double) () from E:\llvm8\bin\libc++.dll
#3  0x0000000140001501 in main ()

It seems like libc++'s bug, I tried both llvm 7 release and llvm 8 trunk, have same issue.

run with debug version libc++, get crash location at isdigit_l (locale#L1205 ) called

Update
It is ucrt's bug

#include <stdio.h>
#include <locale.h>
#include <ctype.h>

int main(int argc, char const *argv[])
{
    _locale_t loc = _create_locale(LC_ALL, "C");
    int ret = _isdigit_l('3', loc);
    printf ("%d\n", ret);
    
    return 0;
}

this test link with libmsvcrt-os.a will working correctly. bug link with libmsvcrt.a will crash
I think _ischartype_l defined wrong with ucrt version.
mingw define is

#define _ischartype_l(_Char,_Flag,_Locale) (((_Locale)!=NULL && (((_locale_t)(_Locale))->locinfo->mb_cur_max) > 1) ? _isctype_l(_Char,(_Flag),_Locale) : _chvalidchk_l(_Char,_Flag,_Locale))

mb_cur_max in threadlocaleinfostruct

typedef struct threadlocaleinfostruct {
  int refcount;
  unsigned int lc_codepage;
  unsigned int lc_collate_cp;
  unsigned long lc_handle[6];
  LC_ID lc_id[6];
  struct {
    char *locale;
    wchar_t *wlocale;
    int *refcount;
    int *wrefcount;
  } lc_category[6];
  int lc_clike;
  int mb_cur_max;
  int *lconv_intl_refcount;
  int *lconv_num_refcount;
  int *lconv_mon_refcount;
  struct lconv *lconv;
  int *ctype1_refcount;
  unsigned short *ctype1;
  const unsigned short *pctype;
  const unsigned char *pclmap;
  const unsigned char *pcumap;
  struct __lc_time_data *lc_time_curr;
} threadlocinfo;

win10 sdk 10.0.16299.0 define is

    __inline int __CRTDECL _ischartype_l(
        _In_     int       const _C,
        _In_     int       const _Mask,
        _In_opt_ _locale_t const _Locale
        )
    {
        if (_Locale && __acrt_get_locale_data_prefix(_Locale)->_locale_mb_cur_max > 1)
        {
            return _isctype_l(_C, _Mask, _Locale);
        }

        return _chvalidchk_l(_C, _Mask, _Locale);
    }

_locale_mb_cur_max in __crt_locale_data_public

typedef struct __crt_locale_data_public
{
      unsigned short const* _locale_pctype;
    _Field_range_(1, 2) int _locale_mb_cur_max;
               unsigned int _locale_lc_codepage;
} __crt_locale_data_public;

_locale_t struct may be changed in ucrt.

Build fails with Clang

Hello.

I am trying to build the project using Clang/LLD as a host compiler on Linux.

Everything seems to go well until widl tool is built from mingw-w64-tools/widl.

It fails with:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... i686-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for widl includedir... $(includedir)/../$(target)/include
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/media/joao/dev/llvm-mingw/mingw-w64/mingw-w64-tools/widl/build-i686':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log:

configure:3174: checking for gcc
configure:3190: found /usr/bin/gcc
configure:3201: result: gcc
configure:3430: checking for C compiler version
configure:3439: gcc --version >&5
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 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.

configure:3450: $? = 0
configure:3439: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) 
configure:3450: $? = 0
configure:3439: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3450: $? = 1
configure:3439: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3450: $? = 1
configure:3470: checking whether the C compiler works
configure:3492: gcc   -Wl,-s conftest.c  >&5
/usr/bin/ld: error: unknown argument: --push-state
/usr/bin/ld: error: unknown argument: --pop-state
/usr/bin/ld: error: unknown argument: --push-state
/usr/bin/ld: error: unknown argument: --pop-state
collect2: error: ld returned 1 exit status

Is using clang as host compiler not a supported configuration?

Cannot build gettext with clang

I cannot build gettext with clang. But with gcc, there is no errors.

libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDlibtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./setlocale.c -o setlocale.o
IR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./printf.c -o printf.o
In file included from ./localename.c:25:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:29: error: unknown type name 'locale_t'; did you mean '_locale_t'?
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                            ^~~~~~~~
                            _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
In file included from ./localename.c:25:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:68: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                                                   ^
./localename.c:2690:5: error: unknown type name 'locale_t'; did you mean '_locale_t'?
    locale_t thread_locale = uselocale (NULL);
    ^~~~~~~~
    _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./localename.c:2690:30: warning: implicit declaration of function 'uselocale' is invalid in C99 [-Wimplicit-function-declaration]
    locale_t thread_locale = uselocale (NULL);
                             ^
./localename.c:2690:14: warning: incompatible integer to pointer conversion initializing '_locale_t' (aka 'struct localeinfo_struct *') with an expression of type 'int' [-Wint-conversion]
    locale_t thread_locale = uselocale (NULL);
             ^               ~~~~~~~~~~~~~~~~
./localename.c:2691:26: error: use of undeclared identifier 'LC_GLOBAL_LOCALE'
    if (thread_locale != LC_GLOBAL_LOCALE)
                         ^
3 warnings and 3 errors generated.
/bin/sh ../libtool  --tag=CC --mode=compile x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I..  -O2 -I/d/minpref/include -fvisibility=hidden  ./osdep.c
libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./version.c -o version.o
make[4]: *** [Makefile:315: localename.lo] Error 1
make[4]: *** Bitmemiş işler için bekliyor....
In file included from ./version.c:21:
./libgnuintl.h:446:29: error: unknown type name 'locale_t'; did you mean '_locale_t'?
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                            ^~~~~~~~
                            _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
In file included from ./version.c:21:
./libgnuintl.h:446:68: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                                                   ^
1 warning and 1 error generated.
libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./xsize.c -o xsize.o
make[4]: *** [Makefile:323: version.lo] Error 1
In file included from ./setlocale.c:43:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:29: error: unknown type name 'locale_t'; did you mean '_locale_t'?
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                            ^~~~~~~~
                            _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
In file included from ./setlocale.c:43:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:68: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                                                   ^
./setlocale.c:962:1: error: unknown type name 'locale_t'; did you mean '_locale_t'?
locale_t
^~~~~~~~
_locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:963:59: error: unknown type name 'locale_t'; did you mean '_locale_t'?
libintl_newlocale (int category_mask, const char *locale, locale_t base)
                                                          ^~~~~~~~
                                                          _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:963:1: error: conflicting types for 'libintl_newlocale'
libintl_newlocale (int category_mask, const char *locale, locale_t base)
^
./libgnuintl.h:446:38: note: previous declaration is here
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                     ^
./libgnuintl.h:445:19: note: expanded from macro 'newlocale'
#define newlocale libintl_newlocale
                  ^
./setlocale.c:973:26: error: use of undeclared identifier 'LC_CTYPE_MASK'
          { LC_CTYPE,    LC_CTYPE_MASK },
                         ^
./setlocale.c:974:26: error: use of undeclared identifier 'LC_NUMERIC_MASK'
          { LC_NUMERIC,  LC_NUMERIC_MASK },
                         ^
./setlocale.c:975:26: error: use of undeclared identifier 'LC_TIME_MASK'
          { LC_TIME,     LC_TIME_MASK },
                         ^
./setlocale.c:976:26: error: use of undeclared identifier 'LC_COLLATE_MASK'
          { LC_COLLATE,  LC_COLLATE_MASK },
                         ^
./setlocale.c:977:26: error: use of undeclared identifier 'LC_MONETARY_MASK'
          { LC_MONETARY, LC_MONETARY_MASK },
                         ^
./setlocale.c:978:26: error: use of undeclared identifier 'LC_MESSAGES_MASK'
          { LC_MESSAGES, LC_MESSAGES_MASK }
                         ^
./setlocale.c:981:7: error: unknown type name 'locale_t'; did you mean '_locale_t'?
      locale_t orig_base = base;
      ^~~~~~~~
      _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:983:12: error: use of undeclared identifier 'LC_ALL_MASK'
      if ((LC_ALL_MASK & ~category_mask) == 0)
           ^
./setlocale.c:996:18: warning: implicit declaration of function 'newlocale' is invalid in C99 [-Wimplicit-function-declaration]
          base = newlocale (LC_ALL_MASK, base_name, base);
                 ^
./setlocale.c:996:29: error: use of undeclared identifier 'LC_ALL_MASK'
          base = newlocale (LC_ALL_MASK, base_name, base);
                            ^
./setlocale.c:1000:34: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ./setlocale.c:971:14) []'
          for (i = 1; i < sizeof (categories) / sizeof (categories[0]); i++)
                                 ^~~~~~~~~~~~
./setlocale.c:1015:19: error: unknown type name 'locale_t'; did you mean '_locale_t'?
                  locale_t copy = newlocale (category_mask, name, base);
                  ^~~~~~~~
                  _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:1015:28: warning: incompatible integer to pointer conversion initializing '_locale_t' (aka 'struct localeinfo_struct *') with an expression of type 'int' [-Wint-conversion]
                  locale_t copy = newlocale (category_mask, name, base);
                           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./setlocale.c:1028:34: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ./setlocale.c:971:14) []'
          for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
                                 ^~~~~~~~~~~~
./setlocale.c:1036:19: error: unknown type name 'locale_t'; did you mean '_locale_t'?
                  locale_t copy;
                  ^~~~~~~~
                  _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:1042:26: warning: implicit declaration of function 'newlocale' is invalid in C99 [-Wimplicit-function-declaration]
                  copy = newlocale (cat_mask, name, base);
                         ^
./setlocale.c:1042:24: warning: incompatible integer to pointer conversion assigning to '_locale_t' (aka 'struct localeinfo_struct *') from 'int' [-Wint-conversion]
                  copy = newlocale (cat_mask, name, base);
                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./setlocale.c:1059:11: warning: implicit declaration of function 'freelocale' is invalid in C99 [-Wimplicit-function-declaration]
          freelocale (base);
          ^
./setlocale.c:1065:12: warning: implicit declaration of function 'newlocale' is invalid in C99 [-Wimplicit-function-declaration]
    return newlocale (category_mask, locale, base);
           ^
./setlocale.c:1065:12: warning: incompatible integer to pointer conversion returning 'int' from a function with result type '_locale_t' (aka 'struct localeinfo_struct *') [-Wint-conversion]
    return newlocale (category_mask, locale, base);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 warnings and 17 errors generated.
make[4]: *** [Makefile:321: setlocale.lo] Error 1
libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./osdep.c -o osdep.o
make[4]: Leaving directory '/d/ffbuild/gettext-0.19.8.1/gettext-runtime/intl'
make[3]: *** [Makefile:1368: all-recursive] Error 1
make[3]: Leaving directory '/d/ffbuild/gettext-0.19.8.1/gettext-runtime'
make[2]: *** [Makefile:1273: all] Error 2
make[2]: Leaving directory '/d/ffbuild/gettext-0.19.8.1/gettext-runtime'
make[1]: *** [Makefile:413: all-recursive] Error 1
make[1]: Leaving directory '/d/ffbuild/gettext-0.19.8.1'
make: *** [Makefile:369: all] Error 2

building with MSYS : must ensure that python 3 is used

hi,
I've tried to rebuild from scratch with your toolchain (so that I can ensure reproducibility, and also because the headers didn't make it, including llvm-config.h et al) but for some reason it fails fairly early now, during the LLVM CMake :

$ pwd                                                                                                                                                                                                                                                               /c/dev/llvm-mingw

$ which cmake
/mingw64/bin/cmake

$ echo $PATH
/c/score-sdk/toolchain/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

$ ./build-all.sh /c/score-sdk/llvm
-- The C compiler identification is Clang 8.0.0
-- The CXX compiler identification is Clang 8.0.0
-- The ASM compiler identification is Clang
-- Found assembler: C:/score-sdk/toolchain/bin/clang.exe
-- Check for working C compiler: C:/score-sdk/toolchain/bin/clang.exe
-- Check for working C compiler: C:/score-sdk/toolchain/bin/clang.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/score-sdk/toolchain/bin/clang++.exe
-- Check for working CXX compiler: C:/score-sdk/toolchain/bin/clang++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test LLVM_NO_OLD_LIBSTDCXX
-- Performing Test LLVM_NO_OLD_LIBSTDCXX - Success
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - not found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - not found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - not found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for termios.h
-- Looking for termios.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for zlib.h
-- Looking for zlib.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - not found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Looking for compress2 in z
-- Looking for compress2 in z - not found
-- Looking for compress2 in zlib_static
-- Looking for compress2 in zlib_static - not found
-- Looking for compress2 in zlib
-- Looking for compress2 in zlib - not found
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - not found
-- Looking for getpagesize
-- Looking for getpagesize - not found
-- Looking for sysconf
-- Looking for sysconf - not found
-- Looking for getrusage
-- Looking for getrusage - not found
-- Looking for setrlimit
-- Looking for setrlimit - not found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - not found
-- Looking for futimes
-- Looking for futimes - not found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - not found
-- Looking for sigaltstack
-- Looking for sigaltstack - not found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - not found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - not found
-- Looking for posix_spawn
-- Looking for posix_spawn - not found
-- Looking for pread
-- Looking for pread - not found
-- Looking for realpath
-- Looking for realpath - not found
-- Looking for sbrk
-- Looking for sbrk - not found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - not found
-- Looking for strerror_s
-- Looking for strerror_s - found
-- Looking for setenv
-- Looking for setenv - not found
-- Looking for _chsize_s
-- Looking for _chsize_s - found
-- Looking for _alloca
-- Looking for _alloca - not found
-- Looking for __alloca
-- Looking for __alloca - found
-- Looking for __chkstk
-- Looking for __chkstk - not found
-- Looking for __chkstk_ms
-- Looking for __chkstk_ms - not found
-- Looking for ___chkstk
-- Looking for ___chkstk - found
-- Looking for ___chkstk_ms
-- Looking for ___chkstk_ms - found
-- Looking for __ashldi3
-- Looking for __ashldi3 - found
-- Looking for __ashrdi3
-- Looking for __ashrdi3 - found
-- Looking for __divdi3
-- Looking for __divdi3 - found
-- Looking for __fixdfdi
-- Looking for __fixdfdi - found
-- Looking for __fixsfdi
-- Looking for __fixsfdi - found
-- Looking for __floatdidf
-- Looking for __floatdidf - found
-- Looking for __lshrdi3
-- Looking for __lshrdi3 - found
-- Looking for __moddi3
-- Looking for __moddi3 - found
-- Looking for __udivdi3
-- Looking for __udivdi3 - found
-- Looking for __umoddi3
-- Looking for __umoddi3 - found
-- Looking for __main
-- Looking for __main - found
-- Looking for __cmpdi2
-- Looking for __cmpdi2 - found
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - not found
-- Looking for sched_getaffinity
-- Looking for sched_getaffinity - not found
-- Looking for CPU_COUNT
-- Looking for CPU_COUNT - not found
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Success
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64-pc-mingw32
-- LLVM default target triple: x86_64-pc-mingw32
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Performing Test CXX_SUPPORTS_CXX11
-- Performing Test CXX_SUPPORTS_CXX11 - Success
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success
-- Found PythonInterp: C:/msys64/usr/bin/python2.7.exe (found version "2.7.15")
-- Constructing LLVMBuild project information
CMake Error: File /c/dev/llvm-mingw/llvm/LLVMBuild.txt does not exist.
CMake Error at build/LLVMBuild.cmake:28 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:669 (include)

from what I understand, the problem is that CMake goes looking for /c/dev/llvm-mingw/llvm/LLVMBuild.txt while it should instead look it up with windows paths, however all the other paths seem correct.

How to use on windows

Hi,
I have been looking for clang based on the x86_64-w64-mingw32 toolchain for use on Windows instead of the official msvc compatabile toolchain available from the LLVM website. I think this repo provides this, however there are no instructions regarding windows usage.

Thanks.

linking to .lib

Hi,
I used your toolchain to build vlc with PDB and it worked great. I managed to generate a vlc-4.0.0 folder, which contains sdk/lib.

However, when trying to build my app with -L/path/to/vlc-4.0.0/sdk/lib -lvlc, ld.lld told me that it couldn't find -lvlc.

I managed to find the issue : It seems that it expect libvlc.a files, while only .lib exists there. At least that what I understood from your comment here : #43 (comment)

When using -ldiscord_game_sdk, it currently looks for libdiscord_game_sdk.a and libdiscord_game_sdk.dll.a, nothing else.

When I renamed my .lib files to .a files, everything was building just fine.

Would it make sense to make ld.lld also look for .lib files?

Cannot install wrappers

When I try to install wrappers, I get this error:

./install-wrappers.sh /d/mingw-llvm
wrappers/clang-target-wrapper.c:30:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.

Mingw-w64 has not been build yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.