Bug 223179 - lib/libcompiler_rt fails to compile with gcc; some flags are being applied incorrectly
Summary: lib/libcompiler_rt fails to compile with gcc; some flags are being applied in...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Enji Cooper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-23 04:16 UTC by Enji Cooper
Modified: 2017-11-07 16:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2017-10-23 04:16:37 UTC
Per gcc(1), the following clangs (minus -fno-sanitize=...) are c++ flags, and are being applied to CFLAGS instead of CXXFLAGS.

===> lib/libclang_rt/profile (obj,all,install)
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
cc1: error: unrecognized command line option "-fno-sanitize=safe-stack"
cc1: warning: command line option "-fvisibility-inlines-hidden" is valid for C++/ObjC++ but not for C
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-10-23 04:23:01 UTC
A commit references this bug:

Author: ngie
Date: Mon Oct 23 04:22:17 UTC 2017
New revision: 324894
URL: https://svnweb.freebsd.org/changeset/base/324894

Log:
  Support compiling lib/libclang_rt/profile with gcc

  Several of the flags were being treated as CFLAGS, when they were actually
  technically CXXFLAGS. Move them there.

  Also, only apply -fno-sanitize=safe-stack with clang.

  This is a draft diff.

  PR:		223179

Changes:
  projects/runtime-coverage/lib/libclang_rt/Makefile.inc
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-10-23 05:11:39 UTC
A commit references this bug:

Author: ngie
Date: Mon Oct 23 05:11:01 UTC 2017
New revision: 324899
URL: https://svnweb.freebsd.org/changeset/base/324899

Log:
  -fvisibility is a c++ thing, per gcc(1)

  Followup to r324894

  PR:	223179

Changes:
  projects/runtime-coverage/lib/libclang_rt/profile/Makefile
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-11-05 19:26:07 UTC
A commit references this bug:

Author: ngie
Date: Sun Nov  5 19:25:06 UTC 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

Changes:
  head/lib/libclang_rt/Makefile.inc
  head/lib/libclang_rt/profile/Makefile
Comment 4 Enji Cooper freebsd_committer freebsd_triage 2017-11-07 16:44:05 UTC
Closing bug since it's fixed in ^/head.