wrappers: Remove the dlltool wrapper
Since LLVM 13, llvm-dlltool can imply the target architecture from a triple prefix on the tool name, so there's no more need for a wrapper. The *-dlltool tools are now symlinks to the main llvm-dlltool executable. In the Windows distribution, the *-dlltool.exe used to be copies of dlltool-wrapper.exe (which is small; 15 KB). Now they will instead be copies of llvm-dlltool.exe. Luckily, thanks to building with -DLLVM_LINK_LLVM_DYLIB=ON by default, llvm-dlltool.exe is only a mere 65 KB, while it used to be much larger, e.g. around 11 MB in older releases.
This commit is contained in:
1 parent
671c408b9b
commit
42d2eb7346
2 files changed
+2
-71
No files matched your search
+2
-3
@@ -69,7 +69,6 @@ if [ -n "$HOST" ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
$CC wrappers/clang-target-wrapper.c -o "$PREFIX/bin/clang-target-wrapper$EXEEXT" -O2 -Wl,-s $WRAPPER_FLAGS
|
$CC wrappers/clang-target-wrapper.c -o "$PREFIX/bin/clang-target-wrapper$EXEEXT" -O2 -Wl,-s $WRAPPER_FLAGS
|
||||||
$CC wrappers/dlltool-wrapper.c -o "$PREFIX/bin/dlltool-wrapper$EXEEXT" -O2 -Wl,-s $WRAPPER_FLAGS
|
|
||||||
$CC wrappers/llvm-wrapper.c -o "$PREFIX/bin/llvm-wrapper$EXEEXT" -O2 -Wl,-s $WRAPPER_FLAGS
|
$CC wrappers/llvm-wrapper.c -o "$PREFIX/bin/llvm-wrapper$EXEEXT" -O2 -Wl,-s $WRAPPER_FLAGS
|
||||||
if [ -n "$EXEEXT" ]; then
|
if [ -n "$EXEEXT" ]; then
|
||||||
# For Windows, we should prefer the executable wrapper, which also works
|
# For Windows, we should prefer the executable wrapper, which also works
|
||||||
@@ -93,10 +92,10 @@ for arch in $ARCHS; do
|
|||||||
fi
|
fi
|
||||||
ln -sf $link_target$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
|
ln -sf $link_target$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
|
||||||
done
|
done
|
||||||
# windres can't use llvm-wrapper, as that loses the original
|
# windres and dlltool can't use llvm-wrapper, as that loses the original
|
||||||
# target arch prefix.
|
# target arch prefix.
|
||||||
ln -sf llvm-windres$EXEEXT $arch-w64-$target_os-windres$EXEEXT
|
ln -sf llvm-windres$EXEEXT $arch-w64-$target_os-windres$EXEEXT
|
||||||
ln -sf dlltool-wrapper$EXEEXT $arch-w64-$target_os-dlltool$EXEEXT
|
ln -sf llvm-dlltool$EXEEXT $arch-w64-$target_os-dlltool$EXEEXT
|
||||||
for exec in ld objdump; do
|
for exec in ld objdump; do
|
||||||
ln -sf $exec-wrapper.sh $arch-w64-$target_os-$exec
|
ln -sf $exec-wrapper.sh $arch-w64-$target_os-$exec
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2018 Martin Storsjo
|
|
||||||
*
|
|
||||||
* This file is part of llvm-mingw.
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "native-wrapper.h"
|
|
||||||
|
|
||||||
#ifndef DEFAULT_TARGET
|
|
||||||
#define DEFAULT_TARGET "x86_64-w64-mingw32"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int _tmain(int argc, TCHAR* argv[]) {
|
|
||||||
const TCHAR *dir;
|
|
||||||
const TCHAR *target;
|
|
||||||
split_argv(argv[0], &dir, NULL, &target, NULL);
|
|
||||||
if (!target)
|
|
||||||
target = _T(DEFAULT_TARGET);
|
|
||||||
TCHAR *arch = _tcsdup(target);
|
|
||||||
TCHAR *dash = _tcschr(arch, '-');
|
|
||||||
if (dash)
|
|
||||||
*dash = '\0';
|
|
||||||
|
|
||||||
int max_arg = argc + 2;
|
|
||||||
const TCHAR **exec_argv = malloc((max_arg + 1) * sizeof(*exec_argv));
|
|
||||||
int arg = 0;
|
|
||||||
exec_argv[arg++] = concat(dir, _T("llvm-dlltool"));
|
|
||||||
|
|
||||||
if (!_tcscmp(arch, _T("i686"))) {
|
|
||||||
exec_argv[arg++] = _T("-m");
|
|
||||||
exec_argv[arg++] = _T("i386");
|
|
||||||
} else if (!_tcscmp(arch, _T("x86_64"))) {
|
|
||||||
exec_argv[arg++] = _T("-m");
|
|
||||||
exec_argv[arg++] = _T("i386:x86-64");
|
|
||||||
} else if (!_tcscmp(arch, _T("armv7"))) {
|
|
||||||
exec_argv[arg++] = _T("-m");
|
|
||||||
exec_argv[arg++] = _T("arm");
|
|
||||||
} else if (!_tcscmp(arch, _T("aarch64"))) {
|
|
||||||
exec_argv[arg++] = _T("-m");
|
|
||||||
exec_argv[arg++] = _T("arm64");
|
|
||||||
} else {
|
|
||||||
_ftprintf(stderr, _T("Arch "TS" unsupported\n"), arch);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++)
|
|
||||||
exec_argv[arg++] = argv[i];
|
|
||||||
|
|
||||||
exec_argv[arg] = NULL;
|
|
||||||
if (arg > max_arg) {
|
|
||||||
fprintf(stderr, "Too many options added\n");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
return run_final(exec_argv[0], exec_argv);
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user