Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 405147 - clang fails to compile on ppc-linux
Summary: clang fails to compile on ppc-linux
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: Normal normal
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-21 13:35 UTC by Fabian Groffen
Modified: 2012-02-22 10:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
PPC conflict compile fix (ppc-compile-fix.patch,946 bytes, patch)
2012-02-21 13:35 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2012-02-21 13:35:38 UTC
Created attachment 302699 [details, diff]
PPC conflict compile fix

While trying to compile clang-3.0 on ppc (not keyworded as far as I know), I am bumping into some problems.

The first is a series of definition/naming conflicts that look like:

In file included from ELFObjectWriter.cpp:33:0:
../Target/PowerPC/MCTargetDesc/PPCFixupKinds.h:16:11: error: expected identifier before numeric constant
../Target/PowerPC/MCTargetDesc/PPCFixupKinds.h:16:11: error: expected unqualified-id before numeric constant
ELFObjectWriter.cpp:1832:1: error: expected '}' at end of input

I solved them using a similar approach done elsewhere in the source by just undef-ing PPC.

Unfortunately, linking the libLLVM.so fails, so this is part one.
Comment 1 Fabian Groffen gentoo-dev 2012-02-21 13:59:05 UTC
Seems this is a known issue:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/044827.html

"Note: You still need to add -UPPC on configure or make."

Probably, because the code I patched is generated.  :(
Comment 2 Bernard Cafarelli gentoo-dev 2012-02-21 14:46:18 UTC
I thought this code would not be compiled with the "clang-only" target, but apparently it is still needed! For llvm this was bug #394183

I'll copy the patch to clang-3.0 tonight
Comment 3 Fabian Groffen gentoo-dev 2012-02-21 14:56:47 UTC
Please, no, it's not.  I'm sorry.  I did a full rebuild now with


    # 405147
    [[ ${CHOST} == powerpc*-linux* ]] && append-flags -UPPC


added to src_prepare  (and inherit flag-o-matic)

And with that it just compiled and installed here!

macbeth clang # clang --version
clang version 3.0 (tags/RELEASE_30/final)
Target: powerpc-unknown-linux-gnu
Thread model: posix
Comment 4 Fabian Groffen gentoo-dev 2012-02-22 10:10:02 UTC
(In reply to comment #2)
> I thought this code would not be compiled with the "clang-only" target, but
> apparently it is still needed! For llvm this was bug #394183
> 
> I'll copy the patch to clang-3.0 tonight

You are right, that's necessary to fix the compilation.

The resulting compiler is quite useless though.  It panics on not that complex code immediately.  I guess it's just not worth looking into fixing it.

Sorry to waste your time!