Revert use of Clang config files
This reverts commit49db4a3a15,9f1f0104f1,4f95c14adf,c34dc64028,570fdcd251,4bff0298c5and6939aee0c0. When relying on Clang config files, two issues appeared: - Running the compiler-rt tests fails, because the compiler-rt tests disable any default config files, breaking the compiler in this case: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/compiler-rt/test/lit.common.cfg.py#L983 - Wine fails to build using llvm-mingw as cross compiler, because Wine adds the --no-default-config flag to Clang while compiling, if supported: https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/configure.ac?ref_type=tags#L866-868 This causes llvm-mingw to omit the -rtlib=compiler-rt option (specified in a config file), making the compiler look for libgcc instead. Doing a check to see that linking succeeds doesn't necessarily help here - such a check already exists, but it tests linking with -nostdlib -nodefaultlibs: https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/aclocal.m4?ref_type=tags#L193-L206
This commit is contained in:
1 parent
49db4a3a15
commit
e0964ce24c
14 files changed
+119
-31
No files matched your search
@@ -50,7 +50,7 @@ int _tmain(int argc, TCHAR* argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
int max_arg = argc + 18;
|
||||
int max_arg = argc + 22;
|
||||
const TCHAR **exec_argv = malloc((max_arg + 1) * sizeof(*exec_argv));
|
||||
int arg = 0;
|
||||
if (getenv("CCACHE"))
|
||||
@@ -66,6 +66,16 @@ 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");
|
||||
@@ -80,6 +90,10 @@ int _tmain(int argc, TCHAR* argv[]) {
|
||||
|
||||
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("--end-no-unused-arguments");
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
|
||||
Reference in new issue
Block a user