[cfe-commits] [Patch] patches for Minix based on r146035 - switch to ELF and question on shared libraries

Eli Friedman eli.friedman at gmail.com
Wed Dec 7 11:49:58 PST 2011


On Wed, Dec 7, 2011 at 8:01 AM, ben gras <ben at minix3.org> wrote:
> Dear all,
>
> I'd like to submit the attached patch for commit consideration. Minix has
> recently switched to GNU binutils for the de facto assembling/linking part
> of the toolchain, and has switched to ELF as the default object format to
> generate. Also there are some clang subdirs we want to start building. (In
> general we want to be as normal and un-special-cased as possible and we're
> working towards that.) The attached patch is based on r146035 and reflects
> this in the clang code.
>   . build all clang subdirs
>   . switches the Minix platform to ELF
>   . normalizes toolchain invocation
>
> There are more Minix-related changes I'd like to submit in the future but
> these are the 'easiest' (most clear-cut) ones.

Review:

@@ -3734,7 +3734,7 @@
   }

   const char *Exec =
-    Args.MakeArgString(getToolChain().GetProgramPath("gas"));
+    Args.MakeArgString(getToolChain().GetProgramPath("as"));
   C.addCommand(new Command(JA, *this, Exec, CmdArgs));
 }

Why are you changing the AuroraUX tools?

@@ -4594,9 +4594,16 @@
   }

   if (!Args.hasArg(options::OPT_nostdlib) &&
-      !Args.hasArg(options::OPT_nostartfiles))
-    CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(
-
"/usr/gnu/lib/crtso.o")));
+      !Args.hasArg(options::OPT_nostartfiles)) {
+      CmdArgs.push_back(
+	 Args.MakeArgString(getToolChain().GetFilePath("crt1.o")));
+      CmdArgs.push_back(
+	 Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
+      CmdArgs.push_back(
+	 Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
+      CmdArgs.push_back(
+	 Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
+  }

   Args.AddAllArgs(CmdArgs, options::OPT_L);
   Args.AddAllArgs(CmdArgs, options::OPT_T_Group);

Weird indentation.

Otherwise looks fine, assuming this patch does what you want it to do.

> Related to that I have a question: part of our 'patch burden' is because we
> can't generate (and more to the point, use) shared libraries currently. So
> libraries such as libprofile and libclang we have to make non-shared. Is
> there a clean switch in the buildsystem we can toggle so I don't have to
> hack the Makefiles; or another clean way to solve this (i.e. force
> static-only for all libs)?

Not sure.

-Eli




More information about the cfe-commits mailing list