aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder/lld.cpp
blob: a03944c58a84d3c81724ed2966fc79d4e7fbfcda (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
25
26
27
28
29
// +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, llvm::outs(), llvm::errs(), false, false);
}

bool tinygo_link_macho(int argc, char **argv) {
	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) {
	std::vector<const char*> args(argv, argv + argc);
	return lld::mingw::link(args, llvm::outs(), llvm::errs(), false, false);
}

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

} // external "C"