
When building statically against LLVM, LLD is also included now. When included, the built in wasm-ld will automatically be used instead of the external command. There is also support for linking ELF files but because lld does not fully support armv6m this is not yet enabled (it produces a warning).
19 строки
405 Б
C++
19 строки
405 Б
C++
// +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);
|
|
}
|
|
|
|
bool tinygo_link_wasm(int argc, char **argv) {
|
|
std::vector<const char*> args(argv, argv + argc);
|
|
return lld::wasm::link(args, false);
|
|
}
|
|
|
|
} // external "C"
|