[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#549407: [buildd-tools-devel] Bug#549407: ivtools 1.2.6-1 FTBFS on sparc and powerpc



2009/11/9 Agustin Martin <agmartin@debian.org>:

> Answering myself. No, it is not. I have prepared an sbuild+schroot setup in
> a i386 box, using lenny schroot and bleeding edge sbuild (HEAD from sbuild
> git repo, 355a4dffe742445713ea089436da077fc7a40ae8).
>
> I can reproduce the problem with that sbuild version in the i386 box.
>  However, I cannot reproduce it at all with pbuilder or with plain build in
> normal filesystem.
>
> ivtools uses imake to regenerate makefiles on each run. When the problem is
> reproduced, I noticed that the path set by imake is something (wrong) like
>
> .../buildd-ivtools_1.2.6-1+nmu2-1-2p04ki
>
> while the real path is something like
>
> .../buildd-ivtools_1.2.6-1+nmu2-powerpc-2p04ki

Good news. I finally found the reason for this problem. An explanation
was not that far. Quoting http://www.ivtools.org/ivtools/faq.html,

-----------------------
* The absolute pathname used by the "make depend" pass is not the same
as the ABSTOP pathname written to config/config.mk by the configure
script.

There is a vulnerability in the "make Makefiles" pass (the use of
imake), where absolute pathnames that incorporate predefined C symbols
get these symbols expanded to another value. For example, most
PC-based uses of gcc have i386 defined to 1, so a path like
/usr/src/i386/ivtools-1.0 gets expanded to /usr/src/1/ivtools-1.0. To
check the set of pre-defined symbols, enter this command: touch
test.c;gcc -dM -E test.c.

You can either rename the affected directory in which ivtools resides,
or you can add -U undefine arguments as necessary to the imake command
line. See the definition of ImakeFlags in config/site.def.NETBSD for
an example.
-----------------------

As I understand it, this problem should also be present in other
packages using imake.  Not sure if many packages still use imake, but
if so there is a problem with the temporary dir naming in sbuild.

However, this problem seems a bit nonsensic, so if only few packages
still use imake we can try working around this problem by making sure
imake is invoked with -U`dpkg --print-architecture`. I hope this has
no side effects.

I am attaching a patch with the current changes in my box. I can
successfully build ivtools with sbuild in this i386 box where I
previously could not.

It includes some other minor changes:
 - Revert the -j introduced in my last NMU.
 - Disable 015_Makefile_dontstrip.diff. Since imake rewrites Makefile,
   patches for it cannot be  reverted later if built in the same dir. This is
   now done in configure through config.mk.

Comments are more than welcome. If there are no objections I will set
the final version number and upload at some time in the middle of next
week.

Cheers,

-- 
Agustin
diff -u ivtools-1.2.6/debian/changelog ivtools-1.2.6/debian/changelog
--- ivtools-1.2.6/debian/changelog
+++ ivtools-1.2.6/debian/changelog
@@ -1,3 +1,16 @@
+ivtools (1.2.6-1+nmu2~a3) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/rules: 
+    - Reverting 1.2.6-1+nmu2 -j1 addition to keep package clean.
+    - Fix ARCH evaluation.
+    - Use generic $(MAKE) instead of make.
+    - Make sure imake is always called with -U$(ARCH) (Closes: #549407).
+  * 01_configure.diff: Handle disabling of early binary stripping.
+  * 015_Makefile_dontstrip.diff: Disable patch.
+
+ --  Agustin Martin Domingo <agmartin@debian.org>  Sun, 06 Dec 2009 04:41:51 +0100
+
 ivtools (1.2.6-1+nmu2) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u ivtools-1.2.6/debian/rules ivtools-1.2.6/debian/rules
--- ivtools-1.2.6/debian/rules
+++ ivtools-1.2.6/debian/rules
@@ -16,7 +16,7 @@
 # so for alpha we just don't have ace, who uses it
 # anyhow ?
 
-ARCH = $(dpkg --print-architecture)
+ARCH = $(shell dpkg --print-architecture)
 
 ifeq "$(ARCH)" "alpha"
 ACE =
@@ -24,6 +24,9 @@
 # ACE = --with-ace=/usr/include --with-ace-libs=/usr/lib
 endif
 
+# Make sure this symbol is disabled when imake is invoked.
+MAKE += SPECIAL_IMAKEFLAGS="-U$(ARCH)"
+
 build: build-stamp
 build-stamp:
 	dh_testdir
@@ -41,9 +44,9 @@
 
 	#  Compile the packages
 
-	make Makefile ARCH=LINUX
-	make Makefiles ARCH=LINUX
-	make -j1 ARCH=LINUX
+	$(MAKE) Makefile ARCH=LINUX
+	$(MAKE) Makefiles ARCH=LINUX
+	$(MAKE) ARCH=LINUX
 
 	#   BUILD FINISHED
 	# -----------------------------------------------------------
@@ -59,8 +62,8 @@
 		    --mandir=$(CURDIR)/debian/tmp/usr/share/man
 
 	cd src/scripts && \
-	  make ARCH=LINUX clean && \
-	  make ARCH=LINUX CONFIGDIRSPEC='-T template -I/usr/lib/ivtools/config -DCURDIR=\$(CURDIR)'\
+	  $(MAKE) ARCH=LINUX clean && \
+	  $(MAKE) ARCH=LINUX CONFIGDIRSPEC='-T template -I/usr/lib/ivtools/config -DCURDIR=\$(CURDIR)'\
  MAKEMAKESPEC='ARCH=LINUX'
 	touch build-stamp
 
@@ -83,8 +86,8 @@
 	-rm config.cache
 
 	-rm -rf static shared
-	[ ! -f Makefile ] || make ARCH=LINUX clean
-	[ ! -f src/scripts/Makefile ] || (cd src/scripts;make clean)
+	[ ! -f Makefile ] || $(MAKE) ARCH=LINUX clean
+	[ ! -f src/scripts/Makefile ] || (cd src/scripts;$(MAKE) clean)
 
 #      remove backups
 	-rm -f `find . -name "*~"`
@@ -102,10 +105,10 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/tmp.
-	make install ARCH=LINUX DESTDIR=$(CURDIR)/debian/tmp
+	$(MAKE) install ARCH=LINUX DESTDIR=$(CURDIR)/debian/tmp
 
 	cp debian/template $(CURDIR)/debian/tmp/usr/lib/ivtools/config/
-	[ ! -f src/glyphs/Makefile ] || (cd src/glyphs && make clean)
+	[ ! -f src/glyphs/Makefile ] || (cd src/glyphs && $(MAKE) clean)
 	# don't include the scripts
 
 #       ivtools installs the libACE link, we remove it ... hack
diff -u ivtools-1.2.6/debian/patches/series ivtools-1.2.6/debian/patches/series
--- ivtools-1.2.6/debian/patches/series
+++ ivtools-1.2.6/debian/patches/series
@@ -1,5 +1,4 @@
 01_configure.diff
-015_Makefile_dontstrip.diff
 02_rules_def.diff
 025_params_def.diff
 026_geomobjs_c.diff
diff -u ivtools-1.2.6/debian/patches/01_configure.diff ivtools-1.2.6/debian/patches/01_configure.diff
--- ivtools-1.2.6/debian/patches/01_configure.diff
+++ ivtools-1.2.6/debian/patches/01_configure.diff
@@ -1,8 +1,15 @@
-Index: ivtools-1.2/configure
+This patch modfies the configure scripts for different purposes:
+
+* Modify how config/config.mk is built:
+  - Make 'make CPU' more silent.
+  - Do not strip binaries during the build process. Will be done later
+    from debian/rules.
+
+Index: ivtools-1.2.6/configure
 ===================================================================
---- ivtools-1.2.orig/configure	2009-09-04 12:19:47.000000000 -0400
-+++ ivtools-1.2/configure	2009-09-04 12:20:02.000000000 -0400
-@@ -5129,8 +5129,8 @@
+--- ivtools-1.2.6.orig/configure	2009-11-30 12:08:21.000000000 +0100
++++ ivtools-1.2.6/configure	2009-11-30 12:08:54.000000000 +0100
+@@ -5129,8 +5129,10 @@
  echo XCONFIGDIR = $x_libraries/X11/config >config/config.mk
  echo writing \"ABSTOP = `pwd`\"
  echo ABSTOP = `pwd` >>config/config.mk
@@ -10,14 +17,16 @@
 -echo CPU = `make CPU` >>config/config.mk
 +echo writing \"CPU = `make -s CPU`\"
 +echo CPU = `make -s CPU` >>config/config.mk
++echo Disable INSTPGMFLAGS. Do not strip binaries now, but from debian/rules
++echo INSTPGMFLAGS = >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
  echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
-Index: ivtools-1.2/configure.in
+Index: ivtools-1.2.6/configure.in
 ===================================================================
---- ivtools-1.2.orig/configure.in	2009-09-04 12:20:10.000000000 -0400
-+++ ivtools-1.2/configure.in	2009-09-04 12:20:26.000000000 -0400
-@@ -472,8 +472,8 @@
+--- ivtools-1.2.6.orig/configure.in	2009-11-30 12:08:21.000000000 +0100
++++ ivtools-1.2.6/configure.in	2009-11-30 12:09:08.000000000 +0100
+@@ -472,8 +472,10 @@
  echo XCONFIGDIR = $x_libraries/X11/config >config/config.mk
  echo writing \"ABSTOP = `pwd`\"
  echo ABSTOP = `pwd` >>config/config.mk
@@ -25,6 +34,8 @@
 -echo CPU = `make CPU` >>config/config.mk
 +echo writing \"CPU = `make -s CPU`\"
 +echo CPU = `make -s CPU` >>config/config.mk
++echo Disable INSTPGMFLAGS. Do not strip binaries now, but from debian/rules
++echo INSTPGMFLAGS = >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
  echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
diff -u ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff
--- ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff
+++ ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff
@@ -1,3 +1,10 @@
+This patch is currently disabled. Not stripping binaries until 
+debian/rules is now handled through 01_configure.diff 
+
+Since imake+xmkmf rebuilds Makefiles everytime, this is much better,
+because otherwise Makefile is changed back by imake+xmkmf during build
+and this patch can no longer be reverted.
+
 Index: ivtools-1.2/Makefile
 ===================================================================
 --- ivtools-1.2.orig/Makefile	2009-09-05 22:06:50.000000000 -0400

Reply to: