mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-28 09:33:27 +01:00
Factor out the code to find gcc, and add a command-line option to override the
default executable name. This should help cross-compilation by allowing a cross-gcc to be specified from the configuration file instead of only through the CC environment variable.
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
#include "llvm/PassManager.h"
|
||||
#include "llvm/LinkAllPasses.h"
|
||||
#include "llvm/System/Program.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@@ -51,6 +50,7 @@
|
||||
#include "gen/cl_options.h"
|
||||
#include "gen/optimizer.h"
|
||||
#include "gen/llvm-version.h"
|
||||
#include "gen/programs.h"
|
||||
|
||||
#include "ir/irvar.h"
|
||||
#include "ir/irmodule.h"
|
||||
@@ -310,19 +310,7 @@ void assemble(const llvm::sys::Path& asmpath, const llvm::sys::Path& objpath)
|
||||
{
|
||||
using namespace llvm;
|
||||
|
||||
const char *cc;
|
||||
#if !_WIN32
|
||||
cc = getenv("CC");
|
||||
if (!cc)
|
||||
#endif
|
||||
cc = "gcc";
|
||||
|
||||
sys::Path gcc = llvm::sys::Program::FindProgramByName(cc);
|
||||
if (gcc.empty())
|
||||
{
|
||||
error("failed to locate gcc");
|
||||
fatal();
|
||||
}
|
||||
sys::Path gcc = getGcc();
|
||||
|
||||
// Run GCC to assemble and link the program into native code.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user