forked from OSchip/llvm-project
Fixes for PR214. Use the SHLIBEXT variable instead of hardcoding .so into
every file. llvm-svn: 10976
This commit is contained in:
parent
666aaf715f
commit
e6a41815f3
|
@ -37,5 +37,5 @@ namespace {
|
||||||
|
|
||||||
// This causes operator= above to be invoked for every -load option.
|
// This causes operator= above to be invoked for every -load option.
|
||||||
static cl::opt<PluginLoader, false, cl::parser<std::string> >
|
static cl::opt<PluginLoader, false, cl::parser<std::string> >
|
||||||
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"),
|
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin" SHLIBEXT),
|
||||||
cl::desc("Load the specified plugin"));
|
cl::desc("Load the specified plugin"));
|
||||||
|
|
|
@ -337,7 +337,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
|
||||||
|
|
||||||
int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
|
int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
|
||||||
std::string &OutputFile) {
|
std::string &OutputFile) {
|
||||||
OutputFile = getUniqueFilename(InputFile+".so");
|
OutputFile = getUniqueFilename(InputFile+SHLIBEXT);
|
||||||
// Compile the C/asm file into a shared object
|
// Compile the C/asm file into a shared object
|
||||||
const char* GCCArgs[] = {
|
const char* GCCArgs[] = {
|
||||||
GCCPath.c_str(),
|
GCCPath.c_str(),
|
||||||
|
|
|
@ -56,8 +56,8 @@ std::string llvm::FindLib(const std::string &Filename,
|
||||||
if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".bc"))
|
if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".bc"))
|
||||||
return Directory + LibName + ".bc";
|
return Directory + LibName + ".bc";
|
||||||
|
|
||||||
if (FileOpenable(Directory + LibName + ".so"))
|
if (FileOpenable(Directory + LibName + SHLIBEXT))
|
||||||
return Directory + LibName + ".so";
|
return Directory + LibName + SHLIBEXT;
|
||||||
|
|
||||||
if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".a"))
|
if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".a"))
|
||||||
return Directory + LibName + ".a";
|
return Directory + LibName + ".a";
|
||||||
|
|
|
@ -16,7 +16,7 @@ all:: llee
|
||||||
llee: $(DESTTOOLCURRENT)/llee
|
llee: $(DESTTOOLCURRENT)/llee
|
||||||
|
|
||||||
$(DESTTOOLCURRENT)/llee: Makefile
|
$(DESTTOOLCURRENT)/llee: Makefile
|
||||||
echo exec env LD_PRELOAD=$(DESTLIBCURRENT)/execve.so $$\* > $@
|
echo exec env LD_PRELOAD=$(DESTLIBCURRENT)/execve$(SHLIBEXT) $$\* > $@
|
||||||
chmod u+x $@
|
chmod u+x $@
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
|
|
Loading…
Reference in New Issue