Bug 183368 - [patch] Add options to disable MMX/SSE for x11-toolkits/qt4-gui
Summary: [patch] Add options to disable MMX/SSE for x11-toolkits/qt4-gui
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-27 15:20 UTC by Kevin Zheng
Modified: 2015-02-24 22:32 UTC (History)
0 users

See Also:


Attachments
file.diff (566 bytes, patch)
2013-10-27 15:20 UTC, Kevin Zheng
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Zheng 2013-10-27 15:20:00 UTC
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.

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:
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.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-27 15:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kde

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Kevin Zheng 2015-02-24 22:32:58 UTC
I'll go ahead and close this, since I no longer have interest in seeing it fixed. I switched to amd64 months (maybe years?) ago, so I don't know whether this problem still exists or not.