Spec URL: http://www.red-bean.com/~bos/fedora/llvm.spec SRPM URL: http://www.red-bean.com/~bos/fedora/llvm-1.9-1.fc7.src.rpm Description: LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, and idle-time optimization of programs from arbitrary programming languages. It currently supports compilation of C and C++ programs. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality.
The llvm package includes a build of gcc. Because both llvm and gcc are compilers, expect lots of warnings from rpmlint :-)
This deserves a review as llvm is being used all over the place these days. However, I'm not sure I'm up to tackling this on my own, but I can at least give it a little attention. Here are a few comments after a quick skim: URL has a typo (extra period). Upstream released 2.0 not long after this package was submitted. The License: tag for the NCSA license is just "NCSA". Other License: tags will need updating for current licensing guidelines; I think the GCC versions included are GPLv2+ but I didn't check. You probably do want to build the documentation in the final package. The compiler packages seem to meet the naming conventions used by other cross-compilers (avr-gcc, etc.) so that's OK. The build fails for me in curent rawhide, although frankly I don't understand what's up unless the system headers have suddenly become broken: if g++ -I/builddir/build/BUILD/llvm-1.9/lib/Support -I/builddir/build/BUILD/llvm-1.9/lib/Support -I/builddir/build/BUILD/llvm-1.9/include -I/builddir/build/BUILD/llvm-1.9/include -I/builddir/build/BUILD/llvm-1.9/include -I/builddir/build/BUILD/llvm-1.9/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_DEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -c -MD -MT /builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.o -MP -MF /builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.LACXXd Allocator.cpp -o /builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.o ;\ then /bin/mv -f "/builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.LACXXd" "/builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.d"; \ else /bin/rm -f "/builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.LACXXd"; exit 1; fi /usr/include/bits/unistd.h: In function 'int gethostname(char*, size_t)': /usr/include/bits/unistd.h:225: error: declaration of 'int gethostname(char*, size_t) throw ()' throws different exceptions /usr/include/unistd.h:845: error: from previous declaration 'int gethostname(char*, size_t)' /usr/include/bits/unistd.h: In function 'int getdomainname(char*, size_t)': /usr/include/bits/unistd.h:243: error: declaration of 'int getdomainname(char*, size_t) throw ()' throws different exceptions /usr/include/unistd.h:864: error: from previous declaration 'int getdomainname(char*, size_t)' Allocator.cpp: In member function 'void* llvm::BumpPtrAllocator::Allocate(unsigned int, unsigned int)': Allocator.cpp:95: warning: dereferencing type-punned pointer will break strict-aliasing rules make[1]: *** [/builddir/build/BUILD/llvm-1.9/lib/Support/Release/Allocator.o] Error 1 I can't say much more without building it.
Turns out that build error is a problem with rawhide G++: https://www.redhat.com/archives/fedora-devel-list/2007-September/msg01647.html I'll try rebuilding this when the fix makes it out.
Coming back to this, I find that the package still fails to build in rawhide, although for a completely different reason: llvm[1]: Building llvm-config script. echo 's,@LLVM_CXXFLAGS@, -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_DEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Woverloaded-virtual,' > temp.sed echo 's,@LLVM_LDFLAGS@,,' >> temp.sed echo 's,@LLVM_BUILDMODE@,Release,' >> temp.sed /bin/sed -f temp.sed < llvm-config.in > /builddir/build/BUILD/llvm-1.9/Release/bin/llvm-config /bin/sed: file temp.sed line 1: unknown option to `s' make[1]: *** [/builddir/build/BUILD/llvm-1.9/Release/bin/llvm-config] Error 1 Seems the '-Wp,-D_FORTIFY_SOURCE=2' bit which is now passed to the C++ compiler by default conflicts with the use of a comma as the separator on that sed line.
FYI ver. 2.1 is out http://llvm.org/releases/2.1/docs/ReleaseNotes.html
Same problem with 2.1: echo 's,@LLVM_LDFLAGS@,,' >> temp.sed echo 's,@LLVM_BUILDMODE@,Release,' >> temp.sed /bin/sed -f temp.sed < llvm-config.in > /local/data/builder/packages/tmp/llvm-2.1/Release/bin/llvm-config /bin/sed: file temp.sed line 2: unknown option to `s' make[1]: *** [/local/data/builder/packages/tmp/llvm-2.1/Release/bin/llvm-config] Error 1 make[1]: Leaving directory `/local/data/builder/packages/tmp/llvm-2.1/tools/llvm-config' make: *** [all] Error 1
There's been no response at all since the original submission; I'm closing this.
Hmm. I don't recall seeing any of the above comments. Sigh. If you have time to review this, I'll dust the submission off. Otherwise, let's leave it closed.
Jason, do you want to pick it up? Otherwise, I can review it.
I guess closing a ticket is the best way to get attention... I have plenty of other stuff to do, so if anyone else wants to do this then feel free. I just didn't want a very idle ticket around preventing other folks from submitting an llvm package.. A good start would be getting a package that builds.
Taking this over then. Bryan, ready when you are.
OK, I'll dust my patch off ASAP.
Spec: http://www.red-bean.com/~bos/fedora/llvm.spec SRPM: http://www.red-bean.com/~bos/fedora/llvm-2.1-1.fc8.src.rpm
Builds on i386 and x86_64, passes rpmlint. A few notes: I've disabled building the gcc 4.2 front end for now, because I can't get the bootstrapped compiler to compile. The -devel RPM puts a bunch of .o and .a files straight into %{_libdir}. Since the recommended way to use the LLVM tools is to get the libdir and library names using llvm-config, we could move those to e.g. %{_libdir}/llvm if preferred.
Would the gcc compilation problem be because it requires gcc 4.2 or above to compile? (F8 has 4.1.2). In which case you can probably enable it for F9 and above. Moving the *.{o,a} files would be nice, we want to avoid cluttering %{_libdir}. Also, per guideline, -docs should probably be renamed to -doc. Builds on ppc and ppc64 too: http://koji.fedoraproject.org/koji/taskinfo?taskID=361326
Thanks for the quick response. I've made the changes you suggest, updated the spec file, and uploaded a new SRPM. Spec: http://www.red-bean.com/~bos/fedora/llvm.spec SRPM: http://www.red-bean.com/~bos/fedora/llvm-2.1-2.fc8.src.rpm Regarding the GCC front end build failure, I suspect it's got nothing to do with GCC itself. It looks like an obscure script-related bug. I'll try building the 4.0 front end when I have some spare cycles, and see if that gets anywhere. But I don't think that the status of the GCC front end should block the base llvm packages. We can turn it on once we get it sorted out, and nothing in the existing packages will change.
- rpmlint is silent - spec file OK - package builds on all supported platforms - tested to work on x86_64 APPROVED
New Package CVS Request ======================= Package Name: llvm Short Description: The Low Level Virtual Machine Owners: bos Branches: F-8 InitialCC: Cvsextras Commits: yes
cvs done.
Might have found the problem with building the GCC front-end: From llvm-gcc's README.LLVM: "X86-64/AMD-64/EM64-T for any OS other than Darwin/Mac OS X: When targeting non-darwin X86-64/AMD-64/EM64-T, configure with --disable-shared. The LLVM X86-64 backend doesn't support PIC codegen on non-darwin systems yet. If you get a build error, try configuring with --disable-multilib" Our LLVM is configured the other way around, with --disable-static and --enable-shared, *and* --with-pic. Will check if changing those settings result in a buildable LLVM.
Created attachment 292611 [details] Errors from attempt to build llvm-gcc4.0 After several hours spent in vain, I'm giving up for now. Switched to trying to get llvm-gcc4.0 to work, and bizarrely, it would fail (tried omitting the SMP directives; changed nothing), but would always resume to completion if I manually called make from the build directory! The RHEL binaries for llvm-gcc shipped by upstream works, though in a workaround way -- I have to tell it to generate LLVM assembly, and then manually assemble and link the result. At least that's something..
Package Change Request ====================== Package Name: llvm New Branches: EL-6 Owners: salimma InitialCC:
CVS done (by process-cvs-requests.py).