From f2575db7ba80d7b0c5744cf134392089877da20a1ba74fbf5e7b2168f5aec98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 18 Feb 2015 10:09:42 +0000 Subject: [PATCH] Accepting request 286595 from home:michel_mno:branches:network:telephony - avoid smscb test failure on ppc/ppc64 architectures with libosmocore_0_7_0_avoid_smscb_test_failure.patch OBS-URL: https://build.opensuse.org/request/show/286595 OBS-URL: https://build.opensuse.org/package/show/network:telephony/libosmocore?expand=0&rev=16 --- libosmocore.changes | 6 ++ libosmocore.spec | 4 +- ...ocore_0_7_0_avoid_smscb_test_failure.patch | 90 +++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 libosmocore_0_7_0_avoid_smscb_test_failure.patch diff --git a/libosmocore.changes b/libosmocore.changes index 7a482fa..2dfd2e6 100644 --- a/libosmocore.changes +++ b/libosmocore.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 18 09:05:16 UTC 2015 - normand@linux.vnet.ibm.com + +- avoid smscb test failure on ppc/ppc64 architectures + with libosmocore_0_7_0_avoid_smscb_test_failure.patch + ------------------------------------------------------------------- Thu Oct 2 20:05:34 UTC 2014 - jengelh@inai.de diff --git a/libosmocore.spec b/libosmocore.spec index ef0bd1d..aa010b6 100644 --- a/libosmocore.spec +++ b/libosmocore.spec @@ -1,7 +1,7 @@ # # spec file for package libosmocore # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -33,6 +33,7 @@ Patch2: 0001-utils-resolve-compiler-warnings-on-implicit-declarat.patch Patch3: osmo-talloc.diff Patch4: osmo-talloc2.diff Patch5: osmo-kasumi.diff +Patch6: libosmocore_0_7_0_avoid_smscb_test_failure.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake >= 1.6 @@ -240,6 +241,7 @@ applications that want to make use of libosmovty. %prep %setup -qn %name %patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1 +%patch6 -p1 %build %if 0%{?use_system_talloc} diff --git a/libosmocore_0_7_0_avoid_smscb_test_failure.patch b/libosmocore_0_7_0_avoid_smscb_test_failure.patch new file mode 100644 index 0000000..0bf2ac1 --- /dev/null +++ b/libosmocore_0_7_0_avoid_smscb_test_failure.patch @@ -0,0 +1,90 @@ +From: Michel Normand +Subject: libosmocore 0 7 0 avoid smscb test failure +Date: Wed, 18 Feb 2015 09:10:04 +0100 + +libosmocore 0.7.0 avoid smscb test failure for ppc/ppc64 that is big-endian +# === +# 7. testsuite.at:45: testing smscb ... +# ./testsuite.at:48: $abs_top_builddir/tests/smscb/smscb_test +# --- expout 2015-02-17 16:19:24.010024039 +0000 +# +++ /home/abuild/rpmbuild/BUILD/libosmocore/tests/testsuite.dir/at-groups/7/stdout +# @@ -1,4 +1,4 @@ +# -(srl) GS: 1 MSG_CODE: 1 UPDATE: 0 +# +(srl) GS: 0 MSG_CODE: 256 UPDATE: 1 +# (msg) msg_id: 1293 +# -(dcs) group: 1 language: 0 +# +(dcs) group: 0 language: 1 +# (pge) page total: 1 current: 1 +# 7. testsuite.at:45: 7. smscb (testsuite.at:45): FAILED (testsuite.at:48) +# === + + +Signed-off-by: Michel Normand +--- + include/osmocom/gsm/protocol/gsm_03_41.h | 37 +++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +Index: libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h +=================================================================== +--- libosmocore.orig/include/osmocom/gsm/protocol/gsm_03_41.h ++++ libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h +@@ -5,6 +5,26 @@ + /* GSM TS 03.41 definitions also TS 23.041*/ + + /* Chapter 9.3.2 */ ++#if defined(__powerpc__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) ++struct gsm341_ms_message { ++ struct { ++ uint8_t gs:2; ++ uint8_t code_hi:6; ++ uint8_t code_lo:4; ++ uint8_t update:4; ++ } serial; ++ uint16_t msg_id; ++ struct { ++ uint8_t group:4; ++ uint8_t language:4; ++ } dcs; ++ struct { ++ uint8_t current:4; ++ uint8_t total:4; ++ } page; ++ uint8_t data[0]; ++} __attribute__((packed)); ++#else + struct gsm341_ms_message { + struct { + uint8_t code_hi:6; +@@ -23,8 +43,24 @@ struct gsm341_ms_message { + } page; + uint8_t data[0]; + } __attribute__((packed)); ++#endif + + /* Chapter 9.4.1.3 */ ++#if defined(__powerpc__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) ++struct gsm341_etws_message { ++ struct { ++ uint8_t gs:2; ++ uint8_t alert:1; ++ uint8_t popup:1; ++ uint8_t code_hi:4; ++ uint8_t code_lo:4; ++ uint8_t update:4; ++ } serial; ++ uint16_t msg_id; ++ uint16_t warning_type; ++ uint8_t data[0]; ++} __attribute__((packed)); ++#else + struct gsm341_etws_message { + struct { + uint8_t code_hi:4; +@@ -38,6 +74,7 @@ struct gsm341_etws_message { + uint16_t warning_type; + uint8_t data[0]; + } __attribute__((packed)); ++#endif + + #define GSM341_MSG_CODE(ms) ((ms)->serial.code_lo | ((ms)->serial.code_hi << 4)) +