mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Pass -export-dynamic to gcc when compiling with -native and the link is
performed with -export-dynamic (aka. -disable-internalize). Patch by Nicholas Riley! llvm-svn: 22601
This commit is contained in:
parent
420424b477
commit
0755b356ab
@ -325,8 +325,7 @@ int llvm::GenerateAssembly(const std::string &OutputFilename,
|
|||||||
return sys::Program::ExecuteAndWait(llc, &args[0]);
|
return sys::Program::ExecuteAndWait(llc, &args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// GenerateAssembly - generates a native assembly language source file from the
|
/// GenerateCFile - generates a C source file from the specified bytecode file.
|
||||||
/// specified bytecode file.
|
|
||||||
int llvm::GenerateCFile(const std::string &OutputFile,
|
int llvm::GenerateCFile(const std::string &OutputFile,
|
||||||
const std::string &InputFile,
|
const std::string &InputFile,
|
||||||
const sys::Path &llc,
|
const sys::Path &llc,
|
||||||
@ -344,8 +343,8 @@ int llvm::GenerateCFile(const std::string &OutputFile,
|
|||||||
return sys::Program::ExecuteAndWait(llc, &args[0]);
|
return sys::Program::ExecuteAndWait(llc, &args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// GenerateNative - generates a native assembly language source file from the
|
/// GenerateNative - generates a native executable file from the specified
|
||||||
/// specified assembly source file.
|
/// assembly source file.
|
||||||
///
|
///
|
||||||
/// Inputs:
|
/// Inputs:
|
||||||
/// InputFilename - The name of the output bytecode file.
|
/// InputFilename - The name of the output bytecode file.
|
||||||
@ -365,6 +364,7 @@ int llvm::GenerateNative(const std::string &OutputFilename,
|
|||||||
const std::vector<std::string> &Libraries,
|
const std::vector<std::string> &Libraries,
|
||||||
const sys::Path &gcc, char ** const envp,
|
const sys::Path &gcc, char ** const envp,
|
||||||
bool Shared,
|
bool Shared,
|
||||||
|
bool ExportAllAsDynamic,
|
||||||
const std::string &RPath,
|
const std::string &RPath,
|
||||||
const std::string &SOName,
|
const std::string &SOName,
|
||||||
bool Verbose) {
|
bool Verbose) {
|
||||||
@ -400,6 +400,7 @@ int llvm::GenerateNative(const std::string &OutputFilename,
|
|||||||
args.push_back(InputFilename.c_str());
|
args.push_back(InputFilename.c_str());
|
||||||
|
|
||||||
if (Shared) args.push_back("-shared");
|
if (Shared) args.push_back("-shared");
|
||||||
|
if (ExportAllAsDynamic) args.push_back("-export-dynamic");
|
||||||
if (!RPath.empty()) {
|
if (!RPath.empty()) {
|
||||||
std::string rp = "-Wl,-rpath," + RPath;
|
std::string rp = "-Wl,-rpath," + RPath;
|
||||||
args.push_back(rp.c_str());
|
args.push_back(rp.c_str());
|
||||||
|
@ -308,8 +308,8 @@ int main(int argc, char **argv, char **envp ) {
|
|||||||
Verbose);
|
Verbose);
|
||||||
if (Verbose) std::cout << "Generating Native Code\n";
|
if (Verbose) std::cout << "Generating Native Code\n";
|
||||||
GenerateNative(OutputFilename, AssemblyFile.toString(),
|
GenerateNative(OutputFilename, AssemblyFile.toString(),
|
||||||
LibPaths, Libraries, gcc, envp, LinkAsLibrary, RPath,
|
LibPaths, Libraries, gcc, envp, LinkAsLibrary,
|
||||||
SOName, Verbose);
|
NoInternalize, RPath, SOName, Verbose);
|
||||||
|
|
||||||
if (!SaveTemps) {
|
if (!SaveTemps) {
|
||||||
// Remove the assembly language file.
|
// Remove the assembly language file.
|
||||||
@ -340,8 +340,8 @@ int main(int argc, char **argv, char **envp ) {
|
|||||||
GenerateCFile(CFile.toString(), RealBytecodeOutput, llc, Verbose);
|
GenerateCFile(CFile.toString(), RealBytecodeOutput, llc, Verbose);
|
||||||
if (Verbose) std::cout << "Generating Native Code\n";
|
if (Verbose) std::cout << "Generating Native Code\n";
|
||||||
GenerateNative(OutputFilename, CFile.toString(),
|
GenerateNative(OutputFilename, CFile.toString(),
|
||||||
LibPaths, Libraries, gcc, envp, LinkAsLibrary, RPath,
|
LibPaths, Libraries, gcc, envp, LinkAsLibrary,
|
||||||
SOName, Verbose);
|
NoInternalize, RPath, SOName, Verbose);
|
||||||
|
|
||||||
if (!SaveTemps) {
|
if (!SaveTemps) {
|
||||||
// Remove the assembly language file.
|
// Remove the assembly language file.
|
||||||
|
@ -45,6 +45,7 @@ GenerateNative (const std::string &OutputFilename,
|
|||||||
const sys::Path &gcc,
|
const sys::Path &gcc,
|
||||||
char ** const envp,
|
char ** const envp,
|
||||||
bool Shared,
|
bool Shared,
|
||||||
|
bool ExportAllAsDynamic,
|
||||||
const std::string &RPath,
|
const std::string &RPath,
|
||||||
const std::string &SOName,
|
const std::string &SOName,
|
||||||
bool Verbose=false);
|
bool Verbose=false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user