File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -259,3 +259,20 @@ along with GCC; see the file COPYING3. If not see
259259/* We do not need NT_VERSION notes. */
260260#undef X86_FILE_START_VERSION_DIRECTIVE
261261#define X86_FILE_START_VERSION_DIRECTIVE false
262+
263+ /*
264+ * As of 5788, the illumos libc includes support for the stack protector
265+ * __stack_chk_fail() function and for the __stack_chk_guard variable.
266+ * That means that, for most cases, no extra objects need to be linked in
267+ * when compiling with one of the -fstack-protector options.
268+ * However, for 32-bit PIC/PIE objects, the gcc stack protector emits a
269+ * function call to __stack_chk_fail_local(); this symbol is provided in
270+ * illumos via the libssp_ns.a object. The spec below includes this in the
271+ * link when appropriate.
272+ */
273+ #if defined(TARGET_LIBC_PROVIDES_SSP )
274+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all|" \
275+ "fstack-protector-strong|fstack-protector-explicit:" \
276+ DEF_ARCH32_SPEC("-lssp_ns") \
277+ "}"
278+ #endif
Original file line number Diff line number Diff line change @@ -29283,7 +29283,7 @@ fi
2928329283 # realistically usable GNU/Hurd configurations.
2928429284 # All supported versions of musl provide it as well
2928529285 gcc_cv_libc_provides_ssp=yes;;
29286- *-*-darwin* | *-*-freebsd* | *-*-netbsd*)
29286+ *-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-solaris2* )
2928729287 ac_fn_cxx_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
2928829288if test "x$ac_cv_func___stack_chk_fail" = xyes; then :
2928929289 gcc_cv_libc_provides_ssp=yes
Original file line number Diff line number Diff line change @@ -5965,7 +5965,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
59655965 # realistically usable GNU/Hurd configurations.
59665966 # All supported versions of musl provide it as well
59675967 gcc_cv_libc_provides_ssp=yes;;
5968- *-*-darwin* | *-*-freebsd* | *-*-netbsd*)
5968+ *-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-solaris2* )
59695969 AC_CHECK_FUNC ( __stack_chk_fail ,[ gcc_cv_libc_provides_ssp=yes] ,
59705970 [ echo "no __stack_chk_fail on this target"] )
59715971 ;;
You can’t perform that action at this time.
0 commit comments