From 082fc9ab04c1b8647d8f83508c0a3d342f83b133 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 25 Jan 2016 07:50:18 +0000 Subject: [PATCH] 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 --- emulators/simh/Makefile | 2 +- emulators/simh/files/patch-makefile | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 emulators/simh/files/patch-makefile diff --git a/emulators/simh/Makefile b/emulators/simh/Makefile index df78e0c08311..fb22cb03877f 100644 --- a/emulators/simh/Makefile +++ b/emulators/simh/Makefile @@ -13,7 +13,7 @@ COMMENT= Emulates classic DEC, HP, GRI, IBM, Altair, SDS, Honeywell, and others NO_WRKSUBDIR= yes USES= gmake dos2unix zip -DOS2UNIX_FILES= VAX/vax_sysdev.c +DOS2UNIX_FILES= makefile VAX/vax_sysdev.c MAKE_ENV= GCC="${CC}" CFLAGS_O="${CFLAGS}" USE_NETWORK=1 MAKEFILE= makefile diff --git a/emulators/simh/files/patch-makefile b/emulators/simh/files/patch-makefile new file mode 100644 index 000000000000..c82ad74e8401 --- /dev/null +++ b/emulators/simh/files/patch-makefile @@ -0,0 +1,15 @@ +--- makefile.orig 2012-04-23 16:28:04.000000000 +0200 ++++ makefile 2016-01-19 20:21:21.371550000 +0100 +@@ -332,8 +332,10 @@ + endif + ifeq (,$(NO_LTO)) + ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS))) +- CFLAGS_O += -flto -fwhole-program +- LDFLAGS_O += -flto -fwhole-program ++ ifneq (,$(findstring -fwhole-program,$(GCC_OPTIMIZERS))) ++ CFLAGS_O += -flto -fwhole-program ++ LDFLAGS_O += -flto -fwhole-program ++ endif + endif + endif + BUILD_FEATURES = - compiler optimizations and no debugging support