summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-01-22 23:56:45 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-01-22 23:56:45 +0000
commit5ea33144ed16c888b2ddf65429f3b2f163303bd2 (patch)
treeff61e1108f689ed5887fb611365a45177a01fd83 /lib
parentfba7008ac037f565a366f25a92894f1c36f12082 (diff)
Link libc with compiler_rt not libgcc if COMPILER_VERSION is clang.
This is not a list of archs with compiler_rt as it is intended that any arch switching to clang will have the required md bits added to compiler_rt first. ok kettenis@ patrick@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index cfb075376ae..891fdc7ee05 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.39 2016/04/26 14:49:53 deraadt Exp $
+# $OpenBSD: Makefile,v 1.40 2017/01/22 23:56:44 jsg Exp $
#
# The YP functions are always in libc. To choose that getpwent() and friends
# actually call the YP functions, put -DYP on the CFLAGS line below.
@@ -10,7 +10,12 @@ LIBREBUILD=y
CLEANFILES+=tags Symbols.map
CFLAGS+=-Wimplicit
#CFLAGS+=-Werror
-LDADD=-nostdlib -lgcc
+LDADD=-nostdlib
+.if ${COMPILER_VERSION:L} == "clang"
+LDADD+=-lcompiler_rt
+.else
+LDADD+=-lgcc
+.endif
VERSION_SCRIPT= Symbols.map
SYMBOL_LISTS= ${LIBCSRCDIR}/Symbols.list \