Package: libace-perl Version: 1.92-10 Severity: normal X-Debbugs-Cc: nil...@debian.org
Dear Maintainer, libace-erl fails to cross build from source: a) It uses build compiler and linker instead of host compiler at various places b) It uses the triplet of build compiler for installation The patch attached below fixes the problem. I'll also commit this to salsa shortly after filing this bug report, so we can upload this after bullseye release. -- System Information: Debian Release: bullseye/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 5.7.0-2-amd64 (SMP w/8 CPU threads) Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages libace-perl depends on: ii libc6 2.31-3 pn libcache-cache-perl <none> ii perl 5.30.3-4 pn perlapi-5.32.1 <none> Versions of packages libace-perl recommends: ii libcgi-pm-perl 4.50-1 ii libgd-perl 2.72-2 libace-perl suggests no packages.
commit 7afbb565e411547d921be65713504659e58ca46f Author: Nilesh Patra <nil...@debian.org> Date: Wed Jun 2 02:08:15 2021 +0530 d/p/cross.patch,d/rules,d/control: Make build cross buildable diff --git a/debian/control b/debian/control index 483b0af..e696474 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,8 @@ Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional Build-Depends: debhelper-compat (= 13), - libtirpc-dev + libtirpc-dev, + perl-xs-dev Standards-Version: 4.5.1 Vcs-Browser: https://salsa.debian.org/med-team/libace-perl Vcs-Git: https://salsa.debian.org/med-team/libace-perl.git diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch new file mode 100644 index 0000000..7d9505f --- /dev/null +++ b/debian/patches/cross.patch @@ -0,0 +1,78 @@ +Description: Use host compiler and linker instead of build compiler +Author: Nilesh Patra <nil...@debian.org> +Last-Update: 2021-06-01 +--- a/acelib/Makefile ++++ b/acelib/Makefile +@@ -2,6 +2,7 @@ + false = 0 + RANLIB_NEEDED = true # default overridable in $(ACEDB_MACHINE)_DEF + AR_OPTIONS = rlu # default overridable in $(ACEDB_MACHINE)_DEF ++AR = ar + + RPCGEN_FLAGS = -I -K -1 + # -I -K -1 good for alpha +@@ -42,7 +43,7 @@ + ## Different platforms use CC or COMPILE.c + # (USEROPTS - see comments at top of file) + # +-CC = $(COMPILER) $(CFLAGS) $(CPPFLAGS) $(USEROPTS) $(IDIR) -D$(NAME) -c ++CC_compile = $(COMPILER) $(CFLAGS) $(CPPFLAGS) $(USEROPTS) $(IDIR) -D$(NAME) -c + COMPILE.c = $(COMPILER) $(CFLAGS) $(CPPFLAGS) $(USEROPTS) $(IDIR) -D$(NAME) -c + + ########################################################### +@@ -63,11 +64,11 @@ + ################## libraries ######################### + + libaceperl.a : $(FREE_OBJS) aceclientlib.o rpcace_clnt.o rpcace_xdr.o +- ar $(AR_OPTIONS) $@ $? ++ $(AR) $(AR_OPTIONS) $@ $? + if ( $(RANLIB_NEEDED) ) then ranlib $@; fi + + libfree.a : $(FREE_OBJS) +- ar $(AR_OPTIONS) libfree.a $? ++ $(AR) $(AR_OPTIONS) libfree.a $? + if ( $(RANLIB_NEEDED) ) then ranlib libfree.a; fi + + ######################################### +@@ -87,7 +88,7 @@ + LIBACE_OBJS = $(GENERIC_ACE_OBJS) $(GENERIC_ACE_NONGRAPH_OBJS) aceversion.o + + libace.a : $(LIBACE_OBJS) +- ar $(AR_OPTIONS) libace.a $? ++ $(AR) $(AR_OPTIONS) libace.a $? + if ( $(RANLIB_NEEDED) ) then ranlib libace.a; fi + + ###################################################### +@@ -106,7 +107,7 @@ + rpcace_sp.o: rpcace_sp.c rpcace_svc.c + + aceclientlib.o: aceclientlib.c rpcace.h +- $(CC) $(LDFLAGS) -c $< ++ $(CC_compile) $(LDFLAGS) -c $< + + RPC_CLIENT_OBJS = aceclientlib.o rpcace_clnt.o rpcace_xdr.o + RPC_SERVER_OBJS = rpcace_sp.o rpcace_xdr.o +@@ -114,7 +115,7 @@ + RPC_X_CLIENT_OBJS = xclient.o aceclientlib.o rpcace_clnt.o rpcace_xdr.o + + libacecl.a : aceclientlib.o rpcace_clnt.o rpcace_xdr.o +- ar $(AR_OPTIONS) libacecl.a $? ++ $(AR) $(AR_OPTIONS) libacecl.a $? + if ( $(RANLIB_NEEDED) ) then ranlib libacecl.a; fi + + ########################################################### +--- a/acelib/wmake/LINUX_DEF ++++ b/acelib/wmake/LINUX_DEF +@@ -15,9 +15,10 @@ + ##### following the explanations given in wmake/truemake ##### + ################################################################# + ++CC = gcc + NAME = LINUX +-COMPILER = gcc -g -Wall -O2 -DACEDB4 +-LINKER = gcc -g ++COMPILER = $(CC) -g -Wall -O2 -DACEDB4 ++LINKER = $(CC) -g + USEROPTS=-fPIC + + LIBS = -lm diff --git a/debian/patches/series b/debian/patches/series index 1baabf4..a794d09 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ parallel-ftbfs.patch defined_hash_array.patch libtirpc.patch hardening.patch +cross.patch diff --git a/debian/rules b/debian/rules index b017896..254dd35 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,10 @@ PACKAGE = $(shell dh_listpackages) TMP = $(CURDIR)/debian/$(PACKAGE) export DEB_BUILD_MAINT_OPTIONS=hardening=+all +include /usr/share/dpkg/buildtools.mk +include /usr/share/dpkg/architecture.mk +PERLVER := $(shell perl -MConfig -e 'print $$Config{version}') +ARCHLIB := $(shell perl -I/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config-$(PERLVER) -MConfig -e 'print $$Config{vendorarch}') %: dh $@ @@ -27,8 +31,9 @@ override_dh_auto_build: # Directory for the acebrowser CGI scripts (~username ok): [/usr/local/apache/cgi-bin/ace] # Directory does not exist. Shall I create it for you? [y] # Directory for the acebrowser HTML files and images (~username ok): [/usr/local/apache/htdocs/ace] - perl -e "print qq(3\ny\n$(CURDIR)/debian/$(PACKAGE)/etc/libace-perl\ny\n$(CURDIR)/debian/$(PACKAGE)/usr/lib/cgi-bin\ny\n$(CURDIR)/debian/$(PACKAGE)/usr/share/$(PACKAGE))" | $(PERL) Makefile.PL INSTALLDIRS=vendor - dh_auto_build -- OPTIMIZE="$(CFLAGS)" LD_RUN_PATH="" OTHERLDFLAGS="$(LDFLAGS)" + perl -e "print qq(3\ny\n$(CURDIR)/debian/$(PACKAGE)/etc/libace-perl\ny\n$(CURDIR)/debian/$(PACKAGE)/usr/lib/cgi-bin\ny\n$(CURDIR)/debian/$(PACKAGE)/usr/share/$(PACKAGE))" | $(PERL) Makefile.PL \ + INSTALLDIRS=vendor CC=$(CC) LD=$(CC) INSTALLVENDORARCH=$(ARCHLIB) INSTALLARCHLIB=$(ARCHLIB) + dh_auto_build --buildsystem=makefile -- OPTIMIZE="$(CFLAGS)" LD_RUN_PATH="" OTHERLDFLAGS="$(LDFLAGS)" override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))