diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-01-14 19:56:05 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-04-06 15:18:26 -0400 |
commit | 6be2c5a7e9187fc14d51e1ec32ca235143bb0d8b (patch) | |
tree | 495b27f4c73c233eebebb557a967ebf02a149a41 /driver | |
parent | d4c5f29ceced0891dfad266ef1daa54975547068 (diff) | |
download | haskell-6be2c5a7e9187fc14d51e1ec32ca235143bb0d8b.tar.gz |
Windows/Clang: Build system adaptation
* Bump win32-tarballs to 0.7
* Move Windows toolchain autoconf logic into separate file
* Use clang and LLVM utilities as described in #21019
* Disable object merging as lld doesn't support -r
* Drop --oformat=pe-bigobj-x86-64 arguments from ld flags as LLD detects
that the output is large on its own.
* Drop gcc wrapper since Clang finds its root fine on its own.
Diffstat (limited to 'driver')
-rw-r--r-- | driver/gcc/gcc.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/driver/gcc/gcc.c b/driver/gcc/gcc.c deleted file mode 100644 index aa63bb0498..0000000000 --- a/driver/gcc/gcc.c +++ /dev/null @@ -1,66 +0,0 @@ - -/* gcc on mingw is hardcoded to use /mingw (which is c:/mingw) to - find various files. If this is a different version of mingw to the - one that we have in the GHC tree then things can go wrong. We - therefore need to add various -B flags to the gcc commandline, - so that it uses our in-tree mingw. Hence this wrapper. */ - -#include "cwrapper.h" -#include "getLocation.h" - -#include <stdio.h> -#include <stdlib.h> - -int main(int argc, char** argv) { - char *binDir; - char *exePath; - char *preArgv[4]; - char *oldPath; - char *newPath; - char *base; - char *version; - int n; - - binDir = getExecutablePath(); - exePath = mkString("%s/realgcc.exe", binDir); - - /* We need programs like - inplace/mingw/libexec/gcc/mingw32/4.5.0/cc1.exe - to be able to find the DLLs in inplace/mingw/bin, so we need to - add it to $PATH */ - oldPath = getenv("PATH"); - if (!oldPath) { - die("Couldn't read PATH\n"); - } - n = snprintf(NULL, 0, "PATH=%s;%s", binDir, oldPath); - n++; - newPath = malloc(n); - if (!newPath) { - die("Couldn't allocate space for PATH\n"); - } - snprintf(newPath, n, "PATH=%s;%s", binDir, oldPath); - n = putenv(newPath); - if (n) { - die("putenv failed\n"); - } - - /* GCC Version. */ - version = mkString("%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); - - /* Without these -B args, gcc will still work. However, if you - have a mingw installation in c:/mingw then it will use files - from that in preference to the in-tree files. */ - preArgv[0] = mkString("-B%s", binDir); - preArgv[1] = mkString("-B%s/../lib", binDir); -#if defined(__MINGW64__) - base = mkString("x86_64-w64-mingw32"); -#else - base = mkString("i686-w64-mingw32"); -#endif - - preArgv[2] = mkString("-B%s/../lib/gcc/%s/%s" , binDir, base, version); - preArgv[3] = mkString("-B%s/../libexec/gcc/%s/%s", binDir, base, version); - - run(exePath, 4, preArgv, argc - 1, argv + 1, NULL); -} - |