Bug 206411

Summary: emulators/simh: Fix build with clang 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Some People CC: mi
Priority: --- Keywords: easy, patch, patch-ready
Version: LatestFlags: koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Ensure -flto -fwhole-program is not used when it is not completely supported
koobs: maintainer-approval+
Build log showing failure none

Description Dimitry Andric freebsd_committer freebsd_triage 2016-01-19 20:16:42 UTC
Created attachment 165836 [details]
Ensure -flto -fwhole-program is not used when it is not completely supported

During the exp-run in bug 206074, it was found that emulators/simh gives errors with a recent clang 3.8.0 snapshot [1]:

   /usr/bin/ld: unrecognized option '-plugin'

And more of such linking errors.  This is because the simh main Makefile attempts to use -flto -fwhole-program with clang, but this support depends on the correctly link time optimization infrastructure being installed (e.g. the LLVMgold.so plugin, and more).

Since LTO is not available yet in base, here is a patch to disable the use of these options more thorougly.

[1] http://package18.nyi.freebsd.org/data/headamd64PR206074-default/2016-01-15_15h26m58s/logs/errors/simh-3.9.0.log
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-20 08:26:52 UTC
Reporter is Committer, assign accordingly.

This change comes under blanket (implicit) approval, and is an MFH candidate.

Please add MFH: 2016Q1 and Approved by: koobs (ports) to your commit log and set merge-quarterly to + when merged. You can use Tools/scripts/mfh for this
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-20 08:27:09 UTC
Comment on attachment 165836 [details]
Ensure -flto -fwhole-program is not used when it is not completely supported

Port is unmaintained, implicit approval
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-01-24 16:26:14 UTC
A commit references this bug:

Author: dim
Date: Sun Jan 24 16:25:26 UTC 2016
New revision: 407167
URL: https://svnweb.freebsd.org/changeset/ports/407167

Log:
  During the exp-run in bug 206074, it was found that emulators/simh gives
  errors with a recent clang 3.8.0 snapshot [1]:

     /usr/bin/ld: unrecognized option '-plugin'

  And more of such linking errors.  This is because the simh main Makefile
  attempts to use -flto -fwhole-program with clang, but this support
  depends on the correctly link time optimization infrastructure being
  installed (e.g. the LLVMgold.so plugin, and more).

  Since LTO is not available yet in base, here is a patch to disable the
  use of these options more thorougly.

  Approved by:	koobs (ports)
  PR:		206411
  MFH:		2016Q1

Changes:
  head/emulators/simh/Makefile
  head/emulators/simh/files/patch-makefile
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-01-25 07:50:32 UTC
A commit references this bug:

Author: dim
Date: Mon Jan 25 07:50:18 UTC 2016
New revision: 407196
URL: https://svnweb.freebsd.org/changeset/ports/407196

Log:
  MFH: r407167

  During the exp-run in bug 206074, it was found that emulators/simh gives
  errors with a recent clang 3.8.0 snapshot [1]:

     /usr/bin/ld: unrecognized option '-plugin'

  And more of such linking errors.  This is because the simh main Makefile
  attempts to use -flto -fwhole-program with clang, but this support
  depends on the correctly link time optimization infrastructure being
  installed (e.g. the LLVMgold.so plugin, and more).

  Since LTO is not available yet in base, here is a patch to disable the
  use of these options more thorougly.

  Approved by:	ports-secteam (delphij)
  PR:		206411

Changes:
_U  branches/2016Q1/
  branches/2016Q1/emulators/simh/Makefile
  branches/2016Q1/emulators/simh/files/patch-makefile
Comment 5 Mikhail Teterin freebsd_committer freebsd_triage 2016-02-19 04:40:30 UTC
Created attachment 167163 [details]
Build log showing failure

Trying to build emulators/simh using the compiler installed by lang/clang38:

% make CC=clang38 CXX=clang++38

I get the attached error-log. But, if it works for everyone else, can this PR be closed?

FWIW, with the regular compiler (clang-3.4.1 found in base), I get tons of warnings, but the build succeeds.