diff --git a/recipes/gphoto2/files/gphoto-popt-fixup.patch b/recipes/gphoto2/files/gphoto-popt-fixup.patch
index 66b6168..61a4216 100644
--- a/recipes/gphoto2/files/gphoto-popt-fixup.patch
+++ b/recipes/gphoto2/files/gphoto-popt-fixup.patch
@@ -11,11 +11,24 @@ Index: gphoto2-2.4.2/m4m/gp-check-popt.m4
 		else
 			continue
 		fi
-@@ -113,7 +113,7 @@
+@@ -96,6 +96,10 @@
+	# try to find options to link against popt
+	LDFLAGS_save="$LDFLAGS"
+	popt_links=no
++	popt_sysroot=""
++	if test "x${lt_sysroot}" != x; then
++		popt_sysroot="${lt_sysroot}/"
++	fi
+	for popt_prefix in /usr "" /usr/local; do
+		# We could have "/usr" and "lib64" at the beginning of the
+		# lists. Then the first tested location would
+@@ -112,8 +116,8 @@
+			popt_libdir="${popt_prefix}/${ldir}"
 			if test "${popt_libdir}" = "/"; then
 				popt_libdir=""
-			elif test -d "${popt_libdir}"; then
+-			elif test -d "${popt_libdir}"; then
 -				LDFLAGS="-L${popt_libdir} ${LDFLAGS}"
++			elif test -d "${popt_sysroot}${popt_libdir}"; then
 +				LDFLAGS="-L${popt_libdir} ${LDFLAGS_save}"
 			else
 				continue
