NetBSD Problem Report #33136

From njoly@pasteur.fr  Thu Mar 23 19:42:59 2006
Return-Path: <njoly@pasteur.fr>
Received: from electre.pasteur.fr (electre.pasteur.fr [157.99.64.120])
	by narn.netbsd.org (Postfix) with ESMTP id AA9F263B909
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Mar 2006 19:42:58 +0000 (UTC)
Message-Id: <20060323194302.269D36B437@lanfeust.sis.pasteur.fr>
Date: Thu, 23 Mar 2006 20:43:02 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@netbsd.org
Subject: multimedia/libmpeg2 build failure on NetBSD/amd64
X-Send-Pr-Version: 3.95

>Number:         33136
>Category:       pkg
>Synopsis:       multimedia/libmpeg2 build failure on NetBSD/amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    wulf
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 23 19:45:00 +0000 2006
>Closed-Date:    Fri Apr 21 10:51:14 +0000 2006
>Last-Modified:  Fri Apr 21 10:51:14 +0000 2006
>Originator:     Nicolas Joly
>Release:        NetBSD 3.99.17
>Organization:
Institut Pasteur, Paris.
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 3.99.17 NetBSD 3.99.17 (LANFEUST) #0: Tue Mar 21 11:38:38 CET 2006 root@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
I just wanted to build multimedia/libmpeg2 0.4.0b on my -current NetBSD/amd64
workstation and noticed that it failed with assembly error messages:

 cc -DHAVE_CONFIG_H -I. -I../include -I/local/src/NetBSD/pkgsrc/multimedia/libmp
eg2/work/.buildlink/include -DGLX_GLXEXT_LEGACY -Wall -O2 -fomit-frame-pointer -
fno-common -MT libmpeg2arch_la-cpu_accel.lo -MD -MP -MF .deps/libmpeg2arch_la-cp
u_accel.Tpo -c cpu_accel.c  -fPIC -DPIC -o .libs/libmpeg2arch_la-cpu_accel.o
/var/tmp//ccCVSSOF.s: Assembler messages:
/var/tmp//ccCVSSOF.s:10: Error: suffix or operands invalid for `pop'
/var/tmp//ccCVSSOF.s:13: Error: suffix or operands invalid for `push'
/var/tmp//ccCVSSOF.s:16: Error: suffix or operands invalid for `pop'
/var/tmp//ccCVSSOF.s:24: Error: suffix or operands invalid for `push'
/var/tmp//ccCVSSOF.s:27: Error: suffix or operands invalid for `pop'
/var/tmp//ccCVSSOF.s:38: Error: suffix or operands invalid for `push'
/var/tmp//ccCVSSOF.s:41: Error: suffix or operands invalid for `pop'
/var/tmp//ccCVSSOF.s:52: Error: suffix or operands invalid for `push'
/var/tmp//ccCVSSOF.s:55: Error: suffix or operands invalid for `pop'
/var/tmp//ccCVSSOF.s:62: Error: suffix or operands invalid for `push'
/var/tmp//ccCVSSOF.s:65: Error: suffix or operands invalid for `pop'
gmake[2]: *** [libmpeg2arch_la-cpu_accel.lo] Error 1

This does not seems to be NetBSD specific as i got similar errors on
CentOS 4.2 Linux/x86_64 (RHEL clone).
>How-To-Repeat:
cd pkgsrc/multimedia/libmpeg2 && make
>Fix:
Apply the following patch derived from libmpeg2 CVS head.

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/libmpeg2/distinfo,v
retrieving revision 1.7
diff -u -r1.7 distinfo
--- distinfo	20 Aug 2005 11:44:09 -0000	1.7
+++ distinfo	23 Mar 2006 19:29:54 -0000
@@ -4,3 +4,4 @@
 RMD160 (mpeg2dec-0.4.0b.tar.gz) = 44df6c21e88d2c3029ef418ea46e2d6796c90004
 Size (mpeg2dec-0.4.0b.tar.gz) = 473846 bytes
 SHA1 (patch-aa) = d70e401272fe1f87a1a1866248caabe8fab77193
+SHA1 (patch-ab) = 6408f33490fcdc734f7a4247a031c00399b75859
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-ab	23 Mar 2006 19:29:54 -0000
@@ -0,0 +1,38 @@
+$NetBSD$
+
+--- libmpeg2/cpu_accel.c.orig	2006-03-23 20:07:31.000000000 +0100
++++ libmpeg2/cpu_accel.c	2006-03-23 20:08:21.000000000 +0100
+@@ -37,7 +37,7 @@
+     int AMD;
+     uint32_t caps;
+ 
+-#if !defined(PIC) && !defined(__PIC__)
++#if defined(__x86_64__) || (!defined(PIC) && !defined(__PIC__))
+ #define cpuid(op,eax,ebx,ecx,edx)	\
+     __asm__ ("cpuid"			\
+ 	     : "=a" (eax),		\
+@@ -46,7 +46,7 @@
+ 	       "=d" (edx)		\
+ 	     : "a" (op)			\
+ 	     : "cc")
+-#else	/* PIC version : save ebx */
++#else	/* PIC version : save ebx (not needed on x86_64) */
+ #define cpuid(op,eax,ebx,ecx,edx)	\
+     __asm__ ("push %%ebx\n\t"		\
+ 	     "cpuid\n\t"		\
+@@ -60,6 +60,7 @@
+ 	     : "cc")
+ #endif
+ 
++#ifndef __x86_64__ /* x86_64 supports the cpuid op */
+     __asm__ ("pushf\n\t"
+ 	     "pushf\n\t"
+ 	     "pop %0\n\t"
+@@ -77,6 +78,7 @@
+ 
+     if (eax == ebx)		/* no cpuid */
+ 	return 0;
++#endif
+ 
+     cpuid (0x00000000, eax, ebx, ecx, edx);
+     if (!eax)			/* vendor string only */

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->wulf
Responsible-Changed-By: reed@netbsd.org
Responsible-Changed-When: Fri, 24 Mar 2006 06:11:53 +0000
Responsible-Changed-Why:
Assigned to maintainer.


State-Changed-From-To: open->feedback
State-Changed-By: wulf@netbsd.org
State-Changed-When: Fri, 21 Apr 2006 07:20:56 +0000
State-Changed-Why:
Applied and committed suggested patches. Please test and report success or failure.


From: Berndt Josef Wulf <wulf@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/33136 CVS commit: pkgsrc/multimedia/libmpeg2
Date: Fri, 21 Apr 2006 07:15:38 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wulf
 Date:		Fri Apr 21 07:15:38 UTC 2006

 Modified Files:
 	pkgsrc/multimedia/libmpeg2: Makefile distinfo
 Added Files:
 	pkgsrc/multimedia/libmpeg2/patches: patch-ab

 Log Message:
 Updated libmpeg2 to 0.4.0bnb4: Applied patch supplied by njoly@pasteur.fr
 fixing x86_64 assembler code issues as identified in PR #33136.


 To generate a diff of this commit:
 cvs rdiff -r1.13 -r1.14 pkgsrc/multimedia/libmpeg2/Makefile
 cvs rdiff -r1.7 -r1.8 pkgsrc/multimedia/libmpeg2/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/multimedia/libmpeg2/patches/patch-ab

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Berndt Josef Wulf <wulf@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/33136 CVS commit: pkgsrc/doc
Date: Fri, 21 Apr 2006 07:28:12 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wulf
 Date:		Fri Apr 21 07:28:12 UTC 2006

 Modified Files:
 	pkgsrc/doc: CHANGES-2006

 Log Message:
 Updated multimedia/libmpeg2 to 0.4.0bnb4: Applied patches suggested by
 njoly@pasteur.fr fixing x86_64 assembler issues as identified in PR #33136


 To generate a diff of this commit:
 cvs rdiff -r1.34 -r1.35 pkgsrc/doc/CHANGES-2006

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Nicolas Joly <njoly@pasteur.fr>
To: gnats-bugs@netbsd.org
Cc: wulf@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	njoly@pasteur.fr
Subject: Re: pkg/33136 (multimedia/libmpeg2 build failure on NetBSD/amd64)
Date: Fri, 21 Apr 2006 10:34:41 +0200

 On Fri, Apr 21, 2006 at 07:20:57AM +0000, wulf@netbsd.org wrote:
 > Synopsis: multimedia/libmpeg2 build failure on NetBSD/amd64
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: wulf@netbsd.org
 > State-Changed-When: Fri, 21 Apr 2006 07:20:56 +0000
 > State-Changed-Why:
 > Applied and committed suggested patches. Please test and report success or failure.

 I just updated multimedia/libmpeg2 sources, rebuilded ... and it
 works (got about 690 fps with mpeg2dec on a 1.5GB stream).

 Thanks.

 -- 
 Nicolas Joly

 Biological Software and Databanks.
 Institut Pasteur, Paris.

State-Changed-From-To: feedback->closed
State-Changed-By: wulf@netbsd.org
State-Changed-When: Fri, 21 Apr 2006 10:51:14 +0000
State-Changed-Why:
Fixes are confirmed working by submitter


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.