Some people have reported that on 64-bit Slackware, and after installing Adobe’s 64-bit Flash plugin, their Firefox crashes with an “illegal instruction” error when it loads a page containing flash video (like Youtube)…
I never had this issue, and for a lot of other people, flash works fine as well. However, the mystery remained until my friend Bruce (whose computer suffers from this crash bug, but only in Slackware, not in Gentoo) found the solution on the Gentoo bugtracker. Bruce wrote a howto on how to fix the crash .
Basically, the bug hits only certain Athlon64 CPUs which do not have the “lahf_lm” processor flag. This seems to be absent in certain processors of the “cpu family 15“. My own Athlon64 3200+ processor is from that same family but still mine has this “lahf_lm” flag (as shown in the output of the command “cat /proc/cpuinfo”).
What is the fix?
If you have an Athlon64 CPU which misses the “lahf_lm” instruction, you need to compile a small dynamic library that traps the “illegal instruction” signal and then emulates its effects. You should either place the plugin in mozilla’s plugins directory (so it’s loaded whenever the Flash plug-in is loaded) or force it to load by adding it to LD_PRELOAD environment variable. Below, I will show you how to build and install the library.
The source code written by Maks Verver is attached to the gentoo bug report I linked to earlier, and I’ve made a copy available here.
Download this “c” source file, then as root build the dynamic library “flashplugin-lahf-fix.so” using the following command (beware of line-wraps, the commands below are each a single line):
cc -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so flashplugin-lahf-fix.c
Copy the resulting library file “flashplugin-lahf-fix.so” to the mozilla plugin directory:
install -m0755 flashplugin-lahf-fix.so /usr/lib64/mozilla/plugins/flashplugin-lahf-fix.so
Restart your Firefox browser and check that it no longer crashes when you load a flash video.