git: 233162029ad9 - main - audio/calf-lv2: fix build on powerpc64le

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Tue, 04 Jan 2022 18:17:49 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=233162029ad997ab15b082ff188c62e95aaa67ad

commit 233162029ad997ab15b082ff188c62e95aaa67ad
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-01-04 18:11:30 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-01-04 18:11:30 +0000

    audio/calf-lv2: fix build on powerpc64le
    
    clang has a bug:
    libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I.. -I.. -I. -isystem /usr/local/include -ffast-math -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -pthread -I/usr/local/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/lash-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -pthread -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -std=c++11 -O3 -Wall -MT organ.lo -MD -MP -MF .deps/organ.Tpo -c organ.cpp  -fPIC -DPIC -o .libs/organ.o
    fatal error: error in backend: Incomplete scavenging after 2nd pass
    PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
    Stack dump:
    0.      Program arguments: c++ -DHAVE_CONFIG_H -I. -I.. -I.. -I. -isystem /usr/local/include -ffast-math -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -pthread -I/usr/local/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/lash-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -pthread -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -std=c++11 -O3 -Wall -MT organ.lo -MD -MP -MF .deps/organ.Tpo -c organ.cpp -fPIC -DPIC -o .libs/organ.o
    1.      <eof> parser at end of file
    2.      Code generation
    3.      Running pass 'Function Pass Manager' on module 'organ.cpp'.
    4.      Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@_ZN3dsp16organ_voice_base18precalculate_wavesEPN12calf_plugins21progress_report_ifaceE'
    
    The port builds fine with gcc after linking to libc++.
---
 audio/calf-lv2/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/audio/calf-lv2/Makefile b/audio/calf-lv2/Makefile
index 4097a0ad3dc8..b91b9d375e5b 100644
--- a/audio/calf-lv2/Makefile
+++ b/audio/calf-lv2/Makefile
@@ -20,7 +20,7 @@ LIB_DEPENDS=	libfluidsynth.so:audio/fluidsynth \
 		libjack.so:audio/jack \
 		libexpat.so:textproc/expat2
 
-USES=		autoreconf compiler:c++11-lang gmake gnome libtool localbase pkgconfig
+USES=		autoreconf gmake gnome libtool localbase pkgconfig
 USE_GNOME=	cairo gdkpixbuf2 gtk20
 USE_CXXSTD=	c++11
 USE_LDCONFIG=	yes
@@ -49,6 +49,14 @@ SSE_CONFIGURE_ENABLE=	sse
 
 PORTDOCS=	*
 
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == powerpc64le
+USES+=		compiler:gcc-c++11-lib
+.else
+USES+=		compiler:c++11-lang 
+.endif
+
 .include <bsd.port.pre.mk>
 
 .if ${CHOSEN_COMPILER_TYPE} == gcc