svn commit: r325442 - in head/lib/libclang_rt: . profile

Ngie Cooper ngie at FreeBSD.org
Sun Nov 5 19:25:08 UTC 2017


Author: ngie
Date: Sun Nov  5 19:25:06 2017
New Revision: 325442
URL: https://svnweb.freebsd.org/changeset/base/325442

Log:
  Support compiling lib/libclang_rt/profile a bit more with recent versions of gcc
  
  Several of the flags were being treated as CFLAGS, when they were actually
  technically CXXFLAGS. Move them there.
  
  Only apply -fno-sanitize=safe-stack with clang.
  
  PR:             223179

Modified:
  head/lib/libclang_rt/Makefile.inc
  head/lib/libclang_rt/profile/Makefile

Modified: head/lib/libclang_rt/Makefile.inc
==============================================================================
--- head/lib/libclang_rt/Makefile.inc	Sun Nov  5 18:45:43 2017	(r325441)
+++ head/lib/libclang_rt/Makefile.inc	Sun Nov  5 19:25:06 2017	(r325442)
@@ -20,13 +20,13 @@ CFLAGS+=	-DNDEBUG
 CFLAGS+=	${PICFLAG}
 CFLAGS+=	-fno-builtin
 CFLAGS+=	-fno-exceptions
-CFLAGS+=	-fno-rtti
-.if ${COMPILER_VERSION} >= 30700
+CXXFLAGS+=	-fno-rtti
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 30700
 CFLAGS+=	-fno-sanitize=safe-stack
 .endif
 CFLAGS+=	-fno-stack-protector
 CFLAGS+=	-funwind-tables
-CFLAGS+=	-fvisibility-inlines-hidden
-CFLAGS+=	-fvisibility=hidden
+CXXFLAGS+=	-fvisibility-inlines-hidden
+CXXFLAGS+=	-fvisibility=hidden
 CFLAGS+=	-I${CRTSRC}/lib
 CXXFLAGS+=	-std=c++11

Modified: head/lib/libclang_rt/profile/Makefile
==============================================================================
--- head/lib/libclang_rt/profile/Makefile	Sun Nov  5 18:45:43 2017	(r325441)
+++ head/lib/libclang_rt/profile/Makefile	Sun Nov  5 19:25:06 2017	(r325442)
@@ -5,7 +5,7 @@
 LIB=		clang_rt.profile-${CRTARCH}
 
 # This is needed for --coverage
-CFLAGS+=	-fvisibility=default
+CXXFLAGS+=	-fvisibility=default
 
 SRCS+=		profile/GCDAProfiling.c
 SRCS+=		profile/InstrProfiling.c


More information about the svn-src-all mailing list