The idea of this thread, post what you have working under FreeBSD+clang and perhaps any hacks you had to do to get there. If anything, this will be a good thread to go to if you are having issues with something built by clang and you could ask (politely) of the poster to tell you how they got a program to work with clang.
Check out my active pastebin:
http://pastebin.com/u/falkclang
What I have working with clang (and how I did it):
First of all, how I got world, the kernel, and a release working:
I pulled the 201105-amd64-dvd1 iso from the CURRENT builds, and installed that (I just installed base, kern, src, and lib32).
I created /etc/make.conf with the the following contents:
(Somewhat modified /etc/make.conf from http://wiki.freebsd.org/BuildingFreeBSDWithClang)
Then I got ports with:
Then extracted it with:
Then installed the devel/subversion-freebsd port (`make install clean`)
I then made a working directory and changed into it.
Then you have to check out the source
Now it's time to build!
Build the world:
Build the kernel (GENERIC in this case):
And make a release:
Now you can grab the iso from /usr/obj/root/freebsd-9.0-native-clang/src/release/release.iso (from memory, may be wrong, but it's close enough).
Now you plop that iso on a CD like any other iso and install 9.0-native-clang.
I happen to install with ONLY base, kern, and src for my main builds (I do a full world build for i386 in a chroot).
From here I edited /etc/make.conf and put the same contents from above, fetched and extracted ports like above, and started building ports.
Summary/list of ports:
Note: Feel free to ask about ANYTHING I have said here, the whole point of this thread is to tell other clang users what I have done, so if they need help they can ask me.
(Hopefully others contribute to this thread to make a reliable page for others to get help from)
I'll be working on a wiki page for this or putting it in http://wiki.freebsd.org/PortsAndClang, but I don't want that page to become too clobbered.
-Brandon Falk
Check out my active pastebin:
http://pastebin.com/u/falkclang
What I have working with clang (and how I did it):
First of all, how I got world, the kernel, and a release working:
I pulled the 201105-amd64-dvd1 iso from the CURRENT builds, and installed that (I just installed base, kern, src, and lib32).
I created /etc/make.conf with the the following contents:
Code:
.if !defined(CC) || ${CC} == "cc"
CC=clang
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=clang++
.endif
.if !defined(CPP) || ${CPP} == "cpp"
CPP=clang-cpp
.endif
NO_WERROR=
WERROR=
NO_FSCHG=
CPUTYPE?=native
(Somewhat modified /etc/make.conf from http://wiki.freebsd.org/BuildingFreeBSDWithClang)
Then I got ports with:
Code:
portsnap fetch
Code:
portsnap extract
Then installed the devel/subversion-freebsd port (`make install clean`)
I then made a working directory and changed into it.
Code:
mkdir /freebsd-9.0-native-clang
Code:
cd /freebsd-9.0-native-clang
Then you have to check out the source
Code:
svn co http://svn.freebsd.org/base/head src
Code:
cd src
Now it's time to build!
Build the world:
Code:
make buildworld
Code:
make buildkernel
Code:
cd release/
Code:
make release
Now you can grab the iso from /usr/obj/root/freebsd-9.0-native-clang/src/release/release.iso (from memory, may be wrong, but it's close enough).
Now you plop that iso on a CD like any other iso and install 9.0-native-clang.
I happen to install with ONLY base, kern, and src for my main builds (I do a full world build for i386 in a chroot).
From here I edited /etc/make.conf and put the same contents from above, fetched and extracted ports like above, and started building ports.
Summary/list of ports:
Code:
world, kernel, and release from r224402
www/firefox 5.0
[INDENT]This fails due to some @rel assembly issues, to fix this error edit work/mozilla-release/js/src/ctypes/libffi/src/x86/unix64.S
At line 357 change '.long .LUW0@rel' to '.long .LUW0-.'
At line 399 change '.long .LUW5@rel' to '.long .LUW5-.'
(Note the #if HAVE_AS_X86_PCREL that does this for us, but for some reason that define is not set thus it takes the wrong code)
After this, firefox compiled fine as normal
[/INDENT]
editors/vim 7.3.121
shells/bash 4.1-010
x11/xorg 1.7.7
x11/gtk-theme-switch2 2.0.0rc2
x11-themes/gtk-engines2 2.20.2
x11/nvidia-driver 275.21
[INDENT]I built the x11/nvidia-driver first then built the 275.21 driver from
online after having multiple issues with the x11/nvidia-driver. You have to
comment out the line in the source that throws an #error if you're using FreeBSD 9[/INDENT]
irc/irssi 0.8.15
emulators/linux_base-f10
www/nspluginwrapper 1.4.4
www/linux-f10-flashplugin10 10.3r181.34
Inside i386 chroot (r224402 buildworld and installworld with clang)
emulators/wine 1.3.25
[INDENT]When installing wine, dlls/msvcrt and dlls/ntdll both have issues with clang,
I simply modified the Makefiles for these and built ONLY these 2 dlls with gcc.
I'll work on a 'proper' fix later, but this allows it to build and install.[/INDENT]
x11/nvidia-driver 275.21
[INDENT]Same as above, but I only did `make depend` then installed the latest
driver.[/INDENT]
Probably some others that I'm forgetting...
Note: Feel free to ask about ANYTHING I have said here, the whole point of this thread is to tell other clang users what I have done, so if they need help they can ask me.
(Hopefully others contribute to this thread to make a reliable page for others to get help from)
I'll be working on a wiki page for this or putting it in http://wiki.freebsd.org/PortsAndClang, but I don't want that page to become too clobbered.
-Brandon Falk