X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/blobdiff_plain/7fd44afcd021048ac0fdddd12c64a4c310922031..HEAD:/docs/developer/clang/index.html diff --git a/docs/developer/clang/index.html b/docs/developer/clang/index.html index 88579287..1c186f89 100644 --- a/docs/developer/clang/index.html +++ b/docs/developer/clang/index.html @@ -1,14 +1,4 @@ - - - - -Compiling DragonFly BSD using llvm/clang - - - - - - +
-

Compiling DragonFly BSD using llvm/clang

- + + +

Overview

-This page tracks the progress on an effort to compile the DragonFly -BSD system with llvm/clang instead of gcc. +This page tracks the progress on an effort to compile DragonFly with llvm/clang instead of gcc.

How?

+First, you'll need to build clang as described here (it builds out of the box on DragonFly). +
-cd sys/config
-config GENERIC
-cd ../compile/GENERIC
-make depend
-env CC=clang COPTFLAGS=-O make MODULES_OVERRIDE=
-make install MODULES_OVERRIDE=
+cd /usr/src
+env WORLD_CCVER=clang make -DNO_GCC44 buildworld
+env WORLD_CCVER=clang make buildkernel KERNCONF=...
 
-

HostInfo patch

-This patch enables a DragonFly BSD target for ccc with its own toolchain configuration. - - -

Notes

-llvm/clang bug #3812 was reopened as it seems to be an actual bug. The patch (atomic.patch) is only intended to be TEMPORARY and will kill gcc compatibility! I will update this as soon as a llvm/clang is fixed. - -

Status (Kernel/pc32)

@@ -66,9 +77,7 @@ href="http://llvm.org/bugs/show_bug.cgi?id=3805">#3805 llvm/clang bug #3812. - - +
GENERIC 67025 Boots, seems to work ok network adapters removed from system
GENERIC 67025 Boots, survives stress test (buildworld)This patch temporarily fixes the previous boot issue (see NOTES), no further problems so far.
LINT 69545 Doesn't compile Filed llvm/clang bug #4022, also: clang doesn't know itry and another issue possibly related to the bug report
GENERIC 67025 Boots, survives stress test (buildworld)
@@ -79,59 +88,40 @@ href="http://llvm.org/bugs/show_bug.cgi?id=4022">#4022, also: clang doesn't world 67025 Doesn't compile all Filed llvm/clang bug #3853 world 69545 Partially compiles lib/libcIssue with zero-size arrays (see note below), filed llvm/clang bug #4020 +href="http://llvm.org/bugs/show_bug.cgi?id=4020">#4020 Edit: This commit solves this issue -

Zero-size arrays

-While currently no decision has been made by the llvm/clang team on whether to support zero-size arrays or not, imho we should remove all its uses. Main problem currently occurs with genassym and related code (e.g. asmcontext.c (lib/libc)), as the output is not correct for clang due to some array sizes being 1 instead of 0. (see llvm/clang oddities - zero-size arrays) -

Related llvm/clang bug reports

- + - - + +
Bug #Bug DescriptionAffects Status
3805ccc ignores -x assembler-with-cppbuild of locore.sFixed
3812assembler doesn't properly process clobber,input and output register listsatomic_intr_cond_try in atomic.hOpen
3812assembler doesn't properly process clobber,input and output register listsatomic_intr_cond_try in atomic.hClosed
3822failed assertion with -O2build of GENERIC with -O2Fixed
3853__thread keyword not supportedbuild of all userland base toolsFixed
4007 clang doesn't know -Werror-foo is the same as -Werror=foobarrage of warnings during make dependFixed
4020clang doesn't allow zero-sized arraysbuild of lib/libcNew
4022incorrect handling of __inlinebuild of LINTNew
4020clang doesn't allow zero-sized arraysbuild of lib/libcClosed (won't fix)
4022incorrect handling of __inlinebuild of LINTClosed
-

Current Log

-This is the log of the previous problem which already was solved with a temporary fix (see atomic.patch above) and which was reported to llvm/clang for a permanent fix. -
-Page fault during DHCP configuration at boot:
-Fatal trap 12: page fault while in kernel mode
-Fault virtual address = 0x0
-fault code = supervisor write, page not present
-code segment = base 0x0
-Stopped at atomic_intr_cond_try+0xC: btsl $0x1f, 0(%eax)
-
-
-
- -
- +

atomic_intr_cond_try

+The long standing atomic_intr_cond_try issue has been solved in commit caae4d604234d17dff3080f60624a583965c2cf4.

llvm/clang oddities

zero-size arrays

-llvm/clang doesn't support zero sized arrays and automatically generates arrays with a size 1 when a zero-size array is specified. This causes problems with current genassym and asmcontext.c (lib/libc) as these rely on zero-sized arrays.
-This also makes it impossible to use make depend with clang for sys. - +llvm/clang doesn't support zero sized arrays and automatically generates arrays with a size 1 when a zero-size array is specified. +

__i386__ vs i386

- NOTE: This issue has been fixed in this commit.
- - +