Package: libmpeg3
Version: 1.5.4-5
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oneiric ubuntu-patch



*** /tmp/tmpBv_MOB
In Ubuntu, the default configuration for the linker includes the flag 
--as-needed. With this flag activated this package fails to build
from source. 

The related bug report is: 

https://bugs.launchpad.net/ubuntu/oneiric/+source/libmpeg3/+bug/770863

The following build log snippet shows the error obtained:

Excerpt 469 lines into the build log:

amd64/libmpeg3.so.1.5.4: undefined reference to `a52_block'
amd64/libmpeg3.so.1.5.4: undefined reference to `pthread_mutexattr_init'
amd64/libmpeg3.so.1.5.4: undefined reference to `a52_frame'
amd64/libmpeg3.so.1.5.4: undefined reference to `a52_free'
amd64/libmpeg3.so.1.5.4: undefined reference to `a52_syncinfo'
amd64/libmpeg3.so.1.5.4: undefined reference to `sin'
amd64/libmpeg3.so.1.5.4: undefined reference to `a52_init'
amd64/libmpeg3.so.1.5.4: undefined reference to `pow'
amd64/libmpeg3.so.1.5.4: undefined reference to `cos'
amd64/libmpeg3.so.1.5.4: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[1]: *** [amd64/mpeg3dump] Error 1
make[1]: Leaving directory `/build/buildd/libmpeg3-1.5.4'
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
******************************************************************************
Build finished at 20110424-0609
FAILED [dpkg-buildpackage died]
Purging chroot-autobuild/build/buildd/libmpeg3-1.5.4


To reproduce this bug:

- use the flag --as-needed to the linker command, prepending 
-Wl,--as-needed to the shared library target in Makefile 

or

- Build this package with the latest alpha 2 release of Ubuntu Oneiric from:

http://cdimage.ubuntu.com/releases/oneiric/alpha-2/oneiric-alternate-i386.iso

More info regarding linker related changes can be found in:

http://lists.debian.org/debian-devel-announce/2011/02/msg00011.html

To fix this issue, this patch produces the following changes:

  * Makefile: Changed parameter order in call to linker to avoid build 
    errors with ld --as-needed


Thanks for considering the patch.


-- System Information:
Debian Release: squeeze/sid
  APT prefers natty-updates
  APT policy: (500, 'natty-updates'), (500, 'natty-security'), (500, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-8-generic (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u libmpeg3-1.5.4/Makefile libmpeg3-1.5.4/Makefile
--- libmpeg3-1.5.4/Makefile
+++ libmpeg3-1.5.4/Makefile
@@ -161,8 +161,8 @@
 
 $(SHAREDOUTPUT): $(SOBJS)
 	gcc -shared -fPIC -o $(SHAREDOUTPUT) \
-	 $(LIBS) $(SOBJS) \
-	 -Wl,-soname -Wl,$(SHLIB_SONAME)
+	 $(SOBJS) \
+	 -Wl,-soname -Wl,$(SHLIB_SONAME) $(LIBS)
 	( cd $(OBJDIR); \
 	 ln -sf $(SHLIB_FULLNAME) $(SHLIB); \
 	 ln -sf $(SHLIB_FULLNAME) $(SHLIB_SONAME) \

Reply via email to