diff --git a/contrib/src/vorbis/ios.patch b/contrib/src/vorbis/ios.patch
new file mode 100644
index 0000000000000000000000000000000000000000..44fd3c166678f6d48853ef0bb615ad7fae30e5e5
--- /dev/null
+++ b/contrib/src/vorbis/ios.patch
@@ -0,0 +1,13 @@
+--- libvorbis/configure.ac.orig	2012-09-07 00:17:47.000000000 +0200
++++ libvorbis/configure.ac	2012-09-07 00:18:01.000000000 +0200
+@@ -199,8 +199,8 @@
+ 		PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char $sparc_cpu" ;;
+ 	*-*-darwin*)
+ 		DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
+-		CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
+-		PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
++		CFLAGS="-DDARWIN -fno-common -Wall -O3 -ffast-math -fsigned-char"
++		PROFILE="-DDARWIN -fno-common -Wall -pg -O3 -ffast-math -fsigned-char";;
+ 	*-*-os2*)
+ 		# Use -W instead of -Wextra because gcc on OS/2 is an old version.
+ 		DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
diff --git a/contrib/src/vorbis/rules.mak b/contrib/src/vorbis/rules.mak
index 12b23a334540e1bf996a8f78e5e43d5364a68ad3..d4ce0ef3f828d359303b2ef8a0f109d0d51ddb3a 100644
--- a/contrib/src/vorbis/rules.mak
+++ b/contrib/src/vorbis/rules.mak
@@ -25,7 +25,11 @@ $(TARBALLS)/libvorbis-$(VORBIS_VERSION).tar.xz:
 
 vorbis: libvorbis-$(VORBIS_VERSION).tar.xz .sum-vorbis
 	$(UNPACK)
+ifndef HAVE_IOS
 	$(APPLY) $(SRC)/vorbis/osx.patch
+else
+	$(APPLY) $(SRC)/vorbis/ios.patch
+endif
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)