[PATCH] [Shave]: allow Clang to run the target linker.

James Y Knight jyknight at google.com
Wed Jul 1 08:22:53 PDT 2015


================
Comment at: lib/Driver/Tools.cpp:9110
@@ +9109,3 @@
+
+  const char *ToolsRoot = ::getenv("MV_TOOLS_DIR");
+  // The version is numbered 'n.n.n.n' for arbitrary values that are opaque
----------------
Perhaps this should be a default plus a command-line argument, instead of an environment variable?

================
Comment at: lib/Driver/Tools.cpp:9144
@@ +9143,3 @@
+    ToolsRoot = "/usr/local/myriad/tools";
+    ToolsVersion = "00.50.62.5";
+    ToolsCommonDir = "/usr/local/mdk/tools/" + ToolsVersion + "/common";
----------------
Doesn't seem right to hardcode this particular version. Using a default for ToolsRoot if MV_TOOLS_DIR isn't set sounds okay, but presumably should be done up above before the loop.


================
Comment at: lib/Driver/Tools.cpp:9160
@@ +9159,3 @@
+  CmdArgs.push_back("-EL"); // Endianness = little
+  CmdArgs.push_back("-O9"); // Optimization
+  CmdArgs.push_back("--gc-sections");
----------------
"-O9"? That seems weird, and is not actually a thing.

================
Comment at: lib/Driver/Tools.cpp:9198
@@ +9197,3 @@
+                           .Case("bare", Bare)
+                           .Case("oneleon", OneLeon)
+                           .Case("bothleons", BothLeons)
----------------
These (oneleon/bothleons) don't seem to do anything different than "rtems", so I'd remove them

================
Comment at: lib/Driver/Tools.cpp:9221
@@ +9220,3 @@
+    static const char *RTEMSStaticLibs[] = {"librtemsbsp.a", "librtemscpu.a"};
+    static const char *CStaticLibs[] = {"libc.a", "libssp.a",
+                                        "libssp_nonshared.a"};
----------------
Why are these building up explicit paths, instead of adding the proper -L search paths, and then -lc -lssp etc?

http://reviews.llvm.org/D10841

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list