summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gccld/GenerateCode.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-12-22 01:50:56 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-12-22 01:50:56 +0000
commitf984b681811a7b887ee69dbfc67632eca7216612 (patch)
treec7eadb77832d4a01c83fa756b0de22adb5417a29 /llvm/tools/gccld/GenerateCode.cpp
parent23d7a0b641e91dcddef199c9fab6689efe7d8abf (diff)
downloadbcm5719-llvm-f984b681811a7b887ee69dbfc67632eca7216612.tar.gz
bcm5719-llvm-f984b681811a7b887ee69dbfc67632eca7216612.zip
Implement PR679:
* Changed the -rpath option from cl::opt to cl::list * Changed the interface to GenerateNative to take a std::vector<std::string> instead of just a std::string * Changed GenerateNative to generate multiple -Wl,-rpath, options to be passed to gcc. llvm-svn: 24930
Diffstat (limited to 'llvm/tools/gccld/GenerateCode.cpp')
-rw-r--r--llvm/tools/gccld/GenerateCode.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp
index 3b5d2b2b050..9dffe332e48 100644
--- a/llvm/tools/gccld/GenerateCode.cpp
+++ b/llvm/tools/gccld/GenerateCode.cpp
@@ -352,7 +352,7 @@ int llvm::GenerateNative(const std::string &OutputFilename,
const sys::Path &gcc, char ** const envp,
bool Shared,
bool ExportAllAsDynamic,
- const std::string &RPath,
+ const std::vector<std::string> &RPaths,
const std::string &SOName,
bool Verbose) {
// Remove these environment variables from the environment of the
@@ -394,10 +394,13 @@ int llvm::GenerateNative(const std::string &OutputFilename,
if (Shared) args.push_back("-shared");
if (ExportAllAsDynamic) args.push_back("-export-dynamic");
- if (!RPath.empty()) {
- std::string rp = "-Wl,-rpath," + RPath;
- StringsToDelete.push_back(strdup(rp.c_str()));
- args.push_back(StringsToDelete.back());
+ if (!RPaths.empty()) {
+ for (std::vector<std::string>::const_iterator I = RPaths.begin(),
+ E = RPaths.end(); I != E; I++) {
+ std::string rp = "-Wl,-rpath," + *I;
+ StringsToDelete.push_back(strdup(rp.c_str()));
+ args.push_back(StringsToDelete.back());
+ }
}
if (!SOName.empty()) {
std::string so = "-Wl,-soname," + SOName;
OpenPOWER on IntegriCloud