diff --git a/contrib/src/samplerate/disable_assembler.patch b/contrib/src/samplerate/disable_assembler.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e329d48225521430d159920b9f8d32906a53fd49
--- /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 28c064660c6abc1ef59598a0881b31e19b584f84..426bd6d861d4178f0db5016f6babee929aac8d35 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)