summaryrefslogtreecommitdiff
path: root/linkers/rtems-ld.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-06 20:19:45 +1000
committerChris Johns <chrisj@rtems.org>2014-09-06 20:19:45 +1000
commit88071359647afc58d1dfcd02df36466d78de62a4 (patch)
tree8cdf32eed4b3881d345a13b1e15e18f963e05555 /linkers/rtems-ld.cpp
parenta916fa4230128a1496b9c0ce12d1fd085d4737aa (diff)
Refactor the CC flags. Fix the various linkers. The trace linker is compiling.
Diffstat (limited to 'linkers/rtems-ld.cpp')
-rw-r--r--linkers/rtems-ld.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/linkers/rtems-ld.cpp b/linkers/rtems-ld.cpp
index 189e699..cf28937 100644
--- a/linkers/rtems-ld.cpp
+++ b/linkers/rtems-ld.cpp
@@ -190,10 +190,8 @@ main (int argc, char* argv[])
std::string output = "a.out";
std::string outra;
std::string base_name;
- std::string cc_name;
std::string output_type = "rap";
bool standard_libs = true;
- bool exec_prefix_set = false;
bool map = false;
bool warnings = false;
bool one_file = false;
@@ -268,18 +266,19 @@ main (int argc, char* argv[])
break;
case 'C':
- if (exec_prefix_set == true)
+ if (rld::cc::is_exec_prefix_set ())
std::cerr << "warning: exec-prefix ignored when CC provided" << std::endl;
- rld::cc::cc = optarg;
+ rld::cc::set_cc (optarg);
break;
case 'E':
- exec_prefix_set = true;
- rld::cc::exec_prefix = optarg;
+ if (rld::cc::is_cc_set ())
+ std::cerr << "warning: exec-prefix ignored when CC provided" << std::endl;
+ rld::cc::set_exec_prefix (optarg);
break;
case 'c':
- rld::cc::cflags = optarg;
+ rld::cc::set_flags (optarg, rld::cc::ft_cflags);
break;
case 'e':
@@ -397,8 +396,8 @@ main (int argc, char* argv[])
* types. This must be after we have added the object files because they
* are used when detecting.
*/
- if (rld::cc::cc.empty () && !exec_prefix_set)
- rld::cc::exec_prefix = rld::elf::machine_type ();
+ if (!rld::cc::is_cc_set () && !rld::cc::is_exec_prefix_set ())
+ rld::cc::set_exec_prefix (rld::elf::machine_type ());
/*
* If we have a base image add it.