Index: uspace/app/binutils/intrusive.sh
===================================================================
--- uspace/app/binutils/intrusive.sh	(revision 021c50855b87b33bffd6e20a77228f51864ffa10)
+++ uspace/app/binutils/intrusive.sh	(revision d1851328bc4c00f03e08f9773e4d83b5be74dc44)
@@ -73,4 +73,16 @@
 # to patch libiberty to avoid compiler warnings.
 #
+# Patch 5
+# When host and target system is equal, libbfd wants to compile a support
+# for core files, which is dependent on non-standard headers sys/param.h
+# and sys/user.h. Since we are cross compiling even when host and target
+# are equal, variables related to core file support must be cleared.
+#
+# Patch 6
+# There is a few occurences in binutils where POSIX function is declared 
+# and called without first including the corresponding header. Such
+# declarations cause a problem to the linker, because all functions
+# from libposix are prefixed with the posix_ prefix.
+#
 
 case "$1" in
@@ -84,4 +96,5 @@
 		cp -f "$2/libiberty/configure" "$2/libiberty/configure.backup"
 		cp -f "$2/libiberty/pex-common.h" "$2/libiberty/pex-common.h.backup"
+		cp -f "$2/libiberty/xstrerror.c" "$2/libiberty/xstrerror.c.backup"
 		cp -f "$2/opcodes/configure" "$2/opcodes/configure.backup"
 
@@ -95,5 +108,8 @@
 		cat "$2/bfd/configure.backup" | \
 		# See Patch 1.
-		sed 's/^cross_compiling=no/cross_compiling=yes/g' \
+		sed 's/^cross_compiling=no/cross_compiling=yes/g' | \
+		# See Patch 5.
+		sed 's/COREFILE=".*"/COREFILE='\'\''/g' | \
+		sed 's/COREFILE=[^ ]*/COREFILE='\'\''/g' \
 		> "$2/bfd/configure"
 
@@ -130,4 +146,11 @@
 		> "$2/libiberty/pex-common.h"
 
+		# Patch libiberty xstrerror.c.
+		(
+		echo '#include <string.h>'
+		echo '#define DONT_DECLARE_STRERROR'
+		cat "$2/libiberty/xstrerror.c.backup"
+		) > "$2/libiberty/xstrerror.c"
+
 		# Patch opcodes configure script.
 		cat "$2/opcodes/configure.backup" | \
@@ -148,4 +171,5 @@
 		mv -f "$2/libiberty/configure.backup" "$2/libiberty/configure"
 		mv -f "$2/libiberty/pex-common.h.backup" "$2/libiberty/pex-common.h"
+		mv -f "$2/libiberty/xstrerror.c.backup" "$2/libiberty/xstrerror.c"
 		mv -f "$2/opcodes/configure.backup" "$2/opcodes/configure"
 		;;
