Bug 206411 - emulators/simh: Fix build with clang 3.8.0
Summary: emulators/simh: Fix build with clang 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords: easy, patch, patch-ready
Depends on:
Blocks:
 
Reported: 2016-01-19 20:16 UTC by Dimitry Andric
Modified: 2016-04-24 21:07 UTC (History)
1 user (show)

See Also:
koobs: merge-quarterly?


Attachments
Ensure -flto -fwhole-program is not used when it is not completely supported (1.52 KB, patch)
2016-01-19 20:16 UTC, Dimitry Andric
koobs: maintainer-approval+
Details | Diff
Build log showing failure (92.46 KB, text/plain)
2016-02-19 04:40 UTC, Mikhail Teterin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.