Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Nov 2017 19:25:06 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325442 - in head/lib/libclang_rt: . profile
Message-ID:  <201711051925.vA5JP6Y3028898@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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