Hi Peter,

I was about committing new changes to fix build issue and saw that you
already have fix that.

If you don't mind I'd like to change your patch slightly as follow (cf
attached patch)
Please note that fpmake is a build tool which is compiled and ran on
host while building the compiler (unless I'm confusing DEB_HOST_TARGET
and DEB_BUILD_TARGET). But in any case, doc and fpmake should build for
the same target I assume.

Cheers,
From 01fdba267503b52bb63b880a86305d79293183c9 Mon Sep 17 00:00:00 2001
From: Abou Al Montacir <abou.almonta...@sfr.fr>
Date: Thu, 30 May 2013 23:29:30 +0200
Subject: [PATCH] Fix linking issue under powerpc, sparc and arm targets.

---
 debian/changelog |   11 +++++------
 debian/rules     |   15 +++++----------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 503a2c1..fef17a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,19 +3,18 @@ fpc (2.6.2-2) unstable; urgency=low
   [Abou Al Montacir]
   * debian/rules
     - Allow generating each autogenrated file separately on demand.
-    - Avoid changing content of hidden directory .pc as this is used by quilt and changing its content may cause some tricky issues. 
+    - Avoid changing content of hidden directory .pc as this is used by quilt and changing its content may cause some tricky issues.
+  * Pass "-z relro" to linker to remove lintian error.
 
   [Peter Michael Green]
   * debian/patches/armhf-build-with-2.6.0
     - fixup some conditionals in arm assembler to avoid using instrutions that
       fpc 2.6.0 doesn't support when building the rtl with 2.6.0 (first stage)
   * debian/rules
-    - Pass 'PPCFPMAKE=$PPCNEW -Fl/usr/lib/$(DEB_BUILD_MULTIARCH)' during 
-      packages build so that fpmake links successfully.
-    - Pass 'OPT=-Fl/usr/lib/$(DEB_HOST_MULTIARCH)' during utils build so
-      fpdoc links successfully.
+    - Pass multi-arch libraries path to the linker to fix build under powerpc,
+      arm, and sparc architectures.
 
- -- Peter Michael Green <plugw...@debian.org>  Thu, 30 May 2013 11:16:27 +0000
+ -- Abou Al Montacir <abou.almonta...@sfr.fr>  Thu, 30 May 2013 23:11:05 +0200
 
 fpc (2.6.2-1) unstable; urgency=low
 
diff --git a/debian/rules b/debian/rules
index df3a498..6cd2570 100755
--- a/debian/rules
+++ b/debian/rules
@@ -98,7 +98,9 @@ unexport FPCDIR
 NEWPP=$(BUILD_DIR)/fpcsrc/compiler/$(PPNEW)
 NEWFPDOC=$(BUILD_DIR)/fpcsrc/utils/fpdoc/fpdoc
 # Set default compilation options
-BUILDOPTS=PP=$(NEWPP)
+LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS | sed -e 's/-Wl,//g' -e 's/,/ /g')
+DEB_HOST_MULTIARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+BUILDOPTS=PP=$(NEWPP) OPT="-k\"${LDFLAGS}\" -Fl/usr/lib/${DEB_HOST_MULTIARCH}"
 ifdef CROSSOPT
 BUILDOPTS+= CROSSOPT=${CROSSOPT}
 endif
@@ -119,13 +121,6 @@ else
   CYCLEOPTS=
 endif
 
-DEB_HOST_MULTIARCH ?=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-DEB_BUILD_MULTIARCH ?=$(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
-
-#FIXME: this won't work for cross-building.
-FPMAKEBUILDOPTS := 'FPCFPMAKE=$(PPNEW) -Fl/usr/lib/$(DEB_BUILD_MULTIARCH)'
-
-
 #export DH_VERBOSE=1
 
 ###################
@@ -216,9 +211,9 @@ build-arch-stamp:
 	# Then build RTL using new compiler
 	$(MAKE) -C fpcsrc rtl_clean rtl_smart $(BUILDOPTS)
 	# Finally build packages and tools using new compiler and new RTL
-	$(MAKE) -C fpcsrc packages_smart $(BUILDOPTS) $(FPMAKEBUILDOPTS)
+	$(MAKE) -C fpcsrc packages_smart $(BUILDOPTS)
 	$(MAKE) -C fpcsrc ide_all $(BUILDOPTS)
-	$(MAKE) -C fpcsrc utils_all $(BUILDOPTS) 'OPT=-Fl/usr/lib/$(DEB_HOST_MULTIARCH)'
+	$(MAKE) -C fpcsrc utils_all $(BUILDOPTS)
 	touch build-arch-stamp
 
 install-arch: build-arch install-arch-stamp
-- 
1.7.10.4

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to