Re: dynamic object dependencies of libvpx.so in wip/libvpx

Rui-Xiang Guo <[email protected]>
Newsgroups gmane.os.netbsd.devel.packages,gmane.os.netbsd.devel.pkgsrc.wip.general
Message-ID <20110116143601.GA461@tree>
On Sun, Jan 16, 2011 at 06:58:48AM +0900, Ryo ONODERA wrote:
> Hi,
> 
> Manually libtool-ized libvpx.so from wip/libvpx has
> inappropriate ldd output.
> 
> Original build's ldd output:
> /usr/tmp/wip/libvpx/work/libvpx-v0.9.5/libvpx.so.0.9.5:
>         -lpthread.1 => /usr/lib/libpthread.so.1
>         -lc.12 => /usr/lib/libc.so.12
>         -lm.0 => /usr/lib/libm.so.0
> 
> Libtool-ized build's ldd output
> /usr/tmp/wip/libvpx/work/libvpx-v0.9.5/.libs/libvpx.so.0.9.5:
>         -lc.12 => /usr/lib/libc.so.12
> 
> 
> Can anyone provide me clue for this problem?

Hi,
The extralibs are missing. The patches may fix the issue.

-rxg
patch-aa (text/plain, 2.4 KB)
$NetBSD$

--- build/make/Makefile.orig	2010-10-28 13:14:14.000000000 +0000
+++ build/make/Makefile
@@ -102,7 +102,7 @@ $(BUILD_PFX)%.c.d: %.c
 
 $(BUILD_PFX)%.c.o: %.c
 	$(if $(quiet),@echo "    [CC] $@")
-	$(qexec)$(CC) $(CFLAGS) -c -o $@ $<
+	$(qexec)${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
 
 $(BUILD_PFX)%.asm.d: %.asm
 	$(if $(quiet),@echo "    [DEP] $@")
@@ -112,7 +112,8 @@ $(BUILD_PFX)%.asm.d: %.asm
 
 $(BUILD_PFX)%.asm.o: %.asm
 	$(if $(quiet),@echo "    [AS] $@")
-	$(qexec)$(AS) $(ASFLAGS) -o $@ $<
+	$(qexec)${LIBTOOL} --mode=compile --tag=CC sh strip_fPIC.sh \
+	    $(AS) $(ASFLAGS) -o $@ $<
 
 $(BUILD_PFX)%.s.d: %.s
 	$(if $(quiet),@echo "    [DEP] $@")
@@ -188,7 +189,8 @@ define linker_template
 $(1): $(filter-out -%,$(2))
 $(1):
 	$(if $(quiet),@echo    "    [LD] $$@")
-	$(qexec)$$(LD) $$(strip $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
+	$(qexec)${LIBTOOL} --mode=link $(CC) -o $$@ $$(filter-out -lvpx,$(2)) \
+	    libvpx.la
 endef
 # make-3.80 has a bug with expanding large input strings to the eval function,
 # which was triggered in some cases by the following component of
@@ -201,8 +203,12 @@ endef
 define install_map_template
 $(DIST_DIR)/$(1): $(2)
 	$(if $(quiet),@echo "    [INSTALL] $$@")
-	$(qexec)mkdir -p $$(dir $$@)
-	$(qexec)cp -p $$< $$@
+	$(qexec)${BSD_INSTALL_DATA} -d -m 755 $$(dir $$@)
+	$$(if $$(filter %.a,$$<), \
+	${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} -c $$(patsubst %.a,%.la,$$<) $$(dir $$@), \
+	$$(if $$(filter %.h,$$<), \
+	${BSD_INSTALL_DATA} -c -m 644 $$< $$(dir $$@), \
+	${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} -c -s $$< $$(dir $$@)))
 endef
 
 define archive_template
@@ -211,7 +217,9 @@ define archive_template
 # for creating them.
 $(1):
 	$(if $(quiet),@echo "    [AR] $$@")
-	$(qexec)$$(AR) $$(ARFLAGS) $$@ $$?
+	$(qexec)${LIBTOOL} --mode=link $(CC) -o $$(patsubst %.a,%.la,$$@) \
+	    $$(patsubst %.o,%.lo,$$?) -rpath $(DIST_DIR)/lib $$(extralibs) \
+	    -version-info $(VERSION_MINOR):$(VERSION_PATCH):$(VERSION_MINOR)
 endef
 
 define so_template
@@ -290,7 +298,7 @@ clean::
 LIBS=$(call enabled,LIBS)
 .libs: $(LIBS)
 	@touch $@
-$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
+$(foreach lib,$(filter %.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
 $(foreach lib,$(filter %so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
 
 INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
patch-ab (text/plain, 587 B)
$NetBSD$

--- libs.mk.orig	2010-10-28 13:14:14.000000000 +0000
+++ libs.mk
@@ -176,8 +176,9 @@ endif
 else
 LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS)
-LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
-$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
+LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libvpx.a
+$(BUILD_PFX)libvpx.a: $(LIBVPX_OBJS)
+$(BUILD_PFX)libvpx.a: extralibs += -lm -pthread
 
 BUILD_LIBVPX_SO         := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
 LIBVPX_SO               := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.