Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 2013 09:14:08 +0200
From:      =?ISO-8859-1?Q?Ren=E9_Ladan?= <rene@freebsd.org>
To:        freebsd-arm@freebsd.org
Subject:   Re: C++ broken on Raspberry Pi?
Message-ID:  <516CFA40.7000708@freebsd.org>
In-Reply-To: <8B2143F4-0A43-420D-A425-0AECE07885BA@gromit.dlib.vt.edu>
References:  <A47AFDC4-FF21-4BE1-8C57-ADF4F94E951A@gromit.dlib.vt.edu> <1AAD4A90-8EE4-476A-A2B5-3D9989BC1029@bsdimp.com> <8CA34545-59FC-40B4-8797-BAA1D5A63609@gromit.dlib.vt.edu> <108FBB0F-78BF-48D0-97AB-0BE617E4E2E5@bsdimp.com> <8B2143F4-0A43-420D-A425-0AECE07885BA@gromit.dlib.vt.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16-04-2013 03:14, Paul Mather wrote:
> On Apr 15, 2013, at 8:56 PM, Warner Losh <imp@bsdimp.com> wrote:
> 
>>
>> On Apr 15, 2013, at 6:47 PM, Paul Mather wrote:
>>
>>>
>>> On Apr 15, 2013, at 8:45 PM, Warner Losh <imp@bsdimp.com> wrote:
>>>
>>>> Did you run out of memory?
>>>
>>> I don't think I did.  I have 1 GB of swap configured, so, hopefully not.
>>
>> clang eats a lot of memory, maybe you should monitor it with top(1) on another screen/session and see if you run out of swap just before it fails.
>>
>> I'd expect numbers more like 5G to be needed...
> 
> 
> I just tried it again, monitoring with top.  It doesn't even hit swap before failing.  It looks to me it is more an internal compiler error than an out-of-memory error:
>
I filed a bug to upstream for this a few weeks ago:
http://llvm.org/bugs/show_bug.cgi?id=15696


> =====
> c++  -O -pipe -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I. -I/usr/src/lib/clang/libllvmsupport/../../../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-unknown-freebsd10.0\" -DLLVM_HOSTTRIPLE=\"armv6-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -I/usr/obj/usr/src/tmp/legacy/usr/include -fno-exceptions -fno-rtti -c /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp -o APFloat.o
> Assertion failed: ((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 && "Pointer is not sufficiently aligned"), function initWithPointer, file /usr/src/lib/clang/libclangsema/../../../contrib/llvm/include/llvm/ADT/PointerIntPair.h, line 100.
> Stack dump:
> 0.      Program arguments: /usr/bin/c++ -cc1 -triple armv6-unknown-freebsd10.0 -S -disable-free -main-file-name APFloat.cpp -mrelocation-model static -mdisable-fp-elim -relaxed-aliasing -mconstructor-aliases -target-abi apcs-gnu -target-cpu arm1136jf-s -msoft-float -mfloat-abi soft -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -coverage-file /tmp/APFloat-1Uv0ML.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-unknown-freebsd10.0" -D LLVM_HOSTTRIPLE="armv6-unknown-freebsd10.0" -D DEFAULT_SYSROOT="" -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I . -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include -I /usr/obj/usr/src/tmp/legacy/u
>  sr/include -O2 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-rtti -fno-signed-char -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fsjlj-exceptions -fdiagnostics-show-option -backend-option -vectorize-loops -o /tmp/APFloat-1Uv0ML.s -x c++ /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp 
> 1.      /usr/include/c++/4.2/bits/basic_string.tcc:978:43: current parser token ';'
> 2.      /usr/include/c++/4.2/bits/basic_string.tcc:48:1 <Spelling=/usr/include/c++/4.2/bits/c++config.h:76:38>: parsing namespace 'std'
> 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 (trunk 178860) 20130405
> Target: armv6-unknown-freebsd10.0
> 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).
> *** [APFloat.o] Error code 254
> 1 error
> *** [bootstrap-tools] Error code 2
> 1 error
> *** [_bootstrap-tools] Error code 2
> 1 error
> *** [buildworld] Error code 2
> 1 error
> =====
> 
> I.e., the "Assertion failed: ((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 && "Pointer is not sufficiently aligned")"
> 
> BTW, this is on a Raspberry Pi Model B with 16 MB of the 512 MB of RAM for the GPU.
> 
[...]

>>>>
>>>> On Apr 15, 2013, at 6:41 PM, Paul Mather wrote:
>>>>
>>>>> I recently bought a Raspberry Pi and have been running FreeBSD 10-CURRENT on it (r249461).  My system is running an image built using Tim Kientzle's Crochet scripts on a FreeBSD/amd64 10-CURRENT build system.  I just tried doing a native build on the Raspberry Pi itself but the buildworld fails fairly early on:
>>>>>
>>>>> =====
>>>>> [...]
>>>>> mkdep -f .depend -a    -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I. -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-unknown-freebsd10.0\" -DLLVM_HOSTTRIPLE=\"armv6-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -I/usr/obj/usr/src/tmp/legacy/usr/include -std=gnu99   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ConvertUTF.c /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regcomp.c /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regerror.c /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regexec.c /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regfree.c /us
>  r/src
>>>>> /lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regstrlcpy.c
>>>>> mkdep -f .depend -a    -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I. -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-unknown-freebsd10.0\" -DLLVM_HOSTTRIPLE=\"armv6-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -I/usr/obj/usr/src/tmp/legacy/usr/include        /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APInt.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APSInt.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Allocator.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Atomic.cpp /usr/
>  src/l
>>>>> ib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/BlockFrequency.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/BranchProbability.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/CommandLine.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ConstantRange.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ConvertUTFWrapper.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/CrashRecoveryContext.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DAGDeltaAlgorithm.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Debug.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DeltaAlgorithm.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Dwarf.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DynamicLibrary.cpp /usr/src/lib/clang/libllvmsupport/../../../co
>  ntri
>>>>> b/llvm/lib/Support/Errno.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ErrorHandling.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FileOutputBuffer.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FoldingSet.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FormattedStream.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/GraphWriter.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Hashing.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Host.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IncludeFile.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IntEqClasses.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IntervalMap.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IntrusiveRefCntPtr.cpp /usr/src/lib/clang/libllv
>  msup
>>>>> port/../../../contrib/llvm/lib/Support/IsInf.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IsNAN.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Locale.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/LockFileManager.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ManagedStatic.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/MemoryBuffer.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/MemoryObject.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Mutex.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Path.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/PathV2.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/PluginLoader.cpp /usr/src/lib/clang/libllvmsupport/../
>  ../.
>>>>> ./contrib/llvm/lib/Support/PrettyStackTrace.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Process.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Program.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/RWMutex.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Regex.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Signals.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallPtrSet.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallVector.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SourceMgr.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Statistic.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/StreamableMemoryObject.cpp /usr/src
>  /lib
>>>>> /clang/libllvmsupport/../../../contrib/llvm/lib/Support/StringExtras.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/StringMap.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/StringPool.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/StringRef.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/TargetRegistry.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ThreadLocal.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Threading.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/TimeValue.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Timer.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ToolOutputFile.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Triple.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Twine.cpp /usr/src
>  /lib
>>>>> /clang/libllvmsupport/../../../contrib/llvm/lib/Support/Valgrind.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Watchdog.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/YAMLParser.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/YAMLTraits.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/circular_raw_ostream.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os_ostream.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system_error.cpp 
>>>>> c++  -O -pipe -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I. -I/usr/src/lib/clang/libllvmsupport/../../../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-unknown-freebsd10.0\" -DLLVM_HOSTTRIPLE=\"armv6-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -I/usr/obj/usr/src/tmp/legacy/usr/include -fno-exceptions -fno-rtti -c /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp -o APFloat.o
>>>>> Assertion failed: ((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 && "Pointer is not sufficiently aligned"), function initWithPointer, file /usr/src/lib/clang/libclangsema/../../../contrib/llvm/include/llvm/ADT/PointerIntPair.h, line 100.
>>>>> Stack dump:
>>>>> 0.	Program arguments: /usr/bin/c++ -cc1 -triple armv6-unknown-freebsd10.0 -S -disable-free -main-file-name APFloat.cpp -mrelocation-model static -mdisable-fp-elim -relaxed-aliasing -mconstructor-aliases -target-abi apcs-gnu -target-cpu arm1136jf-s -msoft-float -mfloat-abi soft -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -coverage-file /tmp/APFloat-6ga4Rp.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-unknown-freebsd10.0" -D LLVM_HOSTTRIPLE="armv6-unknown-freebsd10.0" -D DEFAULT_SYSROOT="" -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I . -I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include -I /usr/obj/usr/src/tmp/legacy/u
>  sr/in
>>>>> clude -O2 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-rtti -fno-signed-char -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fsjlj-exceptions -fdiagnostics-show-option -backend-option -vectorize-loops -o /tmp/APFloat-6ga4Rp.s -x c++ /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp 
>>>>> 1.	/usr/include/c++/4.2/bits/basic_string.tcc:978:43: current parser token ';'
>>>>> 2.	/usr/include/c++/4.2/bits/basic_string.tcc:48:1 <Spelling=/usr/include/c++/4.2/bits/c++config.h:76:38>: parsing namespace 'std'
>>>>> 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 (trunk 178860) 20130405
>>>>> Target: armv6-unknown-freebsd10.0
>>>>> 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).
>>>>> *** [APFloat.o] Error code 254
>>>>> 1 error
>>>>> *** [bootstrap-tools] Error code 2
>>>>> 1 error
>>>>> *** [_bootstrap-tools] Error code 2
>>>>> 1 error
>>>>> *** [buildworld] Error code 2
>>>>> 1 error
>>>>> =====
>>>>>
>>>>> It seems it is having trouble with C++.  The system is using the 3.3 version of clang:
>>>>>
>>>>> root@pi:/usr/src # c++ -v
>>>>> FreeBSD clang version 3.3 (trunk 178860) 20130405
>>>>> Target: armv6-unknown-freebsd10.0
>>>>> Thread model: posix
>>>>>
>>>>>
>>>>> I had the same problem with clang 3.2, too.  I've also had problems with C++ building ports.  For example, I can't install devel/subversion because it fails to build databases/db42 due to a C++ problem.
>>>>>
This is the same bug, test case #2 in bug 15696 (generated with
devel/delta).

Regards,
René



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?516CFA40.7000708>