[cfe-dev] Inconsistency between PowerPC and PPC?

Ed Schouten ed at 80386.nl
Mon Mar 23 10:15:11 PDT 2009


Hi all,

I've noticed the naming of the PowerPC/PPC backend has a lot of
inconsistency when it comes to naming. To start off with, the directory
of the backend is called PowerPC and the files are prefixed with PPC.
This is not a major issue in my opinion, but makes my Clang Makefiles
for the FreeBSD build system a bit more complex than they have to be.

Anyway, with the C++ frontend, there seems to be some inconsistency
between clang-driver and which architecture name is supported by clang:

$ PATH=/usr/obj/powerpc/usr/src/tmp/usr/bin:$PATH CFLAGS='-###' make
testcc -###   test.c  -o test
clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/trunk )
"/usr/obj/powerpc/usr/src/tmp/usr/bin/clang" <snip> "-arch" "ppc" <snip>

If I execute this command by hand, I get:

ERROR: Unable to get target machine: No available targets are compatible with this module

If I change "ppc" to "powerpc", it builds properly.

The following patch seems to fix this:

%%%
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp	(revision 67449)
+++ lib/Driver/Driver.cpp	(working copy)
@@ -973,8 +973,8 @@
     Arch = "i386";
   else if (Arch == "amd64")
     Arch = "x86_64";
-  else if (Arch == "powerpc" || Arch == "Power Macintosh")
-    Arch = "ppc";
+  else if (Arch == "ppc" || Arch == "Power Macintosh")
+    Arch = "powerpc";
   
   if (memcmp(&OS[0], "darwin", 6) == 0)
     return createDarwinHostInfo(*this, Arch.c_str(), Platform.c_str(), 
%%%

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090323/c7d24b79/attachment.sig>


More information about the cfe-dev mailing list