wrappers: Use clang config files for defaults

This makes these defaults more easy to get picked up in various
use cases, when not directly executing a compiler.
This commit is contained in:
Martin Storsjö committed 2024-10-02 15:58:00 +03:00
1 parent e9e2ef7d53
commit 6939aee0c0
10 files changed
+34 -39

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
-target aarch64-w64-mingw32
-rtlib=compiler-rt
-unwindlib=libunwind
-stdlib=libc++
-fuse-ld=lld
# SEH is the default for aarch64.
+6
View File
@@ -0,0 +1,6 @@
-target armv7-w64-mingw32
-rtlib=compiler-rt
-unwindlib=libunwind
-stdlib=libc++
-fuse-ld=lld
# SEH is the default for armv7.
+3 -17
View File
@@ -50,7 +50,7 @@ int _tmain(int argc, TCHAR* argv[]) {
}
}
int max_arg = argc + 22;
int max_arg = argc + 18;
const TCHAR **exec_argv = malloc((max_arg + 1) * sizeof(*exec_argv));
int arg = 0;
if (getenv("CCACHE"))
@@ -66,16 +66,6 @@ int _tmain(int argc, TCHAR* argv[]) {
else if (!_tcscmp(exe, _T("c11")))
exec_argv[arg++] = _T("-std=c11");
if (!_tcscmp(arch, _T("i686"))) {
// Dwarf is the default for i686.
} else if (!_tcscmp(arch, _T("x86_64"))) {
// SEH is the default for x86_64.
} else if (!_tcscmp(arch, _T("armv7"))) {
// SEH is the default for armv7.
} else if (!_tcscmp(arch, _T("aarch64"))) {
// SEH is the default for aarch64.
}
if (target_os && !_tcscmp(target_os, _T("mingw32uwp"))) {
// the UWP target is for Windows 10
exec_argv[arg++] = _T("-D_WIN32_WINNT=0x0A00");
@@ -88,12 +78,8 @@ int _tmain(int argc, TCHAR* argv[]) {
exec_argv[arg++] = _T("-D_UCRT");
}
exec_argv[arg++] = _T("-target");
exec_argv[arg++] = target;
exec_argv[arg++] = _T("-rtlib=compiler-rt");
exec_argv[arg++] = _T("-unwindlib=libunwind");
exec_argv[arg++] = _T("-stdlib=libc++");
exec_argv[arg++] = _T("-fuse-ld=lld");
exec_argv[arg++] = _T("--config");
exec_argv[arg++] = concat(arch, _T("-w64-mingw32.cfg"));
exec_argv[arg++] = _T("--end-no-unused-arguments");
for (int i = 1; i < argc; i++)
+1 -19
View File
@@ -67,20 +67,6 @@ c11)
FLAGS="$FLAGS -std=c11"
;;
esac
case $ARCH in
i686)
# Dwarf is the default for i686.
;;
x86_64)
# SEH is the default for x86_64.
;;
armv7)
# SEH is the default for armv7.
;;
aarch64)
# SEH is the default for aarch64.
;;
esac
LINKER_FLAGS=""
case $TARGET_OS in
mingw32uwp)
@@ -106,11 +92,7 @@ mingw32uwp)
;;
esac
FLAGS="$FLAGS -target $TARGET"
FLAGS="$FLAGS -rtlib=compiler-rt"
FLAGS="$FLAGS -unwindlib=libunwind"
FLAGS="$FLAGS -stdlib=libc++"
FLAGS="$FLAGS -fuse-ld=lld"
FLAGS="$FLAGS --config $ARCH-w64-mingw32.cfg"
FLAGS="$FLAGS --end-no-unused-arguments"
$CCACHE "$CLANG" $FLAGS "$@" $LINKER_FLAGS
+6
View File
@@ -0,0 +1,6 @@
-target i686-w64-mingw32
-rtlib=compiler-rt
-unwindlib=libunwind
-stdlib=libc++
-fuse-ld=lld
# Dwarf is the default for i686.
+6
View File
@@ -0,0 +1,6 @@
-target x86_64-w64-mingw32
-rtlib=compiler-rt
-unwindlib=libunwind
-stdlib=libc++
-fuse-ld=lld
# SEH is the default for x86_64.