svn commit: r510095 - in head/audio/flac: . files

Piotr Kubaj pkubaj at FreeBSD.org
Wed Aug 28 19:26:57 UTC 2019


Author: pkubaj
Date: Wed Aug 28 19:26:56 2019
New Revision: 510095
URL: https://svnweb.freebsd.org/changeset/ports/510095

Log:
  audio/flac: fix build on powerpc64
  
  FreeBSD doesn't support getauxval(), it has elf_aux_info() instead. Use this to fix build on powerpc64.
  Disable VSX to not use VSX-related functions.
  
  PR:		239870
  Approved by:	linimon (mentor), naddy (maintainer)
  Differential Revision:	https://reviews.freebsd.org/D21284

Added:
  head/audio/flac/files/patch-src_libFLAC_cpu.c   (contents, props changed)
Modified:
  head/audio/flac/Makefile

Modified: head/audio/flac/Makefile
==============================================================================
--- head/audio/flac/Makefile	Wed Aug 28 19:24:51 2019	(r510094)
+++ head/audio/flac/Makefile	Wed Aug 28 19:26:56 2019	(r510095)
@@ -25,7 +25,8 @@ CONFIGURE_ARGS=	--enable-static \
 		--with-ogg="${LOCALBASE}" \
 		--disable-doxygen-docs \
 		--disable-thorough-tests \
-		--disable-xmms-plugin
+		--disable-xmms-plugin \
+		--disable-vsx
 INSTALL_TARGET=	install-strip
 TEST_TARGET=	check
 

Added: head/audio/flac/files/patch-src_libFLAC_cpu.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/flac/files/patch-src_libFLAC_cpu.c	Wed Aug 28 19:26:56 2019	(r510095)
@@ -0,0 +1,24 @@
+--- src/libFLAC/cpu.c.orig	2019-08-15 00:05:19 UTC
++++ src/libFLAC/cpu.c
+@@ -245,11 +245,21 @@ ppc_cpu_info (FLAC__CPUInfo *info)
+ #define PPC_FEATURE2_ARCH_2_07		0x80000000
+ #endif
+ 
++#ifdef __linux__
+ 	if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_00) {
+ 		info->ppc.arch_3_00 = true;
+ 	} else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
+ 		info->ppc.arch_2_07 = true;
+ 	}
++#elif defined(__FreeBSD__)
++	long hwcaps;
++	elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps));
++	if (hwcaps & PPC_FEATURE2_ARCH_3_00) {
++		info->ppc.arch_3_00 = true;
++	} else if (hwcaps & PPC_FEATURE2_ARCH_2_07) {
++		info->ppc.arch_2_07 = true;
++	}
++#endif
+ #else
+ 	info->ppc.arch_2_07 = false;
+ 	info->ppc.arch_3_00 = false;


More information about the svn-ports-head mailing list