aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder/lld.cpp
blob: 5a9ad8a204caa214ed3e311df0e19b95aa60c84f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// +build byollvm

// This file provides C wrappers for liblld.

#include <lld/Common/Driver.h>

extern "C" {

bool tinygo_link_elf(int argc, char **argv) {
	std::vector<const char*> args(argv, argv + argc);
	return lld::elf::link(args, false, llvm::outs(), llvm::errs());
}

bool tinygo_link_mingw(int argc, char **argv) {
	std::vector<const char*> args(argv, argv + argc);
	return lld::mingw::link(args, false, llvm::outs(), llvm::errs());
}

bool tinygo_link_wasm(int argc, char **argv) {
	std::vector<const char*> args(argv, argv + argc);
	return lld::wasm::link(args, false, llvm::outs(), llvm::errs());
}

} // external "C"