Mail archive

[alpine-aports] [PATCH] community/mplayer: add --enable-runtime-cpudetection

From: Vladislav Ivanishin <>
Date: Sun, 24 Dec 2017 04:13:58 +0300

Hello, Natanael,

I installed Alpine on an old system with an Athlon 64 CPU, which does
not have SSE4* extensions. Mplayer from the official repositories
crashed immediately upon opening an audio file. The reason was an
"illegal" -- for my CPU that is -- instruction, `popcnt' in my case.

Compiling mplayer on my machine (with `abuild -r') helped (obviously).

Arch Linux folks had pretty much the same bug in 2009: [1], and I
suggest pretty much the same patch as a fix: configure with

Debian `rules' for the package [2,3] also include the option, though not
for all architectures, it seems:

ifeq ($(DEB_HOST_ARCH),i386)
#configure optimizes for the cpu detected at ./configure time
#in order to build a generic binary, avoid non-standard opcodes through gcc
  archconf += --target=i586-linux
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
ifeq ($(DEB_HOST_ARCH),amd64)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
ifeq ($(DEB_HOST_ARCH),kfreebsd-i386)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
ifeq ($(DEB_HOST_ARCH),kfreebsd-amd64)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
ifeq ($(DEB_HOST_ARCH),powerpc)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
# when run on a sparc64 kernel, configure will normally select v9 asm.
# this is hidden when running on buildds with 32bit kernel personality.
# because of #644856, this will currently lead to a FTBFS
# therefore, we force a 'generic' target.
ifeq ($(DEB_HOST_ARCH),sparc)
  archconf += --target=generic
ifeq ($(DEB_HOST_ARCH),alpha)
#Avoid high optimization through gcc.
# see
  archconf += --target=alpha_ev5-linux

Not sure what happens for arm here. Hope you have more knowledge.


- Vlad
Received on Sun Dec 24 2017 - 04:13:58 UTC