From 46ceea277ecabe5da1ca553f74db125f0295d407 Mon Sep 17 00:00:00 2001 From: Edric Milaret <edric.ladent-milaret@savoirfairelinux.com> Date: Thu, 2 Jun 2016 14:00:39 -0400 Subject: [PATCH] ios: disable assembler for ios simulator in libsamplerate This does not compile for simulator target Change-Id: Iba55808af8a0a5b48afa5a0239288f6d8d1ecc00 Tuleap: #313 --- .../src/samplerate/disable_assembler.patch | 50 +++++++++++++++++++ contrib/src/samplerate/rules.mak | 6 +++ 2 files changed, 56 insertions(+) create mode 100644 contrib/src/samplerate/disable_assembler.patch diff --git a/contrib/src/samplerate/disable_assembler.patch b/contrib/src/samplerate/disable_assembler.patch new file mode 100644 index 0000000000..e329d48225 --- /dev/null +++ b/contrib/src/samplerate/disable_assembler.patch @@ -0,0 +1,50 @@ +--- a/src/float_cast.h 2011-01-19 05:39:36.000000000 -0500 ++++ b/src/float_cast.h 2016-05-30 17:09:20.000000000 -0400 +@@ -230,38 +230,12 @@ + #undef lrint + #undef lrintf + +- #define lrint double2int +- #define lrintf float2int ++ #warning "Don't have the functions lrint() and lrintf()." ++ #warning "Replacing these functions with a standard C cast." + +- inline static long +- float2int (register float in) +- { int res [2] ; +- +- __asm__ __volatile__ +- ( "fctiw %1, %1\n\t" +- "stfd %1, %0" +- : "=m" (res) /* Output */ +- : "f" (in) /* Input */ +- : "memory" +- ) ; +- +- return res [1] ; +- } /* lrintf */ +- +- inline static long +- double2int (register double in) +- { int res [2] ; +- +- __asm__ __volatile__ +- ( "fctiw %1, %1\n\t" +- "stfd %1, %0" +- : "=m" (res) /* Output */ +- : "f" (in) /* Input */ +- : "memory" +- ) ; ++ #define lrint(dbl) ((long) (dbl)) ++ #define lrintf(flt) ((long) (flt)) + +- return res [1] ; +- } /* lrint */ + + #else + #ifndef __sgi +@@ -278,4 +252,3 @@ + + + #endif /* FLOAT_CAST_HEADER */ +- diff --git a/contrib/src/samplerate/rules.mak b/contrib/src/samplerate/rules.mak index 28c064660c..426bd6d861 100644 --- a/contrib/src/samplerate/rules.mak +++ b/contrib/src/samplerate/rules.mak @@ -16,6 +16,12 @@ samplerate: libsamplerate-$(SAMPLERATE_VERSION).tar.gz .sum-samplerate $(UNPACK) $(APPLY) $(SRC)/samplerate/soundcard.patch $(APPLY) $(SRC)/samplerate/carbon.patch +ifdef HAVE_IOS +ifeq ($(IOS_TARGET_PLATFORM),iPhoneSimulator) +#warning assembler double / int conversion disabled + $(APPLY) $(SRC)/samplerate/disable_assembler.patch +endif +endif $(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && mv config.guess config.sub Cfg $(MOVE) -- GitLab