[vlc-devel] [PATCH] Fix build with LLVM and AltiVec

Steve Lhomme robux4 at ycbcr.xyz
Fri Sep 13 08:07:38 CEST 2019


Hi,

On 2019-09-12 16:24, Piotr Kubaj via vlc-devel wrote:
> 
> Subject:
> [PATCH] Fix build with LLVM and AltiVec
> From:
> Piotr Kubaj <pkubaj at anongoth.pl>
> Date:
> 2019-09-12, 16:24
> To:
> vlc-devel at videolan.org
> 
> To:
> vlc-devel at videolan.org
> 
> 
> altivec.h may redefine bool and thus break compilation (happens with 
> LLVM). Fix this by undefining bool prior to including altivec.h.

What is the compilation error ? Neither i420_yuy2.c nor i420_yuy2.h use 
bool. So it seems odd to define it to something else. It may not be a 
define in the first place but a typedef, in which case your change won't 
work.

Looking at the altivec.h in LLVM 9 there's plenty of "bool" in the file. 
So I don't think it's incompatible either.

> vlc.patch
> 
> Index: Makefile
> ===================================================================
> --- Makefile	(revision 511806)
> +++ Makefile	(working copy)
> @@ -25,7 +25,7 @@
>   RUN_DEPENDS=	ffmpeg>=3.4.1,1:multimedia/ffmpeg
>   
>   USES=		compiler:c++11-lib desktop-file-utils gettext-tools gmake gnome \
> -		iconv libtool pathfix pkgconfig tar:xz
> +		iconv libtool localbase pathfix pkgconfig tar:xz
>   
>   # VLC git (post 2.2.4) requires C++11 support and passes the appropriate flag
>   # to the compiler. Until the port is updated, we explicitly pass -std=c++11 to
> @@ -57,9 +57,7 @@
>   .if defined(WITH_DEBUG)
>   CONFIGURE_ARGS+=--enable-debug
>   .endif
> -CPPFLAGS+=	-I${LOCALBASE}/include
>   CFLAGS_i386=	-fomit-frame-pointer
> -LIBS+=		-L${LOCALBASE}/lib
>   
>   OPTIONS_DEFINE=	A52 AALIB AOM ASS AVAHI CACA CHROMECAST DAV1D DBUS DCA DOCS DVDREAD \
>   		DVDNAV FAAD FLAC FLUID FREERDP FRIBIDI GME GNUTLS \
> @@ -69,10 +67,14 @@
>   		QT5 REALRTSP RUNROOT SAMPLERATE SIDPLAY SCHROEDINGER \
>   		SDL SHOUTCAST SKINS SMB SNDIO STREAM SPEEX TAGLIB THEORA \
>   		TWOLAME UPNP V4L VAAPI VCD VDPAU VPX VORBIS WAYLAND X11 X264 X265 ZVBI
> +OPTIONS_DEFINE_powerpc=	ALTIVEC
> +OPTIONS_DEFINE_powerpc64=	ALTIVEC
>   OPTIONS_DEFAULT=A52 AVAHI DAV1D DBUS DCA DVDREAD DVDNAV FAAD FLAC GNUTLS JPEG \
>   		LIVEMEDIA LUA MAD MPEG2 OGG OPTIMIZED_CFLAGS \
>   		OPUS PNG QT5 SAMPLERATE STREAM SPEEX TAGLIB THEORA TWOLAME \
>   		V4L VAAPI VCD VDPAU VORBIS WAYLAND X11
> +OPTIONS_DEFAULT_powerpc=	ALTIVEC
> +OPTIONS_DEFAULT_powerpc64=	ALTIVEC
>   OPTIONS_SUB=	yes
>   
>   AOM_DESC=	AV1 video encoding/decoding via libaom
> @@ -109,6 +111,8 @@
>   ASS_LIB_DEPENDS=	libass.so:multimedia/libass
>   ASS_CONFIGURE_ENABLE=	libass
>   
> +ALTIVEC_CONFIGURE_ENABLE=	altivec
> +
>   AOM_LIB_DEPENDS=	libaom.so:multimedia/aom
>   AOM_CONFIGURE_ENABLE=	aom
>   
> Index: files/patch-modules_video__chroma_i420__yuy2.c
> ===================================================================
> --- files/patch-modules_video__chroma_i420__yuy2.c	(nonexistent)
> +++ files/patch-modules_video__chroma_i420__yuy2.c	(working copy)
> @@ -0,0 +1,12 @@
> +--- modules/video_chroma/i420_yuy2.c.orig	2019-09-12 13:09:52 UTC
> ++++ modules/video_chroma/i420_yuy2.c
> +@@ -37,7 +37,9 @@
> + #include <vlc_cpu.h>
> +
> + #if defined (MODULE_NAME_IS_i420_yuy2_altivec) && defined(HAVE_ALTIVEC_H)
> ++#   undef bool
> + #   include <altivec.h>
> ++#   define bool _Bool
> + #endif
> +
> + #include "i420_yuy2.h"
> 
> Property changes on: files/patch-modules_video__chroma_i420__yuy2.c
> ___________________________________________________________________
> Added: fbsd:nokeywords
> ## -0,0 +1 ##
> +yes
> \ No newline at end of property
> Added: svn:eol-style
> ## -0,0 +1 ##
> +native
> \ No newline at end of property
> Added: svn:mime-type
> ## -0,0 +1 ##
> +text/plain
> \ No newline at end of property
> Index: files/patch-modules_video__filter_deinterlace_merge.c
> ===================================================================
> --- files/patch-modules_video__filter_deinterlace_merge.c	(nonexistent)
> +++ files/patch-modules_video__filter_deinterlace_merge.c	(working copy)
> @@ -0,0 +1,12 @@
> +--- modules/video_filter/deinterlace/merge.c.orig	2019-09-12 13:33:43 UTC
> ++++ modules/video_filter/deinterlace/merge.c
> +@@ -39,7 +39,9 @@
> + #endif
> +
> + #ifdef HAVE_ALTIVEC_H
> ++#   undef bool
> + #   include <altivec.h>
> ++#   define bool _Bool
> + #endif
> +
> + /*****************************************************************************
> 
> Property changes on: files/patch-modules_video__filter_deinterlace_merge.c
> ___________________________________________________________________
> Added: fbsd:nokeywords
> ## -0,0 +1 ##
> +yes
> \ No newline at end of property
> Added: svn:eol-style
> ## -0,0 +1 ##
> +native
> \ No newline at end of property
> Added: svn:mime-type
> ## -0,0 +1 ##
> +text/plain
> \ No newline at end of property
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list