Mail archive
alpine-aports

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

From: Vladislav Ivanishin <vladislav.ivanishin_at_gmail.com>
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
--enable-runtime-cpudetection.

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
endif
ifeq ($(DEB_HOST_ARCH),amd64)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
endif
ifeq ($(DEB_HOST_ARCH),kfreebsd-i386)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
endif
ifeq ($(DEB_HOST_ARCH),kfreebsd-amd64)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
endif
ifeq ($(DEB_HOST_ARCH),powerpc)
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
endif
# 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
endif
ifeq ($(DEB_HOST_ARCH),alpha)
#Avoid high optimization through gcc.
# see http://permalink.gmane.org/gmane.linux.debian.ports.alpha/7295
  archconf += --target=alpha_ev5-linux
endif

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

[1]: https://bugs.archlinux.org/task/15396
[2]: http://security.debian.org/debian-security/pool/updates/main/m/mplayer/mplayer_1.0~rc4.dfsg1+svn34540-1+deb7u2.debian.tar.gz
[3]: https://packages.debian.org/wheezy/mplayer

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