aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder/lld.cpp
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2023-09-23 15:06:27 +0200
committerRon Evans <[email protected]>2024-01-05 21:13:30 +0100
commit6984af43a08b7fa1c1020700c42ce8c417d1f542 (patch)
tree79e9b9bfe07c1d9a67913585a39ec17321715ce4 /builder/lld.cpp
parent81c56c3ab89fe0598361c00f03eb0498d2ea0924 (diff)
downloadtinygo-6984af43a08b7fa1c1020700c42ce8c417d1f542.tar.gz
tinygo-6984af43a08b7fa1c1020700c42ce8c417d1f542.zip
all: statically link to LLVM 17 instead of LLVM 16
We can now finally do it, now that Espressif has updated their fork.
Diffstat (limited to 'builder/lld.cpp')
-rw-r--r--builder/lld.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/builder/lld.cpp b/builder/lld.cpp
index 6cecbebe8..734c5703c 100644
--- a/builder/lld.cpp
+++ b/builder/lld.cpp
@@ -5,7 +5,11 @@
#include <lld/Common/Driver.h>
#include <llvm/Support/Parallel.h>
-extern "C" {
+LLD_HAS_DRIVER(coff)
+LLD_HAS_DRIVER(elf)
+LLD_HAS_DRIVER(mingw)
+LLD_HAS_DRIVER(macho)
+LLD_HAS_DRIVER(wasm)
static void configure() {
#if _WIN64
@@ -16,28 +20,13 @@ static void configure() {
#endif
}
-bool tinygo_link_elf(int argc, char **argv) {
- configure();
- std::vector<const char*> args(argv, argv + argc);
- return lld::elf::link(args, llvm::outs(), llvm::errs(), false, false);
-}
-
-bool tinygo_link_macho(int argc, char **argv) {
- configure();
- std::vector<const char*> args(argv, argv + argc);
- return lld::macho::link(args, llvm::outs(), llvm::errs(), false, false);
-}
-
-bool tinygo_link_mingw(int argc, char **argv) {
- configure();
- std::vector<const char*> args(argv, argv + argc);
- return lld::mingw::link(args, llvm::outs(), llvm::errs(), false, false);
-}
+extern "C" {
-bool tinygo_link_wasm(int argc, char **argv) {
+bool tinygo_link(int argc, char **argv) {
configure();
std::vector<const char*> args(argv, argv + argc);
- return lld::wasm::link(args, llvm::outs(), llvm::errs(), false, false);
+ lld::Result r = lld::lldMain(args, llvm::outs(), llvm::errs(), LLD_ALL_DRIVERS);
+ return !r.retCode;
}
} // external "C"