Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Aug 2011 11:48:25 +0200
From:      "Hartmann, O." <ohartman@zedat.fu-berlin.de>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   CLANG; still cc in use when building the WORLD with CLANG?
Message-ID:  <4E5CB1E9.9080801@zedat.fu-berlin.de>

next in thread | raw e-mail | index | archive | help

   Hello.
   I'm building world with CLANG  (or I pretend to do so).
   In my /etc/make.conf I use these lines:
   ###
   ###     CLANG
   ###
   .if defined(USE_CLANG)
   .if !empty(.CURDIR:M/usr/src*)
   CFLAGS= -O3 -march=native -mtune=native -fno-strict-aliasing -pipe
   COPTFLAGS= -O3 -march=native -mtune=native -pipe
   .if !defined(CC) || ${CC} == "cc"
   CC=clang
   .endif
   .if !defined(CXX) || ${CXX} == "c++"
   CXX=clang++
   .endif
   # Don't die on warnings
   NO_WERROR=
   WERROR=
   # Don't forget this when using Jails!
   NO_FSCHG=
   .endif
   .endif
   Somewhere at the top of the file I set USE_CLANG=yes
   Watching the build process of the kernel reveals that the system's
   build process still involves the cc when building some portions of the
   UFS, VFS and so on.
   As shown below, several essential portions of the kernel aren't built
   by clang, that includes VFS, NFS, UFS et cetera.
   Am I doing wrong? Or is this no accident and still wanted since
   FreeBSD doesn't build completely with CLANG? As far as I understood,
   the kernel and core system should be ready to be build with clang as a
   whole ...
   [...] right at the beginning of the build process ...
   cc -O2 -pipe -mtune=native -fno-strict-aliasing -march=native -std=c99
   -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
   -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
   -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs
   -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys
   -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter
   -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath
   -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm
   -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD
   -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs
   -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -finline-limit=8000
   --param inline-unit-growth=100 --param large-function-growth=1000
   -fno-omit-frame-pointer -mno-sse -mcmodel=kernel -mno-red-zone
   -mno-mmx -msoft-float -fno-asynchronous-unwind-tables -ffreestanding
   -fstack-protector -c /usr/src/sys/compat/ia32/ia32_genassym.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
   -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
   -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs
   -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys
   -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter
   -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath
   -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm
   -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD
   -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs
   -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -finline-limit=8000
   --param inline-unit-growth=100 --param large-function-growth=1000
   -fno-omit-frame-pointer -mno-sse -mcmodel=kernel -mno-red-zone
   -mno-mmx -msoft-float -fno-asynchronous-unwind-tables -ffreestanding
   -fstack-protector /usr/src/sys/amd64/amd64/genassym.c
   awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src
   -h
   rpcgen -c /usr/src/sys/kgssapi/gssd.x -o gssd_xdr.c
   rpcgen -lM /usr/src/sys/kgssapi/gssd.x | grep -v string.h >
   gssd_clnt.c
   env NM='nm' sh /usr/src/sys/kern/genassym.sh ia32_genassym.o >
   ia32_assym.h
   NM='nm' sh /usr/src/sys/kern/genassym.sh genassym.o > assym.s
   cc -c -x assembler-with-cpp -DLOCORE -O2 -pipe -mtune=native
   -fno-strict-aliasing -march=native -std=c99  -Wall -Wredundant-decls
   -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes
   -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign
   -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option
   -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq
   -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf
   -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal
   -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa
   -I/usr/src/sys/gnu/fs/xfs/FreeBSD
   -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs
   -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror /usr/src/sys/amd64/acpica/acpi_wakecode.S
   objcopy -S -O binary acpi_wakecode.o acpi_wakecode.bin
   nm -n --defined-only acpi_wakecode.o | while read offset dummy what;
   do echo "#define   ${what} 0x${offset}"; done > acpi_wakedata.h
   file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin >
   acpi_wakecode.h
   rm -f .newdep
   and then somewhere in the middle ...
   [...]
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/contrib/dev/acpica/namespace/nsnames.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/contrib/dev/acpica/namespace/nsobject.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/contrib/dev/acpica/namespace/nsparse.c
   [...]
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/kern/syscalls.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/kern/sysv_ipc.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/kern/sysv_msg.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/kern/sysv_sem.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/kern/sysv_shm.c
   [...]
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/vm/uma_dbg.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/vm/vm_glue.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/vm/vm_init.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/vm/vm_kern.c
   [...]
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/dev/usb/usb_error.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/dev/usb/usb_generic.c
   [...]
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/fs/nfsclient/nfs_clvfsops.c
   cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native
   -std=c99  -Wall -Wredundant-decls -Wnested-externs
   -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
   -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I.
   -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL
   -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common
   -finline-limit=8000 --param inline-unit-growth=100 --param
   large-function-growth=1000  -fno-omit-frame-pointer -mno-sse
   -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float
   -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
   -Werror  /usr/src/sys/fs/nfsclient/nfs_clport.c
    [...]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E5CB1E9.9080801>