diff --git a/package/libssh2/Config.in b/package/libssh2/Config.in
index 017fd4061a..341624069a 100644
--- a/package/libssh2/Config.in
+++ b/package/libssh2/Config.in
@@ -1,6 +1,9 @@
 config BR2_PACKAGE_LIBSSH2
 	bool "libssh2"
 	select BR2_PACKAGE_LIBGCRYPT if !BR2_PACKAGE_OPENSSL
+	# Triggers the _gp link issue
+	depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305
+	depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201405
 	help
 	  libssh2 is a client-side C library implementing the SSH2
 	  protocol as defined by Internet Drafts: SECSH-TRANS(22),
diff --git a/package/php-ssh2/Config.in b/package/php-ssh2/Config.in
index b457900740..bc31e1ddbd 100644
--- a/package/php-ssh2/Config.in
+++ b/package/php-ssh2/Config.in
@@ -2,6 +2,9 @@ config BR2_PACKAGE_PHP_SSH2
 	bool "php-ssh2"
 	depends on BR2_PACKAGE_PHP
 	select BR2_PACKAGE_LIBSSH2
+	# Triggers the _gp link issue (libssh2)
+	depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305
+	depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201405
 	help
 	  PHP bindings for the libssh2 library.