Changeset 6506aa1 in rtems-tools
- Timestamp:
- Sep 8, 2014, 6:06:48 AM (6 years ago)
- Branches:
- 4.10, 4.11, 5, master
- Children:
- 17c8364
- Parents:
- b28e8b3
- Location:
- linkers
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
linkers/rld-cc.cpp
rb28e8b3 r6506aa1 31 31 static bool cc_set; //< True when the CC has been set. 32 32 static std::string cc_name = "gcc"; //< The CC name, ie gcc, clang. 33 static std::string exec_prefix; //< The CC executable prefix. 33 34 static std::string ld; //< The LD executable as absolute path. 35 static bool ld_set; //< True when the LD has been set. 36 static std::string ld_name = "gcc"; //< The LD name, ie gcc, clang. 37 38 static std::string exec_prefix; //< The CC/LD executable prefix. 34 39 35 40 static std::string cppflags; //< The CPP flags. … … 251 256 252 257 void 258 set_ld (const std::string& ld_) 259 { 260 ld = ld_; 261 ld_set = true; 262 } 263 264 const std::string 265 get_ld () 266 { 267 return ld; 268 } 269 270 bool 271 is_ld_set () 272 { 273 return ld_set; 274 } 275 276 void 253 277 set_exec_prefix (const std::string& exec_prefix_) 254 278 { … … 419 443 * Use the absolute path to CC if provided. 420 444 */ 421 if (!cc.empty ()) 445 if (is_cc_set ()) 446 { 422 447 args.push_back (cc); 448 } 423 449 else 424 450 { 425 451 std::string cmd = cc_name; 452 if (!exec_prefix.empty ()) 453 cmd = exec_prefix + "-rtems" + rld::rtems::version () + '-' + cmd; 454 args.push_back (cmd); 455 } 456 } 457 458 void 459 make_ld_command (rld::process::arg_container& args) 460 { 461 /* 462 * Use the absolute path to LD if provided. 463 */ 464 if (is_ld_set ()) 465 { 466 args.push_back (get_ld ()); 467 } 468 else 469 { 470 std::string cmd = ld_name; 426 471 if (!exec_prefix.empty ()) 427 472 cmd = exec_prefix + "-rtems" + rld::rtems::version () + '-' + cmd; -
linkers/rld-cc.h
rb28e8b3 r6506aa1 122 122 123 123 /** 124 * Set LD. The exec-prefix is ignored if this is set. 125 */ 126 void set_ld (const std::string& ld); 127 128 /** 129 * Get the LD. 130 */ 131 const std::string get_ld (); 132 133 /** 134 * Is the LD set ? 135 */ 136 bool is_ld_set (); 137 138 /** 124 139 * Set the exec-prefix. If CC is set the exec-prefix is ignored. 125 140 */ … … 179 194 180 195 /** 196 * Make a LD command from the set arguments. 197 */ 198 void make_ld_command (rld::process::arg_container& args); 199 200 /** 181 201 * Get the standard libraries paths from the compiler. 182 202 */ -
linkers/rld-config.cpp
rb28e8b3 r6506aa1 57 57 } 58 58 59 std::string59 const std::string 60 60 section::get_record_item (const std::string& rec_name) const 61 61 { … … 79 79 } 80 80 81 config::config() 82 { 81 config::config(const std::string& search_path) 82 { 83 set_search_path (search_path); 83 84 } 84 85 … … 88 89 89 90 void 91 config::set_search_path (const std::string& search_path) 92 { 93 if (!search_path.empty ()) 94 rld::path::path_split (search_path, search); 95 } 96 97 void 90 98 config::clear () 91 99 { … … 98 106 CSimpleIniCaseA ini (false, true, true); 99 107 100 if (ini.LoadFile (path.c_str ()) != SI_OK) 108 std::string checked_path; 109 110 if (rld::path::check_file (path)) 111 { 112 checked_path = path; 113 } 114 else 115 { 116 bool found = false; 117 for (rld::path::paths::const_iterator spi = search.begin (); 118 spi != search.end (); 119 ++spi) 120 { 121 rld::path::path_join (*spi, path, checked_path); 122 if (rld::path::check_file (checked_path)) 123 { 124 found = true; 125 break; 126 } 127 } 128 if (!found) 129 throw rld::error ("Not found.", "load config: " + path); 130 } 131 132 if (ini.LoadFile (checked_path.c_str ()) != SI_OK) 101 133 throw rld::error (::strerror (errno), "load config: " + path); 102 134 103 paths_.push_back ( path);135 paths_.push_back (checked_path); 104 136 105 137 /* … … 163 195 164 196 /* 165 * Include records are a path which we can just load. 166 * 167 * @todo Add a search path. See 'rld::files' for details. We can default 168 * the search path to the install $prefix of this tool and we can 169 * then provide a default set of function signatures for RTEMS 170 * APIs. 197 * Include records are a paths which we can load. 171 198 */ 172 199 -
linkers/rld-config.h
rb28e8b3 r6506aa1 96 96 * error is thrown. 97 97 */ 98 std::string get_record_item (const std::string& name) const;98 const std::string get_record_item (const std::string& name) const; 99 99 100 100 /** … … 123 123 * Construct an empty configuration. 124 124 */ 125 config(); 125 config(const std::string& search_path = ""); 126 127 /** 128 * Desctruct the configuration object. 129 */ 126 130 virtual ~config(); 131 132 /** 133 * Set the search path. 134 */ 135 void set_search_path (const std::string& search_path); 127 136 128 137 /** … … 155 164 private: 156 165 157 paths paths_; /**< The path's of the loaded files. */ 158 sections secs; /**< The sections loaded from configuration files */ 166 paths search; //< The paths to search for config files in. 167 paths paths_; //< The path's of the loaded files. 168 sections secs; //< The sections loaded from configuration files 159 169 }; 160 170 -
linkers/rld-path.cpp
rb28e8b3 r6506aa1 28 28 namespace path 29 29 { 30 std::string30 const std::string 31 31 basename (const std::string& name) 32 32 { … … 37 37 } 38 38 39 std::string39 const std::string 40 40 dirname (const std::string& name) 41 41 { 42 42 size_t b = name.find_last_of (RLD_PATH_SEPARATOR); 43 43 if (b != std::string::npos) 44 return name.substr (0, b - 1);44 return name.substr (0, b); 45 45 return name; 46 46 } 47 47 48 std::string48 const std::string 49 49 extension (const std::string& name) 50 50 { … … 97 97 } 98 98 99 const std::string 100 path_abs (const std::string& path) 101 { 102 std::string apath; 103 104 if (path[0] == RLD_PATH_SEPARATOR) 105 { 106 apath = path; 107 } 108 else 109 { 110 char* buf = 0; 111 try 112 { 113 buf = new char[32 * 1024]; 114 if (!::getcwd (buf, 132 * 1024)) 115 throw rld::error (::strerror (errno), "get current working directory"); 116 path_join (buf, path, apath); 117 } 118 catch (...) 119 { 120 delete [] buf; 121 throw; 122 } 123 } 124 125 strings ps; 126 strings aps; 127 128 rld::split (ps, apath, RLD_PATH_SEPARATOR); 129 130 for (strings::iterator psi = ps.begin (); 131 psi != ps.end (); 132 ++psi) 133 { 134 const std::string& dir = *psi; 135 136 if (dir.empty () || dir == ".") 137 { 138 /* do nothing */ 139 } 140 else if (dir == "..") 141 { 142 aps.pop_back (); 143 } 144 else 145 { 146 aps.push_back (dir); 147 } 148 } 149 150 return RLD_PATH_SEPARATOR + rld::join (aps, RLD_PATH_SEPARATOR_STR); 151 } 152 99 153 bool 100 154 check_file (const std::string& path) -
linkers/rld-path.h
rb28e8b3 r6506aa1 46 46 * 47 47 * @param name The full file name. 48 * @return std::string The basename of the file.48 * @return const std::string The basename of the file. 49 49 */ 50 std::string basename (const std::string& name);50 const std::string basename (const std::string& name); 51 51 52 52 /** … … 54 54 * 55 55 * @param name The full file name. 56 * @return std::string The dirname of the file.56 * @return const std::string The dirname of the file. 57 57 */ 58 std::string dirname (const std::string& name);58 const std::string dirname (const std::string& name); 59 59 60 60 /** … … 62 62 * 63 63 * @param name The full file name. 64 * @return std::string The extension of the file.64 * @return const std::string The extension of the file. 65 65 */ 66 std::string extension (const std::string& name);66 const std::string extension (const std::string& name); 67 67 68 68 /** 69 * Split a path from a string with a delimiter to the path container. Add70 * only the paths that exist and ignore those that do not.69 * Split a path from a string with the path seperator to the path 70 * container. Add only the paths that exist and ignore those that do not. 71 71 * 72 72 * @param path The paths as a single string delimited by the path … … 99 99 const paths& parts, 100 100 std::string& joined); 101 102 /** 103 * Return the absolute path given a path and using the current working 104 * directory. The path is flattened removing any '..' sequences. 105 * 106 * @param path The path to be return as absolute. 107 * @return const std::string The absolute path. 108 */ 109 const std::string path_abs (const std::string& path); 101 110 102 111 /** -
linkers/rld.cpp
rb28e8b3 r6506aa1 40 40 { 41 41 static int verbose_level = 0; 42 static std::string progname; 42 43 43 44 /** … … 64 65 * The output passed on the command line. 65 66 */ 66 static std::string output; 67 //static std::string output; 68 69 bool 70 starts_with(const std::string& s1, const std::string& s2) 71 { 72 return s2.size () <= s1.size () && s1.compare (0, s2.size (), s2) == 0; 73 } 74 75 const std::string 76 ltrim (const std::string& s) 77 { 78 std::string t = s; 79 t.erase (t.begin (), 80 std::find_if (t.begin (), t.end (), 81 std::not1 (std::ptr_fun < int, int > (std::isspace)))); 82 return t; 83 } 84 85 const std::string 86 rtrim (const std::string& s) 87 { 88 std::string t = s; 89 t.erase (std::find_if (t.rbegin (), t.rend (), 90 std::not1 (std::ptr_fun < int, int > (std::isspace))).base(), 91 t.end()); 92 return t; 93 } 94 95 const std::string 96 trim (const std::string& s) 97 { 98 return ltrim (rtrim (s)); 99 } 100 101 const std::string 102 dequote (const std::string& s) 103 { 104 if (!s.empty ()) 105 { 106 char front = s[0]; 107 char back = s[s.length () - 1]; 108 if ((front == '"') || (front == '\'')) 109 { 110 if (front != back) 111 throw rld::error ("invalid quoting", "string: " + s); 112 return s.substr (1, s.length () - (1 + 1)); 113 } 114 } 115 return s; 116 } 117 118 const std::string 119 find_replace(const std::string& sin, 120 const std::string& out, 121 const std::string& in) 122 { 123 std::string s = sin; 124 size_t pos = 0; 125 while ((pos = s.find (out, pos)) != std::string::npos) 126 { 127 s.replace (pos, out.length (), in); 128 pos += in.length (); 129 } 130 return s; 131 } 132 133 const strings 134 split (strings& se, 135 const std::string& s, 136 char delimiter, 137 bool strip_quotes, 138 bool strip_whitespace, 139 bool empty) 140 { 141 std::stringstream ss(s); 142 std::string e; 143 se.clear (); 144 while (std::getline (ss, e, delimiter)) 145 { 146 if (strip_whitespace) 147 e = trim (e); 148 if (strip_quotes) 149 e = dequote (e); 150 if (empty || !e.empty ()) 151 { 152 se.push_back (e); 153 } 154 } 155 return se; 156 } 157 158 const std::string 159 join (const strings& ss, const std::string& separator) 160 { 161 std::string s; 162 for (strings::const_iterator ssi = ss.begin (); 163 ssi != ss.end (); 164 ++ssi) 165 { 166 s += *ssi; 167 if ((ssi + 1) != ss.end ()) 168 s += separator; 169 } 170 return s; 171 } 172 173 const std::string 174 tolower (const std::string& sin) 175 { 176 std::string s = sin; 177 std::transform (s.begin (), s.end (), s.begin (), ::tolower); 178 return s; 179 } 67 180 68 181 void … … 91 204 { 92 205 return rld::to_string (RTEMS_VERSION); 206 } 207 208 void 209 set_progname (const std::string& progname_) 210 { 211 progname = rld::path::path_abs (progname_); 212 } 213 214 const std::string 215 get_progname () 216 { 217 return progname; 218 } 219 220 const std::string 221 get_program_name () 222 { 223 return rld::path::basename (progname); 224 } 225 226 const std::string 227 get_program_path () 228 { 229 return rld::path::dirname (progname); 230 } 231 232 const std::string 233 get_prefix () 234 { 235 std::string pp = get_program_path (); 236 std::cout << "PP=" << pp << std::endl; 237 if (rld::path::basename (pp) == "bin") 238 pp = rld::path::dirname (pp); 239 return pp; 93 240 } 94 241 -
linkers/rld.h
rb28e8b3 r6506aa1 127 127 * Does a string start with another string ? 128 128 */ 129 inline bool starts_with(const std::string& s1, const std::string& s2) 130 { 131 return s2.size () <= s1.size () && s1.compare (0, s2.size (), s2) == 0; 132 } 129 bool starts_with(const std::string& s1, const std::string& s2); 133 130 134 131 /** 135 132 * Trim from start. 136 133 */ 137 inline std::string& ltrim (std::string &s) 138 { 139 s.erase (s.begin (), 140 std::find_if (s.begin (), s.end (), 141 std::not1 (std::ptr_fun < int, int > (std::isspace)))); 142 return s; 143 } 134 const std::string ltrim (const std::string& s); 144 135 145 136 /** 146 137 * Trim from end. 147 138 */ 148 inline std::string& rtrim (std::string &s) 149 { 150 s.erase (std::find_if (s.rbegin (), s.rend (), 151 std::not1 (std::ptr_fun < int, int > (std::isspace))).base(), 152 s.end()); 153 return s; 154 } 139 const std::string rtrim (const std::string& s); 155 140 156 141 /** 157 142 * Trim from both ends. 158 143 */ 159 inline std::string& trim (std::string &s) 160 { 161 return ltrim (rtrim (s)); 162 } 144 const std::string trim (const std::string& s); 163 145 164 146 /** 165 147 * Dequote a string. 166 148 */ 167 inline std::string dequote (const std::string& s) 168 { 169 if (!s.empty ()) 170 { 171 char front = s[0]; 172 char back = s[s.length () - 1]; 173 if ((front == '"') || (front == '\'')) 174 { 175 if (front != back) 176 throw rld::error ("invalid quoting", "string: " + s); 177 return s.substr (1, s.length () - (1 + 1)); 178 } 179 } 180 return s; 181 } 149 const std::string dequote (const std::string& s); 182 150 183 151 /** 184 152 * Find and replace. 185 153 */ 186 inline std::string find_replace(const std::string& sin, 187 const std::string& out, 188 const std::string& in) 189 { 190 std::string s = sin; 191 size_t pos = 0; 192 while ((pos = s.find (out, pos)) != std::string::npos) 193 { 194 s.replace (pos, out.length (), in); 195 pos += in.length (); 196 } 197 return s; 198 } 154 const std::string find_replace(const std::string& sin, 155 const std::string& out, 156 const std::string& in); 199 157 200 158 /** … … 204 162 * @todo The split should optionally honour string quoting. 205 163 */ 206 inline strings split (strings& se, 207 const std::string& s, 208 char delimiter = ' ', 209 bool strip_quotes = true, 210 bool strip_whitespace = true, 211 bool empty = false) 212 { 213 std::stringstream ss(s); 214 std::string e; 215 se.clear (); 216 while (std::getline (ss, e, delimiter)) 217 { 218 if (strip_whitespace) 219 trim (e); 220 if (strip_quotes) 221 e = dequote (e); 222 if (empty || !e.empty ()) 223 { 224 se.push_back (e); 225 } 226 } 227 return se; 228 } 164 const strings split (strings& se, 165 const std::string& s, 166 char delimiter = ' ', 167 bool strip_quotes = true, 168 bool strip_whitespace = true, 169 bool empty = false); 229 170 230 171 /** 231 172 * Join the strings together with the separator. 232 173 */ 233 inline std::string join (const strings& ss, 234 const std::string& separator) 235 { 236 std::string s; 237 for (strings::const_iterator ssi = ss.begin (); 238 ssi != ss.end (); 239 ++ssi) 240 { 241 s += *ssi; 242 if ((ssi != ss.begin ()) && (ssi != ss.end ())) 243 s += separator; 244 } 245 return s; 246 } 174 const std::string join (const strings& ss, const std::string& separator); 247 175 248 176 /** 249 177 * Convert a string to lower case. 250 178 */ 251 inline std::string tolower (const std::string& sin) 252 { 253 std::string s = sin; 254 std::transform (s.begin (), s.end (), s.begin (), ::tolower); 255 return s; 256 } 179 const std::string tolower (const std::string& sin); 257 180 258 181 /** … … 278 201 279 202 /** 203 * Set the progname. 204 */ 205 void set_progname (const std::string& progname); 206 207 /** 208 * Get the progname. This is an absolute path. 209 */ 210 const std::string get_progname (); 211 212 /** 213 * Get the program name. 214 */ 215 const std::string get_program_name (); 216 217 /** 218 * Get the program path. 219 */ 220 const std::string get_program_path (); 221 222 /** 223 * Get the current install prefix. If the path to the executable has 'bin' as 224 * the executable's parent directory it is assumed the executable has been 225 * installed under a standard PREFIX. If "bin" is not found return the 226 * executable's absolute path. 227 */ 228 const std::string get_prefix (); 229 230 /** 280 231 * Map of the symbol table. 281 232 */ … … 283 234 284 235 /** 285 * Warn i sexternals in referenced object files are not used.236 * Warn if externals in referenced object files are not used. 286 237 */ 287 238 void warn_unused_externals (rld::files::object_list& objects); -
linkers/rtems-ld.cpp
rb28e8b3 r6506aa1 357 357 { 358 358 if (rtems_path.empty ()) 359 throw rld::error (" arch/bsp provide and no RTEMS path", "options");359 throw rld::error ("No RTEMS path provide with arch/bsp", "options"); 360 360 rld::rtems::set_path (rtems_path); 361 361 rld::rtems::set_arch_bsp (rtems_arch_bsp); -
linkers/rtems-tld.cpp
rb28e8b3 r6506aa1 91 91 * Return the function's declaration. 92 92 */ 93 const std::string decl ( ) const;93 const std::string decl (const std::string& prefix = "") const; 94 94 }; 95 95 … … 195 195 196 196 /** 197 * Get the traces. 198 */ 199 const rld::strings& get_traces () const; 200 201 /** 197 202 * Dump the wrapper. 198 203 */ … … 322 327 323 328 const std::string 324 signature::decl ( ) const325 { 326 std::string ds = ret + ' ' + name + '(';329 signature::decl (const std::string& prefix) const 330 { 331 std::string ds = ret + ' ' + prefix + name + '('; 327 332 int arg = 0; 328 333 for (function_args::const_iterator ai = args.begin (); … … 486 491 * 487 492 * # name The name of trace being linked. 488 * # bsp The architecture/bsp name of the BSP.489 493 * # options A list of options as per the long command line args. 490 494 * # traces The list of sections containing function lists to trace. … … 504 508 505 509 name = section.get_record_item ("name"); 506 bsp = section.get_record_item ("bsp");507 510 508 511 load_functions (config, section); … … 641 644 642 645 c.write_line(""); 643 c.write_line(sig.decl ( ));646 c.write_line(sig.decl ("__wrap_")); 644 647 c.write_line("{"); 645 648 … … 656 659 } 657 660 658 l += " " + generator_.map_sym_prefix+ sig.name + '(';661 l += " __real_" + sig.name + '('; 659 662 for (size_t a = 0; a < sig.args.size (); ++a) 660 663 { … … 680 683 } 681 684 685 const rld::strings& 686 tracer::get_traces () const 687 { 688 return traces; 689 } 690 682 691 void 683 692 tracer::dump (std::ostream& out) const … … 711 720 const std::string& trace) 712 721 { 722 std::string sp = get_prefix (); 723 724 rld::path::path_join (sp, "share", sp); 725 rld::path::path_join (sp, "rtems", sp); 726 rld::path::path_join (sp, "trace-linker", sp); 727 728 if (rld::verbose () || true) 729 std::cout << "search path: " << sp << std::endl; 730 731 config.set_search_path (sp); 713 732 config.clear (); 714 733 config.load (path); … … 760 779 void 761 780 linker::link (rld::process::tempfile& o, 762 const std::string& ld_cmds) 763 { 764 781 const std::string& ld_cmd) 782 { 783 rld::process::arg_container args; 784 785 if (rld::verbose ()) 786 std::cout << "linking: " << o.name () << std::endl; 787 788 std::string wrap = " -Wl,--wrap -Wl,"; 789 790 rld::cc::make_ld_command (args); 791 792 args.push_back (o.name ()); 793 794 rld::process::args_append (args, ld_cmd); 795 rld::process::args_append (args, 796 wrap + rld::join (tracer_.get_traces (), wrap)); 797 798 rld::process::tempfile out; 799 rld::process::tempfile err; 800 rld::process::status status; 801 802 status = rld::process::execute (rld::cc::get_ld (), 803 args, 804 out.name (), 805 err.name ()); 806 807 if ((status.type != rld::process::status::normal) || 808 (status.code != 0)) 809 { 810 err.output (rld::cc::get_cc (), std::cout); 811 throw rld::error ("Linker error", "linking"); 812 } 765 813 } 766 814 … … 793 841 { "warn", no_argument, NULL, 'w' }, 794 842 { "keep", no_argument, NULL, 'k' }, 843 { "compiler", required_argument, NULL, 'c' }, 795 844 { "linker", required_argument, NULL, 'l' }, 796 845 { "exec-prefix", required_argument, NULL, 'E' }, 797 { "cflags", required_argument, NULL, ' c' },846 { "cflags", required_argument, NULL, 'f' }, 798 847 { "rtems", required_argument, NULL, 'r' }, 799 848 { "rtems-bsp", required_argument, NULL, 'B' }, … … 808 857 std::cout << "rtems-trace-ld [options] objects" << std::endl 809 858 << "Options and arguments:" << std::endl 810 << " -h : help (also --help)" << std::endl 811 << " -V : print linker version number and exit (also --version)" << std::endl 812 << " -v : verbose (trace import parts), can supply multiple times" << std::endl 813 << " to increase verbosity (also --verbose)" << std::endl 814 << " -w : generate warnings (also --warn)" << std::endl 815 << " -k : keep temporary files (also --keep)" << std::endl 816 << " -l linker : target linker is not standard (also --linker)" << std::endl 817 << " -E prefix : the RTEMS tool prefix (also --exec-prefix)" << std::endl 818 << " -c cflags : C compiler flags (also --cflags)" << std::endl 819 << " -r path : RTEMS path (also --rtems)" << std::endl 820 << " -B bsp : RTEMS arch/bsp (also --rtems-bsp)" << std::endl 821 << " -W wrapper : wrapper file name without ext (also --wrapper)" << std::endl 822 << " -C ini : user configuration INI file (also --config)" << std::endl; 859 << " -h : help (also --help)" << std::endl 860 << " -V : print linker version number and exit (also --version)" << std::endl 861 << " -v : verbose (trace import parts), can supply multiple times" << std::endl 862 << " to increase verbosity (also --verbose)" << std::endl 863 << " -w : generate warnings (also --warn)" << std::endl 864 << " -k : keep temporary files (also --keep)" << std::endl 865 << " -c compiler : target compiler is not standard (also --compiler)" << std::endl 866 << " -l linker : target linker is not standard (also --linker)" << std::endl 867 << " -E prefix : the RTEMS tool prefix (also --exec-prefix)" << std::endl 868 << " -f cflags : C compiler flags (also --cflags)" << std::endl 869 << " -r path : RTEMS path (also --rtems)" << std::endl 870 << " -B bsp : RTEMS arch/bsp (also --rtems-bsp)" << std::endl 871 << " -W wrappe r : wrapper file name without ext (also --wrapper)" << std::endl 872 << " -C ini : user configuration INI file (also --config)" << std::endl; 823 873 ::exit (exit_code); 824 874 } … … 868 918 { 869 919 rld::trace::linker linker; 920 std::string cc; 870 921 std::string ld; 871 922 std::string ld_cmd; … … 878 929 while (true) 879 930 { 880 int opt = ::getopt_long (argc, argv, "hvwkV l:E:c:C:r:B:W:", rld_opts, NULL);931 int opt = ::getopt_long (argc, argv, "hvwkVc:l:E:f:C:r:B:W:", rld_opts, NULL); 881 932 if (opt < 0) 882 933 break; … … 904 955 break; 905 956 957 case 'c': 958 cc = optarg; 959 break; 960 906 961 case 'l': 907 962 ld = optarg; … … 912 967 break; 913 968 914 case ' c':969 case 'f': 915 970 rld::cc::append_flags (optarg, rld::cc::ft_cflags); 916 971 break; … … 942 997 } 943 998 999 /* 1000 * Set the program name. 1001 */ 1002 rld::set_progname (argv[0]); 1003 944 1004 argc -= optind; 945 1005 argv += optind; … … 954 1014 { 955 1015 if (rtems_path.empty ()) 956 throw rld::error (" arch/bsp provide and no RTEMS path", "options");1016 throw rld::error ("No RTEMS path provide with arch/bsp", "options"); 957 1017 rld::rtems::set_path (rtems_path); 958 1018 rld::rtems::set_arch_bsp (rtems_arch_bsp); 959 1019 } 960 1020 1021 /** 1022 * Set the compiler and/or linker if provided. 1023 */ 1024 if (!cc.empty ()) 1025 rld::cc::set_cc (cc); 1026 if (!ld.empty ()) 1027 rld::cc::set_ld (ld); 1028 961 1029 /* 962 1030 * Load the remaining command line arguments into the linker command line. 963 1031 */ 964 1032 while (argc--) 965 ld_cmd += ' ' + *argv++; 1033 { 1034 /* 1035 * Create this value because 'ld_cmd += ' ' + *argv++' fails on clang. 1036 */ 1037 std::string av = *argv++; 1038 ld_cmd += ' ' + av; 1039 } 966 1040 ld_cmd = rld::trim (ld_cmd); 967 1041 -
linkers/wscript
rb28e8b3 r6506aa1 166 166 linkflags = bld.linkflags, 167 167 use = modules) 168 bld.install_files('${PREFIX}/share/rtems/trace-linker', 169 ['rtems.ini', 'rtld-base.ini']) 168 170 169 171 #
Note: See TracChangeset
for help on using the changeset viewer.