Source: kamailio
Version: 4.0.4-1
Severity: wishlist
Tags: patch sid
User: [email protected]
Usertags: powerpcspe

Hi,

kamailio currently FTBFS on powerpcspe[1] like this:

=============================================================================
gcc -O9 -funroll-loops -fsigned-char -ftree-vectorize -fno-strict-overflow 
-mtune=powerpc -maltivec -Wall -g -O2 -fstack-protector 
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  
 -DNAME='"kamailio"' -DVERSION='"4.0.4"' -DARCH='"ppc"' -DOS='linux_' 
-DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.6.4"' -D__CPU_ppc -D__OS_linux 
-DSER_VER=4000004 -DCFG_DIR='"/etc/kamailio/"' -DPKG_MALLOC -DSHM_MEM 
-DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE 
-DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST 
-DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS 
-DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DFAST_LOCK -DADAPTIVE_WAIT 
-DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL 
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM 
-DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT 
-DSIGINFO64_WOR
 KARROUND
  -DUSE_FUTEX -DHAVE_SELECT   -c cfg.tab.c -o cfg.tab.o -MMD -MP
/tmp/cc4xbppR.s: Assembler messages:
/tmp/cc4xbppR.s:952: Error: unrecognized opcode: `stfd'
/tmp/cc4xbppR.s:953: Error: unrecognized opcode: `stfd'
/tmp/cc4xbppR.s:954: Error: unrecognized opcode: `stfd'
[...]
=============================================================================

AltiVec is not available on powerpcspe (only on powerpc). Therefore proposing
the attached patch.

Roland


[1] http://wiki.debian.org/PowerPCSPEPort


-- System Information:
Debian Release: 7.0
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: powerpcspe (ppc)

Kernel: Linux 3.9.0-dirty (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=locale: Cannot set 
LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
diff -ruN test/kamailio-4.0.4/debian/patches/fix-powerpcspe.patch kamailio-4.0.4/debian/patches/fix-powerpcspe.patch
--- test/kamailio-4.0.4/debian/patches/fix-powerpcspe.patch	1970-01-01 01:00:00.000000000 +0100
+++ kamailio-4.0.4/debian/patches/fix-powerpcspe.patch	2013-11-14 13:01:56.776053786 +0100
@@ -0,0 +1,38 @@
+Index: kamailio-4.0.4/Makefile.defs
+===================================================================
+--- kamailio-4.0.4.orig/Makefile.defs	2013-11-14 11:59:44.003207862 +0100
++++ kamailio-4.0.4/Makefile.defs	2013-11-14 13:01:51.380029629 +0100
+@@ -1496,19 +1496,27 @@
+ ifeq		($(CC_NAME), gcc)
+ 				C_DEFS+=-DCC_GCC_LIKE_ASM
+ 				#common stuff
+-				CFLAGS= -O9 -funroll-loops -fsigned-char $(PROFILE)
++				CFLAGS=
+ 			#if gcc 4.5+ or 4.2+
+ ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
+ $(call				set_if_empty,CPU,powerpc)
+-					CFLAGS+=-ftree-vectorize \
+-							-fno-strict-overflow \
+-							-mtune=$(CPU) -maltivec
++ifeq ($(NOALTIVEC),)
++ 					CFLAGS += -O9 -funroll-loops -fsigned-char $(PROFILE)
++					CFLAGS += -ftree-vectorize
++					CFLAGS += -maltivec
++					CFLAGS += -fno-strict-overflow
++					CFLAGS += -mtune=$(CPU)
++endif
+ else
+ 			#if gcc 4.0+
+ ifeq			($(CC_SHORTVER), 4.x)
+ $(call				set_if_empty,CPU,powerpc)
+-					CFLAGS+=-ftree-vectorize \
+-							-mtune=$(CPU) -maltivec
++ifeq ($(NOALTIVEC),)
++					CFLAGS += -O9 -funroll-loops -fsigned-char $(PROFILE)
++					CFLAGS += -mtune=$(CPU)
++					CFLAGS += -ftree-vectorize
++					CFLAGS += -maltivec
++endif
+ else
+ 			#if gcc 3.4+
+ ifeq			($(CC_SHORTVER), 3.4)
diff -ruN test/kamailio-4.0.4/debian/patches/series kamailio-4.0.4/debian/patches/series
--- test/kamailio-4.0.4/debian/patches/series	2013-10-03 10:17:42.000000000 +0200
+++ kamailio-4.0.4/debian/patches/series	2013-11-10 16:11:51.734968454 +0100
@@ -3,3 +3,4 @@
 fix_export.patch
 default_fifo.patch
 spelling_errors.patch
+fix-powerpcspe.patch
diff -ruN test/kamailio-4.0.4/debian/rules kamailio-4.0.4/debian/rules
--- test/kamailio-4.0.4/debian/rules	2013-10-03 10:17:42.000000000 +0200
+++ kamailio-4.0.4/debian/rules	2013-11-14 11:31:55.411369267 +0100
@@ -86,6 +86,10 @@
 CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
 sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
 
+ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),powerpcspe)
+CUSTOM_BUILDFLAGS += NOALTIVEC=1
+endif
+
 configure: configure-stamp
 configure-stamp:
 	dh_testdir

Reply via email to