[PATCH] [MIPS] Add support for direct-to-nacl in Clang

Petar Jovanovic petar.jovanovic at imgtec.com
Thu Jun 25 15:45:28 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/Driver/ToolChains.cpp:2391
@@ +2390,3 @@
+      file_paths.push_back(FilePath + "mipsel-nacl/usr/lib");
+      prog_paths.push_back(ProgPath + "bin");
+      file_paths.push_back(ToolPath + "mipsel-nacl");
----------------
dschuff wrote:
> should this be mipsel-nacl/bin?
> should this be mipsel-nacl/bin?

Not in our version today. "bin" is required/sufficient to find mipsel-nacl-ld.
This way we do not need to install ld into a new location.

================
Comment at: lib/Driver/ToolChains.cpp:2416
@@ +2415,3 @@
+    SmallString<128> P(D.Dir + "/../");
+    llvm::sys::path::append(P, "mipsel-nacl/include/c++/v1");
+    addSystemInclude(DriverArgs, CC1Args, P.str());
----------------
dschuff wrote:
> it seems wrong to include a C++ path here; I don't think this function is C++ specific?
> And in any case, is this intended to override -nobuiltininc?
ooouch, this hunk ended up in the wrong function. 

================
Comment at: lib/Driver/Tools.cpp:1184
@@ +1183,3 @@
+
+  if (Triple.getOS() == llvm::Triple::NaCl) {
+    CmdArgs.push_back("-mllvm");
----------------
dschuff wrote:
> this part may not be upstreamable since the LLVM part that implements it won't be upstreamable.
OK, I will remove it in the next patch set.

================
Comment at: lib/Driver/Tools.cpp:8327
@@ +8326,3 @@
+        // without '-lnacl' it prefers symbols from libpthread.a over libnacl.a,
+        // which is not a desired behaviour here.
+        // See https://sourceware.org/ml/binutils/2015-03/msg00034.html
----------------
dschuff wrote:
> which symbols are causing trouble here, and how? can you give some more detail?
> 
> I wasn't aware of the difference, but I have an unrelated change that may be affected by it.
> which symbols are causing trouble here, 

Symbols that are same in both libraries. One example is picking wrong implementation of __libnacl_irt_thread.

> and how? can you give some more detail?

Take a look at example that Nikola reported at

https://sourceware.org/ml/binutils/2015-03/msg00017.html

http://reviews.llvm.org/D10739

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






More information about the cfe-commits mailing list