Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Sep 2020 20:48:58 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365509 - head/lib/libcompiler_rt
Message-ID:  <202009092048.089KmwqV058284@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Sep  9 20:48:57 2020
New Revision: 365509
URL: https://svnweb.freebsd.org/changeset/base/365509

Log:
  Follow-up r364753 by enabling compiler-rt's atomic implementation only
  for clang, as it uses clang specific builtins, and does not compile
  correctly with gcc. Note that gcc packages usually come with their own
  libatomic, providing these primitives.
  
  PR:		230888
  MFC after:	3 days
  X-MFC-With:	r364753

Modified:
  head/lib/libcompiler_rt/Makefile.inc

Modified: head/lib/libcompiler_rt/Makefile.inc
==============================================================================
--- head/lib/libcompiler_rt/Makefile.inc	Wed Sep  9 19:07:34 2020	(r365508)
+++ head/lib/libcompiler_rt/Makefile.inc	Wed Sep  9 20:48:57 2020	(r365509)
@@ -18,7 +18,6 @@ SRCF+=		ashldi3
 SRCF+=		ashlti3
 SRCF+=		ashrdi3
 SRCF+=		ashrti3
-SRCF+=		atomic
 SRCF+=		bswapdi2
 SRCF+=		bswapsi2
 SRCF+=		clear_cache
@@ -122,6 +121,12 @@ SRCF+=		udivti3
 SRCF+=		umoddi3
 SRCF+=		umodsi3
 SRCF+=		umodti3
+
+# Enable compiler-rt's atomic implementation only for clang, as it uses clang
+# specific builtins, and gcc packages usually come with their own libatomic.
+.if "${COMPILER_TYPE}" == "clang"
+SRCF+=		atomic
+.endif
 
 # Avoid using SSE2 instructions on i386, if unsupported.
 .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)



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