Hi folks,
I just tried to build LLVM on FreeBSD/arm. It looks like libSystem
doesn't build and requires the following hack:
--- lib/System/Memory.cpp
+++ lib/System/Memory.cpp
@@ -61,7 +61,7 @@
for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
asm volatile("icbi 0, %0" : : "r"(Line));
asm volatile("isync");
-# elif defined(__arm__) && defined(__GNUC__)
+# elif defined(__arm__) && defined(__GNUC__) &&
!defined(__FreeBSD__)
// FIXME: Can we safely always call this for __GNUC__ everywhere?
char *Start = (char*) Addr;
char *End = Start + Len;
I don't know anything about ARM, but isn't there a way we can do this
using some inline asm instead of calling a glibc-function?
Greetings,
--
Ed Schouten <ed at 80386.nl>
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100513/03f19f3e/attachment.sig>
Dimitry Andric
2010-May-13 20:15 UTC
[LLVMdev] libSystem, __clear_cache(), FreeBSD and ARM
On 2010-05-13 19:07, Ed Schouten wrote:> --- lib/System/Memory.cpp > +++ lib/System/Memory.cpp > @@ -61,7 +61,7 @@ > for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) > asm volatile("icbi 0, %0" : : "r"(Line)); > asm volatile("isync"); > -# elif defined(__arm__) && defined(__GNUC__) > +# elif defined(__arm__) && defined(__GNUC__) && !defined(__FreeBSD__) > // FIXME: Can we safely always call this for __GNUC__ everywhere? > char *Start = (char*) Addr; > char *End = Start + Len; > > I don't know anything about ARM, but isn't there a way we can do this > using some inline asm instead of calling a glibc-function?If you are talking about __clear_cache(), it is defined in libgcc, not glibc. This should also be available on FreeBSD, though I can only find the required libgcc2.h header in the gcc source directory... The function is at least available on FreeBSD/i386-CURRENT: $ readelf -a /lib/libgcc_s.so.1 | grep __clear_cache 51: 000046b0 5 FUNC GLOBAL DEFAULT 11 __clear_cache@@GCC_3.0