From nobody@FreeBSD.org  Tue Nov 20 21:42:36 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6CA3E66C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 20 Nov 2012 21:42:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A89D8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 20 Nov 2012 21:42:36 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKLga4p098737
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 20 Nov 2012 21:42:36 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qAKLgacl098736;
	Tue, 20 Nov 2012 21:42:36 GMT
	(envelope-from nobody)
Message-Id: <201211202142.qAKLgacl098736@red.freebsd.org>
Date: Tue, 20 Nov 2012 21:42:36 GMT
From: Thomas Zander <thomas.e.zander@googlemail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Fix build problem for mplayer/mencoder when DEBUG option is set
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         173743
>Category:       ports
>Synopsis:       Fix build problem for mplayer/mencoder when DEBUG option is set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 20 21:50:00 UTC 2012
>Closed-Date:    Wed Mar 13 12:53:45 CDT 2013
>Last-Modified:  Wed Mar 13 18:00:00 UTC 2013
>Originator:     Thomas Zander
>Release:        
>Organization:
>Environment:
>Description:
When DEBUG option is set, on x86 architectures mplayer and mencoder fail to link due to missing symbols.
>How-To-Repeat:
Build mplayer and mencoder on x86 architectures with DEBUG option set.
>Fix:
Patch is attached.
Note that this patch also contains the solution to the problem described in ports/172416

Patch attached with submission follows:

diff -r 2d183370afc9 mplayer/Makefile.options
--- a/mplayer/Makefile.options	Tue Nov 20 19:04:04 2012 +0100
+++ b/mplayer/Makefile.options	Tue Nov 20 22:40:30 2012 +0100
@@ -40,6 +40,7 @@
 #On i386, gcc runs out of general purpose registers when
 #trying to compile a debug version with the default flags.
 .if defined(WITH_DEBUG)
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-debug
 .if ${ARCH} == "i386"
 DEBUG_FLAGS=	-g -O -fomit-frame-pointer
 .endif
diff -r 2d183370afc9 mplayer/files/extra-patch-debug
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mplayer/files/extra-patch-debug	Tue Nov 20 22:40:30 2012 +0100
@@ -0,0 +1,35 @@
+--- ffmpeg/libavutil/x86/float_dsp_init.c.orig	2012-06-20 19:20:03.000000000 +0200
++++ ffmpeg/libavutil/x86/float_dsp_init.c	2012-11-20 20:22:20.113766897 +0100
+@@ -33,7 +33,7 @@
+ 
+ void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
+ {
+-#if HAVE_YASM
++#if NOTIMPLEMENTED
+     int mm_flags = av_get_cpu_flags();
+ 
+     if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) {
+--- ffmpeg/libavcodec/x86/fft.c.orig	2012-05-27 19:20:03.000000000 +0200
++++ ffmpeg/libavcodec/x86/fft.c	2012-11-20 20:23:41.033428529 +0100
+@@ -45,12 +45,6 @@
+         s->fft_calc    = ff_fft_calc_sse;
+         s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
+     }
+-    if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) {
+-        /* AVX for SB */
+-        s->imdct_half      = ff_imdct_half_avx;
+-        s->fft_calc        = ff_fft_calc_avx;
+-        s->fft_permutation = FF_FFT_PERM_AVX;
+-    }
+ #endif
+ }
+ 
+@@ -63,8 +57,6 @@
+         s->dct32 = ff_dct32_float_sse;
+     if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
+         s->dct32 = ff_dct32_float_sse2;
+-    if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
+-        s->dct32 = ff_dct32_float_avx;
+ #endif
+ }
+ #endif
diff -r 2d183370afc9 mplayer/files/patch-configure
--- a/mplayer/files/patch-configure	Tue Nov 20 19:04:04 2012 +0100
+++ b/mplayer/files/patch-configure	Tue Nov 20 22:40:30 2012 +0100
@@ -1,6 +1,6 @@
---- configure.orig	2012-03-15 16:20:02.000000000 +0100
-+++ configure	2012-03-22 15:36:16.583006073 +0100
-@@ -637,7 +637,7 @@
+--- configure.orig	2012-07-20 15:11:42.000000000 +0200
++++ configure	2012-10-08 19:16:19.637797462 +0200
+@@ -645,7 +645,7 @@
  _iwmmxt=auto
  _mtrr=auto
  _altivec=auto
@@ -9,7 +9,7 @@
  _ranlib=ranlib
  _windres=windres
  _cc=cc
-@@ -1455,7 +1455,6 @@
+@@ -1467,7 +1467,6 @@
  
    *)
      echo "Unknown parameter: $ac_option"
@@ -17,7 +17,16 @@
      ;;
  
    esac
-@@ -1533,7 +1533,7 @@
+@@ -1515,7 +1514,7 @@
+   case "$(uname -m 2>&1)" in
+       x86_64|amd64|i[3-9]86*|i86pc|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;;
+       ia64) host_arch=ia64 ;;
+-      macppc|ppc*|Power*) host_arch=ppc ;;
++      macppc|powerpc|ppc*|Power*) host_arch=ppc ;;
+       alpha) host_arch=alpha ;;
+       sun4*|sparc*) host_arch=sparc ;;
+       parisc*|hppa*|9000*) host_arch=hppa ;;
+@@ -1555,7 +1554,7 @@
  fi
  
  extra_cflags="-I. -Iffmpeg $extra_cflags"
@@ -26,7 +35,7 @@
  _timer=timer-linux.c
  _getch=getch2.c
  
-@@ -3576,7 +3575,7 @@
+@@ -3601,7 +3600,7 @@
  if linux ; then
    THREAD_CFLAGS=-D_REENTRANT
  elif freebsd || netbsd || openbsd || bsdos ; then
@@ -35,7 +44,7 @@
  fi
  if test "$_pthreads" = auto ; then
  cat > $TMPC << EOF
-@@ -3586,7 +3585,7 @@
+@@ -3611,7 +3610,7 @@
  EOF
  _pthreads=no
  if ! hpux ; then
@@ -44,7 +53,7 @@
      # for crosscompilation, we cannot execute the program, be happy if we can link statically
      cc_check $THREAD_CFLAGS $ld_tmp && (tmp_run || test "$ld_static") && ld_pthread="$ld_tmp" && _pthreads=yes && break
    done
-@@ -6245,7 +6244,7 @@
+@@ -6271,7 +6270,7 @@
  echocheck "libgsm"
  if test "$_libgsm" = auto ; then
    _libgsm=no
@@ -53,7 +62,7 @@
  fi
  if test "$_libgsm" = yes ; then
    def_libgsm='#define CONFIG_LIBGSM 1'
-@@ -6705,6 +6704,16 @@
+@@ -6733,6 +6732,16 @@
    nolibrtmp=no
    def_librtmp='#define CONFIG_LIBRTMP 1'
    inputmodules="librtmp $inputmodules"
@@ -70,7 +79,7 @@
  else
    nolibrtmp=yes
    _librtmp=no
-@@ -7097,7 +7106,7 @@
+@@ -7125,7 +7134,7 @@
  echocheck "mencoder"
  if test "$_mencoder" = no ; then
    # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
@@ -79,7 +88,7 @@
  fi
  echores "$_mencoder"
  
-@@ -7435,8 +7444,11 @@
+@@ -7463,8 +7472,11 @@
  if test "$_gui" = yes ; then
  
    # Required libraries
@@ -93,7 +102,7 @@
      die "The GUI requires libavcodec with PNG support (needs zlib)."
    fi
    test "$_freetype" = no && test "$_bitmap_font" = no &&
-@@ -8001,7 +8013,7 @@
+@@ -8029,7 +8041,7 @@
  EXESUF      = $_exesuf
  EXESUFS_ALL = .exe
  


>Release-Note:
>Audit-Trail:

From: Bryan Drewery <bdrewery@FreeBSD.org>
To: bug-followup@FreeBSD.org, thomas.e.zander@googlemail.com
Cc:  
Subject: Re: ports/173743: Fix build problem for mplayer/mencoder when DEBUG
 option is set
Date: Wed, 13 Mar 2013 12:30:20 -0500

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 ------enig2CLUPRVQOXIRXIWQPEDLA
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 Is this still an issue? I was able to build on i386 with DEBUG just
 fine, without the patch.
 
 --=20
 Regards,
 Bryan Drewery
 bdrewery@freenode/EFNet
 
 
 
 ------enig2CLUPRVQOXIRXIWQPEDLA
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
 iQIcBAEBAgAGBQJRQLewAAoJEG54KsA8mwz5mEUP/3SEjKKQ1jWxO5kWanPlPrLo
 4m/ytQDYQdjR4NhWPAZVYp/kMIYDuCV8ju/vfu03cxANHmCk7u13vwi37xGVHKDq
 U9F7FzACxn4wmO5BBm43jzTVzkpzKQYV876X85UwaWwjExLVipcZiNd30tFaGYEF
 /ajX9eXoJ99jff64N/I6EMsk5YBQdPzRNztCsAu9Oi4a+Dskw3yrg5VozCwLlhGw
 9WQy3tkqV4A5/25ykp33diSI0kBYKo6AintnR4t1NcooiPnzrPDdQKU0dLzTyRNH
 j3Q4hUOKmbKoMdP7HXUFgDJao2IJkdcZbGox+FFTqLFM2fy0912ayhywhNM2FSTT
 il3LfqVOfs3Kz3pdT2W83/NKVIt1TxxevLHwCn0WPYExprEBtoSNvhW4wBNvGa2n
 9Wb5e3b4+fe6pHHh/p7A9dqJCJzf7Fxe5J8MUpYR5ARuAtB/upE5AoPgAZVLvP+P
 k07ph7fdUJFeDH4XJBP8mYONadY2PrNVrOz50t7Dln2pCll06I0pkf2SFiWnlxMt
 CaZR58jM5sSX/odQQIrqJVJlVH+GQqtz5VZptbE6hkJ/T9zPZE4rE02vb0vqxa/Z
 /0SPQy8jCVY3eX9QwCnHcda+MKTRsEb10yxniTqqYyQokjlerV0iULv/lDiwcBie
 MLqQmPqP3d1mTqHi8PtW
 =VCq7
 -----END PGP SIGNATURE-----
 
 ------enig2CLUPRVQOXIRXIWQPEDLA--

From: Thomas Zander <thomas.e.zander@googlemail.com>
To: Bryan Drewery <bdrewery@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/173743: Fix build problem for mplayer/mencoder when DEBUG
 option is set
Date: Wed, 13 Mar 2013 18:48:09 +0100

 On 13 March 2013 18:30, Bryan Drewery <bdrewery@freebsd.org> wrote:
 > Is this still an issue? I was able to build on i386 with DEBUG just
 > fine, without the patch.
 
 It was definitely an issue back then when I submitted the pr.
 Having said that, a couple of days ago I have sent a CFT for a quite
 massive change to the port to the ports mailing list.
 When this gets committed, this pr will become obsolete anyway. Having
 this in mind, I think we can close this PR.
 
 Best regards
 Riggs
State-Changed-From-To: open->closed 
State-Changed-By: bdrewery 
State-Changed-When: Wed Mar 13 12:53:44 CDT 2013 
State-Changed-Why:  
Per submitter request 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173743 

From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Thomas Zander <thomas.e.zander@googlemail.com>
Cc: bug-followup@freebsd.org
Subject: Re: ports/173743: Fix build problem for mplayer/mencoder when DEBUG
 option is set
Date: Wed, 13 Mar 2013 12:53:23 -0500

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 ------enig2HKIPXVMVJGAPMHQMHUFB
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 On 3/13/2013 12:48 PM, Thomas Zander wrote:
 > On 13 March 2013 18:30, Bryan Drewery <bdrewery@freebsd.org> wrote:
 >> Is this still an issue? I was able to build on i386 with DEBUG just
 >> fine, without the patch.
 >=20
 > It was definitely an issue back then when I submitted the pr.
 > Having said that, a couple of days ago I have sent a CFT for a quite
 > massive change to the port to the ports mailing list.
 > When this gets committed, this pr will become obsolete anyway. Having
 > this in mind, I think we can close this PR.
 >=20
 > Best regards
 > Riggs
 >=20
 
 Sounds good. Thank you for the prompt reply.
 
 --=20
 Regards,
 Bryan Drewery
 bdrewery@freenode/EFNet
 
 
 ------enig2HKIPXVMVJGAPMHQMHUFB
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
 iQIcBAEBAgAGBQJRQL0cAAoJEG54KsA8mwz5BPIQAIjZV8xqdlCEmo5MjDdOz2II
 vKnXerZ1rhLLwcHZCrbq4lgjViCW4NKCAM53GsPeW2rhCJER6bgQH9qzAWVGJUTp
 SXSnMYKeuhhwrAGMCCw5FVjNr4eHStu6Mtee0dMySpPntVLW9qzQl9938qcntgfs
 q5kUsWAsiPAtaR+ZBA8Ko11o3C9JIzAfAZvwWzBy2EOleo8Po6CxjMEEEiahqtHj
 YeWr5dNWyP+0xMR+WkLkFv0M0vp7L5gZMnU/Z7gltyfchwfhho0rjaN4boYRaKqR
 jhOxpDOtpvjOF0oVI2CzgF6xFdg7xMd4JX2iERHxmrrFf7LHs/FT9R4zASjBXAXF
 5SR/Szf+HmwuxCHpR5a3ad3l87YQNc3/ZEIMCK0teecpgM6mvzZOa6FdiNwuYNRL
 a68PfMIdv5Hom5TtneUe4ZuO5UjE7oX6FKim8dbB7sAVSZY1AOYCwMf3KfcakIEK
 B27bBicEV620dKmr/VnwNiXeavGTD1m19YkVHJHjwXGFUJlWSllIysjpr5IjCz+g
 GhtVmgFTZYLRsOBCa3ESUhdrVBS/uXk8umnYQUTD1v6rjRj1r6eZLuZDF1rOyQUE
 wnqCphhPL7XcNFPijvet5YKR2I4jOEq4to+fedbmn9VYvoHrf1C1qYsTIb+QnwCs
 pqpR/wePB0E/qQLYaAQc
 =amLl
 -----END PGP SIGNATURE-----
 
 ------enig2HKIPXVMVJGAPMHQMHUFB--
>Unformatted:
