A successful native build using clang at last---just!

Paul Mather paul at gromit.dlib.vt.edu
Mon Sep 16 14:03:15 UTC 2013


On Sep 15, 2013, at 6:02 PM, Warner Losh <imp at bsdimp.com> wrote:

> 
> On Sep 15, 2013, at 3:52 PM, Paul Mather wrote:
> 
>> On Sep 15, 2013, at 5:34 PM, Warner Losh <imp at bsdimp.com> wrote:
>> 
>>> Do you have swap space configured? clang building clang takes a lot of memory...
>> 
>> Yes, I have swap space configured (see item 2 below).  It's on an external USB drive (as are /usr/src and /usr/obj), and the swap partition is 2 GB in size.
> 
> 2GB might not be enough...   I always configure 6GB of swap, but I use a sparse zerod file to do it. Might be worth a shot...

I increased the amount of swap to 6 GB and also moved /tmp from a swap-backed md-device to its own UFS file system on the external USB hard drive I'm using, but I still get an error when doing "make buildkernel":

=====
[[...]]
cc  -c -O -pipe  -std=c99 -g -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  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -funwind-tables -mllvm -arm-enable-ehabi -ffreestanding -Werror  /usr/src/sys/fs/nfsclient/nfs_clsubs.c
cc  -c -O -pipe  -std=c99 -g -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  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -funwind-tables -mllvm -arm-enable-ehabi -ffreestanding -Werror  /usr/src/sys/fs/nfsclient/nfs_clstate.c
Stack dump:
0.	Program arguments: /usr/obj/usr/src/tmp/usr/bin/cc -cc1 -triple armv6--freebsd10.0-gnueabi -S -disable-free -main-file-name nfs_clstate.c -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-abi aapcs-linux -target-cpu arm1136jf-s -msoft-float -mfloat-abi soft -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -g -coverage-file /tmp/nfs_clstate-O8Eo9U.s -nostdsysteminc -nobuiltininc -resource-dir /usr/obj/usr/src/tmp/usr/bin/../lib/clang/3.3 -include opt_global.h -D _KERNEL -D HAVE_KERNEL_OPTION_HEADERS -I . -I /usr/src/sys -I /usr/src/sys/contrib/altq -I /usr/src/sys/contrib/libfdt -isysroot /usr/obj/usr/src/tmp -O2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -Wmissing-include-dirs -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Werror -std=c99 -fno-dwarf-directory-asm -fdebug-compilation-dir /usr/obj/usr/src/sys/BEAGLEBONE -ferror-limit 19 -fmessage-length 0 -ffreestanding -fformat-extensions -mstackrealign -fno-signed-char -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fdiagnostics-show-option -backend-option -vectorize-loops -mllvm -arm-enable-ehabi -o /tmp/nfs_clstate-O8Eo9U.s -x c /usr/src/sys/fs/nfsclient/nfs_clstate.c 
1.	/usr/src/sys/fs/nfsclient/nfs_clstate.c:608:1: current parser token 'static'
2.	/usr/src/sys/fs/nfsclient/nfs_clstate.c:476:1: parsing function body 'nfscl_getstateid'
error: unable to rename temporary '/tmp/nfs_clstate-O8Eo9U.s-2f4669b4' to output file '/tmp/nfs_clstate-O8Eo9U.s': 'No such file or directory'
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/obj/usr/src/sys/BEAGLEBONE
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
=====

The USB hard drive I'm using has its own power supply, and I'm using a 5V 2A power supply with the BeagleBone Black, so I don't think this error is due to flaky power instability.

I've never seen the above error before, and it doesn't make much sense to me.  I'm going to try and see if I can build the BEAGLEBONE kernel natively on my Raspberry Pi, next.  Failing that, it'll have to be another Crochet image for my BeagleBone Black.

Cheers,

Paul.



> 
>> Note, this is a native build.  I don't have problems cross-building FreeBSD/arm using Crochet on FreeBSD/amd64.
> 
> Yea, amd64 machine likely has lots of memory...
> 
> Warner
> 
>> Cheers,
>> 
>> Paul.
>> 
>>> 
>>> Warner
>>> 
>>> 
>>> On Sep 15, 2013, at 3:19 PM, Paul Mather wrote:
>>> 
>>>> After quite a bit of trying, I finally was able to complete a native build and upgrade using clang on FreeBSD/arm.  I used r255420 as the build platform and was able to upgrade to r255586 on my Raspberry Pi.
>>>> 
>>>> Here are some observations:
>>>> 
>>>> 1) For some reason this same upgrade failed on my BeagleBone Black (also running r255420).  It fails early on with this error and doesn't get past it:
>>>> 
>>>> [[...]]
>>>> c++  -O -pipe -I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/include -I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen -I. -I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -fno-strict-aliasing -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-gnueabi-freebsd10.0\" -DLLVM_HOST_TRIPLE=\"armv6-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -I/usr/obj/usr/src/tmp/legacy/usr/include -Wno-c++11-extensions -fno-exceptions -fno-rtti -c /usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TGParser.cpp -o TGParser.o
>>>> Assertion failed: (!FoundVal && "Key already in new map?"), function moveFromOldBuckets, file /usr/src/lib/clang/libclangast/../../../contrib/llvm/include/llvm/ADT/DenseMap.h, line 289.
>>>> Stack dump:
>>>> 0.	Program arguments: /usr/bin/c++ -cc1 -triple armv6--freebsd10.0-gnueabi -S -disable-free -main-file-name TGParser.cpp -mrelocation-model static -mdisable-fp-elim -relaxed-aliasing -mconstructor-aliases -target-abi aapcs-linux -target-cpu arm1136jf-s -msoft-float -mfloat-abi soft -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -coverage-file /tmp/TGParser-KtbaOq.s -resource-dir /usr/bin/../lib/clang/3.3 -D LLVM_ON_UNIX -D LLVM_ON_FREEBSD -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -D LLVM_DEFAULT_TARGET_TRIPLE="armv6-gnueabi-freebsd10.0" -D LLVM_HOST_TRIPLE="armv6-unknown-freebsd10.0" -D DEFAULT_SYSROOT="" -I /usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/include -I /usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/tools/clang/include -I /usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen -I . -I /usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/../../lib/clang/include -I /usr/obj/usr/src/tmp/l
>>>> egacy/usr/include -internal-isystem /usr/include/c++/v1 -O2 -Wno-c++11-extensions -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmtablegen -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-rtti -fno-signed-char -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fdiagnostics-show-option -backend-option -vectorize-loops -o /tmp/TGParser-KtbaOq.s -x c++ /usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TGParser.cpp 
>>>> 1.	/usr/include/c++/v1/locale:3072:48: current parser token 'init'
>>>> 2.	/usr/include/c++/v1/locale:205:1 <Spelling=/usr/include/c++/v1/__config:321:37>: parsing namespace 'std'
>>>> 3.	/usr/include/c++/v1/locale:205:1 <Spelling=/usr/include/c++/v1/__config:321:59>: parsing namespace '__1'
>>>> c++: error: unable to execute command: Abort trap (core dumped)
>>>> c++: error: clang frontend command failed due to signal (use -v to see invocation)
>>>> FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
>>>> Target: armv6--freebsd10.0-gnueabi
>>>> Thread model: posix
>>>> c++: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
>>>> c++: note: diagnostic msg: Error generating preprocessed source(s).
>>>> *** Error code 254
>>>> 
>>>> Stop.
>>>> make[3]: stopped in /usr/src/lib/clang/libllvmtablegen
>>>> *** Error code 1
>>>> 
>>>> Stop.
>>>> make[2]: stopped in /usr/src
>>>> *** Error code 1
>>>> 
>>>> Stop.
>>>> make[1]: stopped in /usr/src
>>>> *** Error code 1
>>>> 
>>>> Stop.
>>>> make: stopped in /usr/src
>>>> 
>>>> 2) The successful upgrade on Raspberry Pi had to be restarted a couple of times (using -DNO_CLEAN) due to hangs.  I have noticed problems with the system when swap is used.  Paging out to swap seems okay, but processes appear to die when they are paged back in from swap.  Sometimes, this hangs the system.
>>>> 
>>>> 3) FWIW, I am running with super pages enabled: vm.pmap.sp_enabled=1.
>>>> 
>>>> Cheers,
>>>> 
>>>> Paul.
>>>> _______________________________________________
>>>> freebsd-arm at freebsd.org mailing list
>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
>>>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
>>> 
>> 
> 



More information about the freebsd-arm mailing list