Module Name: src
Committed By: joerg
Date: Wed Jan 15 21:14:55 UTC 2014
Modified Files:
src/doc: TODO.clang
src/external/bsd/libc++/lib: Makefile
src/external/bsd/llvm/lib/libLLVMSupport: Makefile
Log Message:
On ARM, force compiling some files in libc++ and LLVM's support library
with -march=armv6 to get native atomics as we currently lack the
fallback symbols in libgcc and libc.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/doc/TODO.clang
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libc++/lib/Makefile
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/llvm/lib/libLLVMSupport/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/doc/TODO.clang
diff -u src/doc/TODO.clang:1.5 src/doc/TODO.clang:1.6
--- src/doc/TODO.clang:1.5 Wed Jan 8 20:34:45 2014
+++ src/doc/TODO.clang Wed Jan 15 21:14:54 2014
@@ -1,11 +1,15 @@
-$NetBSD: TODO.clang,v 1.5 2014/01/08 20:34:45 joerg Exp $
+$NetBSD: TODO.clang,v 1.6 2014/01/15 21:14:54 joerg Exp $
Hacks for the clang integration
-------------------------------
"-no-integrated-as" in src/sys/arch/amd64 and src/sys/arch/i386
-to compensate for the missing .code16 support in LLVM MC
-and slightly different encoding of the lock stubs.
+to compensate for the missing .code16 support in LLVM MC.
-Various places use NOCLANGERROR or CWARNFLAGS.clang to disable errors or
-warnings.
+LLVM PR 18273 and -no-integrated-as as workaround:
+ src/tests/libexec/ld.elf_so/helper_symver_dso1/Makefile
+ src/tests/libexec/ld.elf_so/helper_symver_dso2/Makefile
+
+Missing atomic support in ARM libgcc, -march=armv6 "workaround":
+ src/external/bsd/libc++/lib
+ src/external/bsd/lllvm/lib/libLLVMSupport
Index: src/external/bsd/libc++/lib/Makefile
diff -u src/external/bsd/libc++/lib/Makefile:1.4 src/external/bsd/libc++/lib/Makefile:1.5
--- src/external/bsd/libc++/lib/Makefile:1.4 Tue Nov 12 16:39:39 2013
+++ src/external/bsd/libc++/lib/Makefile Wed Jan 15 21:14:55 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2013/11/12 16:39:39 joerg Exp $
+# $NetBSD: Makefile,v 1.5 2014/01/15 21:14:55 joerg Exp $
LIB= c++
WARNS= 4
@@ -46,4 +46,18 @@ CWARNFLAGS.clang+= -Wno-error=implicit-e
LDADD+= -Wl,-z,defs
+.if !empty(MACHINE_ARCH:M*arm*)
+# Missing __sync_fetch_and_add_4
+# Missing __sync_lock_test_and_set_4
+# Missing __sync_val_compare_and_swap_4
+# Missing __atomic_fetch_add_4
+COPTS.ios.cpp+= -march=armv6
+COPTS.locale.cpp+= -march=armv6
+COPTS.memory.cpp+= -march=armv6
+COPTS.new.cpp+= -march=armv6
+COPTS.rt_exception.cc+= -march=armv6
+COPTS.rt_guard.cc+= -march=armv6
+COPTS.stdexcept.cpp+= -march=armv6
+.endif
+
.include <bsd.lib.mk>
Index: src/external/bsd/llvm/lib/libLLVMSupport/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMSupport/Makefile:1.23 src/external/bsd/llvm/lib/libLLVMSupport/Makefile:1.24
--- src/external/bsd/llvm/lib/libLLVMSupport/Makefile:1.23 Sun Jan 5 16:38:07 2014
+++ src/external/bsd/llvm/lib/libLLVMSupport/Makefile Wed Jan 15 21:14:55 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2014/01/05 16:38:07 joerg Exp $
+# $NetBSD: Makefile,v 1.24 2014/01/15 21:14:55 joerg Exp $
LIB= LLVMSupport
@@ -116,6 +116,15 @@ SRCS+= Host.inc \
CPPFLAGS.${src}+= -std=gnu99
.endfor
+.if !defined(HOSTLIB) && !empty(MACHINE_ARCH:M*arm*)
+# Missing __sync_fetch_and_add_4
+# Missing __sync_fetch_and_sub_4
+# Missing __sync_lock_test_and_set_4
+# Missing __sync_val_compare_and_swap_4
+# Missing __atomic_fetch_add_4
+COPTS.Atomic.cpp+= -march=armv6
+.endif
+
.if defined(HOSTLIB)
.include <bsd.hostlib.mk>
.else