Source: openldap
Version: 2.5.18+dfsg-2
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

Hi Ryan,

as I retested openldap, I figured that it would fail to cross build
(without pkg.openldap.noslapd as is used by bootstrapping). The build
fails during dh_auto_install -Dcontrib/slapd-modules/ppm. Looking
closely, this is during the install step when everything has already
been built and it happens in the ppm subdirectory. The linker step for
ppm.so is run again (despite having linked it during dh_auto_build
successfully) and since dh_auto_install does not pass cross tools to
make, it uses the build architecture compiler this time and fails. The
reason for this is that the compiler invocation happens in the ppm
target, but what is being created is ppm.so. Hence make sees that ppm
still does not exist and invokes the build instruction again. I propose
renaming the target to ppm.so (matching what actually is being created).
Then dh_auto_install will not relink ppm.so and instead install it
successfully. I'm attaching a patch for your convenience.

Helmut
--- openldap-2.5.18+dfsg.orig/contrib/slapd-modules/ppm/Makefile
+++ openldap-2.5.18+dfsg/contrib/slapd-modules/ppm/Makefile
@@ -62,18 +62,19 @@
 MANDOC=slapm-ppm.5
 MDDOC=ppm.md
 
-all: 	ppm $(TEST)
+all: 	$(PROGRAMS) $(TEST)
 
-$(TEST): ppm
+$(TEST): $(PROGRAMS)
 	$(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(LDFLAGS) $(INCS) $(LDAP_LIBS) -Wl,-rpath=. -o $(TEST) ppm_test.c $(PROGRAMS) $(LDAP_LIBS) $(CRACKLIB)
 
 ppm.o:
 	$(CC) $(CFLAGS) -fPIC $(OPT) $(CPPFLAGS) $(DEFS) -c $(INCS) ppm.c
 
-ppm: ppm.o
-	$(CC) $(LDFLAGS) $(INCS) -shared -o $(PROGRAMS) ppm.o $(CRACKLIB)
+ppm: $(PROGRAMS)
+$(PROGRAMS): ppm.o
+	$(CC) $(LDFLAGS) $(INCS) -shared -o $@ ppm.o $(CRACKLIB)
 
-install: ppm
+install: $(PROGRAMS)
 	mkdir -p $(DESTDIR)$(moduledir)
 	for p in $(PROGRAMS); do \
 		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)/$(moduledir) ; \
@@ -89,7 +90,7 @@
 	$(RM) -f ppm.o $(PROGRAMS) ppm.lo $(TEST)
 	$(RM) -rf .libs
 
-test: ppm $(TEST)
+test: $(PROGRAMS) $(TEST)
 	LDAP_SRC=$(LDAP_SRC) $(TESTS)
 
 doc:

Reply via email to