Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Ebuild to build LLVM core targeting arm-apple-darwin
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Tatsh
Apprentice
Apprentice


Joined: 22 Jul 2007
Posts: 178

PostPosted: Sun Oct 23, 2011 11:51 pm    Post subject: [SOLVED]Ebuild to build LLVM core targeting arm-apple-darwin Reply with quote

Solved by using:
Code:

   emake VERBOSE=1 REQUIRES_RTTI=1 || die "emake failed"

just like the llvm ebuild.

Outside of Portage, I can compile this perfectly fine with the same exact ./configure line that Portage will use (AFAIK):
Code:

CFLAGS="-march=native -msse2 -O2 -pipe" LDFLAGS="-Wl,-O1 -Wl,--as-needed" CXXFLAGS="-march=native -msse2 -O2 -pipe" ../llvmgcc42-2335.15/llvmCore/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/arm-apple-darwin/usr/lib64 --target=arm-apple-darwin --prefix=/usr/arm-apple-darwin/usr --enable-optimized --disable-assertions


Ebuild:
Code:
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=3

inherit eutils

DESCRIPTION="Apple's LLVM GCC core."
HOMEPAGE="https://github.com/tatsh/xchain"
SRC_URI="http://opensource.apple.com/tarballs/llvmgcc42/llvmgcc42-2335.15.tar.gz"
RESTRICT="mirror"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
ECONF_SOURCE="../../llvmgcc42-2335.15/llvmCore"

RDEPEND=""
DEPEND="${RDEPEND}
   >=cross-arm-apple-darwin/cctools-806
   >=cross-arm-apple-darwin/ld64-59.4
   >=cross-arm-apple-darwin/sdk-4.2"

src_configure() {
   local target="arm-apple-darwin"
   mkdir -p "${S}"
   cd "${S}"
   
   mkdir llvm-obj
   cd llvm-obj
   econf \
      --target="${target}" \
      --prefix="/usr/${target}/usr" \
      --enable-optimized \
      --disable-assertions
}

src_compile() {
   cd "${S}/llvm-obj"
   emake || die "emake failed"
}

src_install() {
   cd "${S}/llvm-obj"
   emake DESTDIR="${D}" install
}


For some reason, -fno-rtti is passed on a file (I found a few references to RTTI in the Makefiles of the sources) and GCC (4.5.1) does not like this.
Code:

llvm[1]: Building Release-Asserts Archive Library libLLVMSupport.a
make[1]: Leaving directory `/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/lib/Support'
make[1]: Entering directory `/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/utils'
make[2]: Entering directory `/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/utils/TableGen'
llvm[2]: Compiling AsmMatcherEmitter.cpp for Release-Asserts build
In file included from /var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/AsmMatcherEmitter.cpp:78:0:
/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/Record.h: In constructor ‘llvm::VarListElementInit::VarListElementInit(llvm::TypedInit*, unsigned int)’:
/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/Record.h:998:54: error: ‘dynamic_cast’ not permitted with -fno-rtti
/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/AsmMatcherEmitter.cpp: In member function ‘void<unnamed>::AsmMatcherInfo::BuildOperandClasses(llvm::CodeGenTarget&)’:
/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/AsmMatcherEmitter.cpp:798:51: error: ‘dynamic_cast’ not permitted with -fno-rtti
/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/AsmMatcherEmitter.cpp:813:58: error: ‘dynamic_cast’ not permitted with -fno-rtti
/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvmgcc42-2335.15/llvmCore/utils/TableGen/AsmMatcherEmitter.cpp:823:58: error: ‘dynamic_cast’ not permitted with -fno-rtti
/bin/rm: cannot remove `/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/utils/TableGen/Release-Asserts/AsmMatcherEmitter.d.tmp': No such file or directory
make[2]: *** [/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/utils/TableGen/Release-Asserts/AsmMatcherEmitter.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/utils/TableGen'
make[1]: *** [TableGen/.makeall] Error 2
make[1]: Leaving directory `/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15/llvm-obj/utils'
make: *** [all] Error 1
emake failed
 * ERROR: cross-arm-apple-darwin/llvm-4.2.2335.15 failed (compile phase):
 *   emake failed
 *
 * Call stack:
 *     ebuild.sh, line  56:  Called src_compile
 *   environment, line 2509:  Called die
 * The specific snippet of code:
 *       emake || die "emake failed"
 *
 * If you need support, post the output of 'emerge --info =cross-arm-apple-darwin/llvm-4.2.2335.15',
 * the complete build log and the output of 'emerge -pqv =cross-arm-apple-darwin/llvm-4.2.2335.15'.
 * This ebuild is from an overlay named 'x-tatsh-overlay': '/home/tatsh/usr/tatsh-overlay/'
 * The complete build log is located at '/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/temp/environment'.
 * S: '/var/tmp/portage/cross-arm-apple-darwin/llvm-4.2.2335.15/work/llvm-4.2.2335.15'


If you want to try the ebuild, you need to clone my overlay: https://github.com/tatsh/tatsh-overlay

Built outside of Portage:
Code:

llvm[1]: Building Release-Asserts Archive Library libLLVMSupport.a
make[1]: Leaving directory `/home/tatsh/dev/apple-darwin/llvm-obj/lib/Support'
make[1]: Entering directory `/home/tatsh/dev/apple-darwin/llvm-obj/utils'
make[2]: Entering directory `/home/tatsh/dev/apple-darwin/llvm-obj/utils/TableGen'
llvm[2]: Compiling AsmMatcherEmitter.cpp for Release-Asserts build
llvm[2]: Compiling AsmWriterEmitter.cpp for Release-Asserts build
llvm[2]: Compiling AsmWriterInst.cpp for Release-Asserts build
llvm[2]: Compiling CallingConvEmitter.cpp for Release-Asserts build
llvm[2]: Compiling ClangDiagnosticsEmitter.cpp for Release-Asserts build
llvm[2]: Compiling CodeEmitterGen.cpp for Release-Asserts build
llvm[2]: Compiling CodeGenDAGPatterns.cpp for Release-Asserts build
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1609
Location: U.S.A.

PostPosted: Mon Oct 24, 2011 9:28 am    Post subject: Reply with quote

Glad we could be of help. :lol:
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum