From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Oct 27 15:20:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6DDD639 for ; Sun, 27 Oct 2013 15:20:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 881562C4B for ; Sun, 27 Oct 2013 15:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RFK0C5011999 for ; Sun, 27 Oct 2013 15:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9RFK0ZZ011998; Sun, 27 Oct 2013 15:20:00 GMT (envelope-from gnats) Resent-Date: Sun, 27 Oct 2013 15:20:00 GMT Resent-Message-Id: <201310271520.r9RFK0ZZ011998@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kevin Zheng Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A17C52D for ; Sun, 27 Oct 2013 15:14:35 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDA32C3A for ; Sun, 27 Oct 2013 15:14:35 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9RFEYuO043868 for ; Sun, 27 Oct 2013 15:14:34 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9RFEYqR043861; Sun, 27 Oct 2013 15:14:34 GMT (envelope-from nobody) Message-Id: <201310271514.r9RFEYqR043861@oldred.freebsd.org> Date: Sun, 27 Oct 2013 15:14:34 GMT From: Kevin Zheng To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/183368: [patch] Add options to disable MMX/SSE for x11-toolkits/qt4-gui X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2013 15:20:00 -0000 >Number: 183368 >Category: ports >Synopsis: [patch] Add options to disable MMX/SSE for x11-toolkits/qt4-gui >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Oct 27 15:20:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Kevin Zheng >Release: 9.2-RELEASE >Organization: >Environment: FreeBSD sigma.local 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 03:52:52 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 >Description: The Qt4 configure script employs several checks for CPU-specific optimization routines, including the use of 3DNOW, MMX, SSE, SSE2, SSSE3, and SSE4. Usually this works quite well, but becomes problematic when using a package build machine. If any of the above instructions are found on the package builder, they will be compiled into the package. The builder has no way of knowing whether the clients have these instructions or not. There is no compile-time error; machines with the package installed will simply raise SIGILL or SIGBUS at seemingly random times when run. The solution is to add port options that disable MMX and SSE when building a package by default. Ideally, it should check that PACKAGE_BUILDING is set. If so, do not add any optimizations. This lets us get the best of both worlds. >How-To-Repeat: Build multimedia/vlc on a machine supporting a bunch of optimized routines. Then install the package on an older machine. VLC will be killed by SIGBUS whenever the user tries to scroll using the slider bar. >Fix: Apply the attached patch. A comprehensive solution will require more work, as every Qt4 port also uses the optimized routines by default. Perhaps a global Qt option defined in devel/qt4/files/Makefile.options is in order. In addition, this patch does not include the desired PACKAGE_BUILDING check. Patch attached with submission follows: Index: Makefile =================================================================== --- Makefile (revision 331776) +++ Makefile (working copy) @@ -51,6 +51,18 @@ FONTSCALE= ${LOCALBASE}/lib/X11/fonts/TTF/luximb.ttf FONTENCOD= ${LOCALBASE}/lib/X11/fonts/encodings/encodings.dir +OPTIONS_DEFINE= MMX SSE + +.include + +.if !${PORT_OPTIONS:MMMX} +CONFIGURE_ARGS+= -no-mmx +.endif + +.if !${PORT_OPTIONS:MSSE} +CONFIGURE_ARGS+= -no-sse -no-sse2 +.endif + .include "${.CURDIR}/../../devel/qt4/files/Makefile.options" .if ${QT4_OPTIONS:MCUPS} >Release-Note: >Audit-Trail: >Unformatted: