Bug 193917 - sysutils/i7z requires gcc but port does not require it
Summary: sysutils/i7z requires gcc but port does not require it
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Andrey Zonov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 07:07 UTC by Marcus Reid
Modified: 2016-09-11 19:19 UTC (History)
2 users (show)

See Also:
marcus: maintainer-feedback? (zont)


Attachments
Add dependency on GCC. (500 bytes, patch)
2014-09-25 07:24 UTC, Johannes Jost Meixner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Reid 2014-09-25 07:07:03 UTC
sysutils/i7z fails to compile with clang due to unsupported options. The port does not depend on gcc however and is compiled with clang by default.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-09-25 07:07:03 UTC
Auto-assigned to maintainer zont@FreeBSD.org
Comment 2 Johannes Jost Meixner freebsd_committer freebsd_triage 2014-09-25 07:24:00 UTC
Created attachment 147664 [details]
Add dependency on GCC.

Add dependency on GCC. Clang 3.4 doesn't know about the CFLAGS,
hence build will fail without it (and no package will be available).
Comment 3 Andrey Zonov freebsd_committer freebsd_triage 2014-09-29 21:30:57 UTC
I tested i7z built by clang without that specific CFLAGS, so I'd suggest the following patch:

Index: sysutils/i7z/Makefile
===================================================================
--- sysutils/i7z/Makefile	(revision 369297)
+++ sysutils/i7z/Makefile	(working copy)
@@ -19,7 +19,9 @@

 # Disable scheduling flags as they cause segfaults since they are enabled at
 # default FreeBSD optimization levels (-O2, -O3, -Os)
+.if ${COMPILER_TYPE} == gcc
 CFLAGS+=	-fno-schedule-insns2 -fno-schedule-insns -fno-caller-saves
+.endif

 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
Comment 4 Johannes Jost Meixner freebsd_committer freebsd_triage 2014-09-30 06:05:15 UTC
Coredumps for me.
Comment 5 Johannes Jost Meixner freebsd_committer freebsd_triage 2014-09-30 06:08:51 UTC
(Please see the comments right on top of that ifclause)
Comment 6 Andrey Zonov freebsd_committer freebsd_triage 2014-09-30 19:18:31 UTC
Interesting.  What hardware do you use?  What is your FreeBSD and Clang version?
Comment 7 Marcus Reid 2014-09-30 19:38:04 UTC
I get a crash if I compile it with clang (without the unsupported gcc options) as well.  I'm on the latest CURRENT with base clang (3.4.1).
Comment 8 Andrey Zonov freebsd_committer freebsd_triage 2014-10-01 21:51:28 UTC
Let's turn off Clang optimization then.  How do you like this one?

Index: sysutils/i7z/Makefile
===================================================================
--- sysutils/i7z/Makefile	(revision 369297)
+++ sysutils/i7z/Makefile	(working copy)
@@ -17,9 +17,15 @@

 ONLY_FOR_ARCHS=	i386 amd64

+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_TYPE} == clang
+CFLAGS+=	-O0
+.elif ${COMPILER_TYPE} == gcc
 # Disable scheduling flags as they cause segfaults since they are enabled at
 # default FreeBSD optimization levels (-O2, -O3, -Os)
 CFLAGS+=	-fno-schedule-insns2 -fno-schedule-insns -fno-caller-saves
+.endif

 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
Comment 9 Marcus Reid 2014-10-02 00:15:59 UTC
Looks good to me, works and does not require gcc, so best of both worlds. I tested with -O1 and it still crashes, so it looks like -O0 is indeed necessary.
Comment 10 Marcus Reid 2015-02-21 01:52:36 UTC
That seems like a good fix, is it going to go in? It's been some time and port is still broken.
Comment 11 Dmitry Marakasov freebsd_committer freebsd_triage 2016-09-11 19:19:34 UTC
Fixed in ports/199186