tags 463277 +patch
thanks
I tried to debug this by adding printf statements and came to the
conclusion that it appears to be a compiler bug. It crashed during a
call to a callback. Adding printf statements to that callback stopped it
crashing (but it went on to crash in another similar callback)
Givent this suspicion I tried disabling optimisation. This was a little
tricky as though there was a CFLAGS set in debian/rules it didn't seem
to have any affect on the build process. However that did not fix it.
I established that the last time a buildd successfully built this on arm
it used gcc-4.1 and afaict the buildds never tried to build it with 4.2.
So the next thing I tried was using older gcc versions 4.2 failed and
4.1 works
A patch to make afnix build using g++-4.1 on arm has been attatched.
Note: my testing was done in qemu, I don't have access to real arm hardware.
diff -urN afnix-1.5.2/cnf/mak/afnix-gcc-4.1.mak afnix-1.5.2.new/cnf/mak/afnix-gcc-4.1.mak
--- afnix-1.5.2/cnf/mak/afnix-gcc-4.1.mak 1970-01-01 00:00:00.000000000 +0000
+++ afnix-1.5.2.new/cnf/mak/afnix-gcc-4.1.mak 2008-07-29 14:34:51.000000000 +0000
@@ -0,0 +1,157 @@
+# ----------------------------------------------------------------------------
+# - afnix-gcc-4.2 -
+# - afnix compiler configuration - forced gcc 4.1 configuration -
+# - created by peter green based on afnix-gcc-4.mak to workarround a build -
+# - issue on arm
+# ----------------------------------------------------------------------------
+# - This program is free software; you can redistribute it and/or modify -
+# - it provided that this copyright notice is kept intact. -
+# - -
+# - This program is distributed in the hope that it will be useful, but -
+# - without any warranty; without even the implied warranty of -
+# - merchantability or fitness for a particular purpose. In not event shall -
+# - the copyright holder be liable for any direct, indirect, incidental or -
+# - special damages arising in any way out of the use of this software. -
+# ----------------------------------------------------------------------------
+# - copyright (c) 1999-2007 amaury darsch -
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# - compiler and linker section -
+# ----------------------------------------------------------------------------
+
+CC = g++-4.1
+LD = gcc-4.1
+LK = gcc-4.1
+AR = ar
+RANLIB = ranlib
+STDEVFLAGS =
+STDCCFLAGS = -Wall -fno-builtin
+STACCFLAGS =
+DYNCCFLAGS = -fPIC
+PLTCCFLAGS = -MMD
+DEBUGFLAGS = -g
+OPTCCFLAGS = -O2
+PFLCCFLAGS = -g -pg
+COVCCFLAGS = -g -fprofile-arcs -ftest-coverage
+CPPCCFLAGS = -nostdinc -nostdinc++
+CXXCCFLAGS =
+STDDEFINES = -D_REENTRANT
+DBGDEFINES = -DDEBUG
+OPTDEFINES =
+STDINCLUDE =
+AFXCPPTYPE = GNU
+AFXCPPVERS = 4
+
+# ----------------------------------------------------------------------------
+# - compiler dependant libraries -
+# ----------------------------------------------------------------------------
+
+# adjust for darwin platform
+ifeq ($(PLATNAME),darwin)
+PLTSDKROOT = $(SDKDIR)
+PLTSDKARCH = -arch ppc -arch i686
+PLTCCFLAGS = -isysroot ${PLTSDKROOT} $(PLTSDKARCH)
+PLTLDFLAGS = $(PLTCCFLAGS)
+PLTLKFLAGS = $(PLTCCFLAGS)
+PLTEVFLAGS = MACOSX_DEPLOYMENT_TARGET=10.4
+endif
+
+# ----------------------------------------------------------------------------
+# - platform dependant linking flags -
+# ----------------------------------------------------------------------------
+
+# adjust for linux platform
+ifeq ($(PLATNAME),linux)
+ARFLAGS = rc
+LDFLAGS = -shared
+ifeq ($(LKMODE),soname)
+LDFLAGS += -Wl,-soname,$(SONAME)
+endif
+AFXCPPLIBS = -lsupc++
+endif
+
+# adjust for solaris platform
+ifeq ($(PLATNAME),solaris)
+ARFLAGS = rc
+LDFLAGS = -shared
+ifeq ($(LKMODE),soname)
+LDFLAGS += -Wl,-h,$(SONAME)
+endif
+AFXCPPLIBS = -lsupc++
+endif
+
+# adjust for freebsd platform
+ifeq ($(PLATNAME),freebsd)
+LD = g++
+LK = g++
+ARFLAGS = rc
+LDFLAGS = -shared
+ifeq ($(LKMODE),soname)
+LDFLAGS += -Wl,-soname,$(SONAME)
+endif
+AFXCPPLIBS =
+endif
+
+# adjust for darwin platform
+ifeq ($(PLATNAME),darwin)
+LD = g++
+LK = g++
+ARFLAGS = -rc
+LDFLAGS = -dynamiclib $(PLTLDFLAGS)
+ifeq ($(LKMODE),dylib)
+LDFLAGS += -compatibility_version $(MAJOR).$(MINOR)
+LDFLAGS += -current_version $(MAJOR).$(MINOR).$(PATCH)
+else
+$(error, "undefined darwin linking mode")
+endif
+AFXCPPLIBS =
+endif
+
+# adjust for gnu/freebsd platform
+ifeq ($(PLATNAME),gnukbsd)
+ARFLAGS = rc
+LDFLAGS = -shared
+ifeq ($(LKMODE),soname)
+LDFLAGS += -Wl,-soname,$(SONAME)
+endif
+AFXCPPLIBS = -lsupc++
+endif
+
+# ----------------------------------------------------------------------------
+# - platform dependant final executable flags -
+# ----------------------------------------------------------------------------
+
+LKFLAGS =
+
+# adjust linker flags for freebsd
+ifeq ($(PLATNAME),freebsd)
+LKFLAGS = -pthread
+endif
+
+# adjust linker flags for darwin
+ifeq ($(PLATNAME),darwin)
+LKFLAGS = $(PLTLKFLAGS)
+endif
+
+# ----------------------------------------------------------------------------
+# - platform dependant compilation flags -
+# ----------------------------------------------------------------------------
+
+# adjust platform flag for static or dynamic
+ifeq ($(LKTYPE),dynamic)
+PLTCCFLAGS += $(DYNCCFLAGS)
+endif
+ifeq ($(LKTYPE),static)
+PLTCCFLAGS += $(STACCFLAGS)
+endif
+
+#On Debian, support 486 processors
+# adjust intel processor
+ifeq ($(PROCNAME)-$(PROCTYPE),ia32-586)
+OPTCCFLAGS += -march=i486
+endif
+ifeq ($(PROCNAME)-$(PROCTYPE),ia32-686)
+OPTCCFLAGS += -march=i486
+endif
+
diff -urN afnix-1.5.2/debian/control afnix-1.5.2.new/debian/control
--- afnix-1.5.2/debian/control 2008-07-29 14:39:01.000000000 +0000
+++ afnix-1.5.2.new/debian/control 2008-07-29 12:28:35.000000000 +0000
@@ -4,6 +4,7 @@
Maintainer: Paul Cager <[EMAIL PROTECTED]>
Build-Depends: debhelper (>= 5.0.42), dpatch (>= 2.0),
libncurses5 (>= 5.5), libncurses5-dev (>= 5.5)
+ gcc-4.1 [arm], g++-4.1 [arm]
Standards-Version: 3.7.3
Homepage: http://www.afnix.org/
diff -urN afnix-1.5.2/debian/rules afnix-1.5.2.new/debian/rules
--- afnix-1.5.2/debian/rules 2008-07-29 14:39:01.000000000 +0000
+++ afnix-1.5.2.new/debian/rules 2008-07-29 14:40:30.000000000 +0000
@@ -9,16 +9,27 @@
CFLAGS = -Wall -g
EMACS_LISP=usr/share/emacs/site-lisp
+#while a CFLAGS variable is set here the build process doesn't seem
+#to actually use it
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
+
+SETUPARGS := -o --prefix=/usr
+
+DEB_BUILD_ARCH_CPU ?=$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
+
+ifeq ($(DEB_BUILD_ARCH_CPU),arm)
+ SETUPARGS += --compiler=gcc-4.1
+endif
+
configure: configure-stamp
configure-stamp: patch-stamp
dh_testdir
- ./cnf/bin/afnix-setup -o --prefix=/usr
+ ./cnf/bin/afnix-setup $(SETUPARGS)
touch configure-stamp