# clang builds



## falkman (Nov 30, 2011)

I'm currently taking requests for clang builds. I will post the queue on this post as they come in, and they will arrive on this website (30 minutes to build, 10 minutes to upload):

http://brandonfa.lk/freebsd-clang/

Current build environment:


```
localhost# uname -a
FreeBSD localhost 9.0-RC2 FreeBSD 9.0-RC2 #0: Sat Nov 12 18:35:25 UTC 2011     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

localhost# clang -v
FreeBSD clang version 3.0 (branches/release_30 142614) 20111021
Target: x86_64-unknown-freebsd9.0
Thread model: posix
```

(If you want more environment info, tell me what you want to know)

NOTE: The version of clang that is mentioned above is the one used to build the clang that is used in the build... clang is built during the buildworld/kernel process, and that's what's used to build the world and kernel. My clang version is slightly irrelevant but it could play into the build that is generated for the clang used.

Second note: gcc is still included in the builds, and clang must manually be set to default by adding the lines to make.conf mentioned in http://wiki.freebsd.org/BuildingFreeBSDWithClang.

Third note: These builds are the raw builds, with the only difference of using clang instead of gcc by updating my make.conf. It's built by the following:

`make -j12 buildworld`
`make -j12 buildkernel`
`cd release/`
`make release`

No ricer CFLAGS are used, in fact, no CFLAGS are specified on my end... everything is default/generic.

QUEUE:

```
[url=http://svnweb.freebsd.org/base/head/]head[/URL]                             amd64 (r228148)            - Done
[url=http://svnweb.freebsd.org/base/stable/9/]stable/9[/URL]                         amd64 (r228154)            - Done
[url=http://svnweb.freebsd.org/base/head/]head[/URL]                             amd64 (r228386)            - Done
[url=http://svnweb.freebsd.org/base/stable/9/]stable/9 PRERELEASE[/URL]              amd64 (r228560)            - Done
[url=http://svnweb.freebsd.org/base/head/]head[/URL]                             amd64 (r231589)            - Done
[url=http://svnweb.freebsd.org/base/head/]head[/URL]                             i386  (r231677)            - Done
[url=http://svnweb.freebsd.org/base/head/]head[/URL]                             amd64 (r232477)            - Done
[url=http://svnweb.freebsd.org/base/head/]head[/URL]                             amd64 (r232529)            - Done
[url=http://svnweb.freebsd.org/base/release/9.0.0/]9.0-RELEASE[/URL]                      amd64 (r229307)            - Done
[url=http://svnweb.freebsd.org/base/release/9.0.0/]9.0-RELEASE[/URL]                      i386  (r229307)            - Done
[url=http://svnweb.freebsd.org/base/release/9.0.0/]9.0-RELEASE with Intel_GPU patch[/URL] i386  (r229307)            - Done
```

There are now packages for amd64 on the site:

```
[url=http://brandonfa.lk/freebsd-clang/freebsd-packages-clang-amd64/]amd64-packages[/URL]
```

Looking for more/faster mirrors.

Regards,
Brandon Falk


----------



## gkontos (Nov 30, 2011)

Just out of curiosity, what type of hardware are you using ?

30 minutes sounds very fast for world & kernel with a -j2 flag.

George


----------



## falkman (Nov 30, 2011)

6-core with HT, 24GB ram, SSD for build files (I should be using ram, but I haven't bothered setting up a ramfs).

I'm running with -j12.


----------



## gkontos (Nov 30, 2011)

falkman said:
			
		

> 6-core with HT, 24GB ram, SSD for build files (I should be using ram, but I haven't bothered setting up a ramfs).
> 
> I'm running with -j12.



That makes sense !

Anyway, very nice effort. Maybe this thread should become sticky.

Regards,
George


----------



## falkman (Dec 10, 2011)

Added a new build of head, also, I'm still taking suggestions.

-Brandon Falk


----------



## alie (Dec 10, 2011)

Would be good if you can include Intel_GPU patch too


----------



## gkontos (Dec 10, 2011)

falkman said:
			
		

> Added a new build of head, also, I'm still taking suggestions.
> 
> -Brandon Falk



If you have the space and the bandwidth you could start building ports to packages.


----------



## falkman (Dec 10, 2011)

alie said:
			
		

> Would be good if you can include Intel_GPU patch too



http://people.freebsd.org/~kib/drm/

I'm assuming you want 'all.12.3.patch', but which rev do you want it built against, and what do you want the arch to be?



			
				gkontos said:
			
		

> If you have the space and the bandwidth you could start building ports to packages.



I didn't think about that. I'll make packages for all of the ports I build for my system (To name the main few: x11/xorg, editors/vim, audio/ocp, www/firefox, emulators/linux_base-f10, and all the deps and NVIDIA drivers)

These ports will be for AMD64.


----------



## falkman (Dec 10, 2011)

I have uploaded some ports built with clang up to the website now. Most of them use the default configs, except I tick threaded and detect processor instruction sets automatically settings anywhere where I can find them, I also like using ncurses, so some ports I disable some GUI stuff in favor of ncurses (really only in opencp). There are no special compiler flags besides just using clang, as I did for the release builds.

http://brandonfa.lk/freebsd-clang/freebsd-packages-clang-amd64/

There are 2 files on that page which have md5 and sha256 sums of the files: files.md5 and files.sha256.

-Brandon Falk

(double posted to mark the thread as unread for people who like looking for unread posts instead of polling posts occasionally to search from edited updates... sorry if this is against forum etiquette. Hopefully this topic will become popular enough that people will just check out the main post once and awhile)


----------



## alie (Dec 12, 2011)

Can we turn off debugging options for HEAD since it will impact performance ? Or its already turned off? And someone may come up with FreeBSD benchmarking for both gcc and clang?



			
				falkman said:
			
		

> http://brandonfa.lk/freebsd-clang/freebsd-packages-clang-amd64/



For HEAD or 9-STABLE?




			
				falkman said:
			
		

> I'm assuming you want 'all.12.3.patch', but which rev do you want it built against, and what do you want the arch to be?



Yes with amd64 arch?


----------



## falkman (Dec 12, 2011)

Debugging is on, I'll build one without.

Packages are for HEAD (r228384), but that shouldn't affect the ports at all (besides maybe the clang version used to build them)

I benchmarked a while back:

http://forums.freebsd.org/showthread.php?t=25064

-Brandon Falk


----------



## alie (Dec 14, 2011)

Btw how to create custom iso?


----------



## gkontos (Dec 14, 2011)

alie said:
			
		

> Btw how to create custom iso ?



[CMD=""]# cd /usr/src/release && make release[/CMD]


----------



## falkman (Dec 14, 2011)

gkontos said:
			
		

> [CMD=""]# cd /usr/src/release && make release[/CMD]



And the files by default will end up in /usr/obj/xxx/release/ where xxx is the path you used for the build. You'll see all the .txz files, ISOs, and images. Just don't use the bootonly ISO, as that wouldn't go too well since it wouldn't use the right packages, or find the right packages at all.

I made a build guide here:

http://forums.freebsd.org/showthread.php?t=25339

-Brandon


----------



## alie (Dec 19, 2011)

gkontos said:
			
		

> [CMD=""]# cd /usr/src/release && make release[/CMD]



Is this building all architectures? i386, amd64, etc.? If yes, is there any way to build for amd64 only?


----------



## gkontos (Dec 19, 2011)

alie said:
			
		

> Is this building all architectures? i386, amd64, etc.? If yes, is there any way to build for amd64 only?



No, this will build your architecture only.


----------



## alie (Dec 26, 2011)

Is this project still running?


----------



## falkman (Dec 30, 2011)

Not really... I'm back on Windows for some reversing stuff... and flash was killing me.

I can still do builds in VMs as per request. I just haven't gotten any requests recently.

-Brandon


----------



## alie (Jan 10, 2012)

I thought you are working on FreeBSD HEAD+CLANG+Intel_GPU patch+debug off since the link marked as "Awaiting response"


----------



## falkman (Jan 15, 2012)

Sorry, I was on vacation. But I was waiting for the response to see the GPU patch version and Kernel version, but I'm assuming HEAD? Is HEAD always compatible with the GPU patch, I thought the GPU patch corresponds with a certain revision?

-Brandon


----------



## alie (Jan 15, 2012)

You can use patch for FreeBSD-9.0 here:
http://tsatsenko.ru/files/
We should wait for all.13.0-releng.9.0.patch

and HEAD here:
http://people.freebsd.org/~kib/drm/


----------



## falkman (Feb 14, 2012)

Added:

freebsd-head-clang-amd64-r231589
freebsd-head-clang-i386-r231677

http://www.brandonfa.lk/freebsd-clang/

Regards,
Brandon


----------



## alie (Feb 17, 2012)

falkman said:
			
		

> Added:
> 
> freebsd-head-clang-amd64-r231589
> freebsd-head-clang-i386-r231677
> ...



Cool, with Intel GPU patch and debug off?


----------



## falkman (Mar 5, 2012)

freebsd-head-clang-amd64-r232477
freebsd-head-clang-amd64-r232529

Uploaded.

@Alie: I have not had any success with the patch building on head recently (undefined errors, typical stuff with patches on varying versions). Will try 9-RELEASE once my own system is all up and running (on Windows right now... craving BSD).

-Brandon


----------



## falkman (Mar 5, 2012)

Added

freebsd-release_9_0_0-clang-amd64/
freebsd-release_9_0_0-clang-i386/
freebsd-release_9_0_0-clang-intel_GPU_patch-i386/

GPU patch is version 13.0. All of these release builds have debuggers turned off (however debug symbols are built in, as they are GENERICally).

-Brandon


----------



## alie (Apr 3, 2012)

You can download FreeBSD 9.0-STABLE (amd64) with Intel_GPU patch (13.7) here:
http://www.alielee.com/freebsd/release.iso


----------

