[patch] fix -fstack-protector support check #3198

Closed
michaelrsweet opened this Issue May 14, 2009 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented May 14, 2009

Version: 1.4-current
CUPS.org User: jacmet

[PATCH]: use AC_TRY_LINK for stack protector check

Actually try to link an executable to test for stack protector support,
as gcc seems to accept the -fstack-protector argument even when it's
compiled with --disable-libssp (but linking fails with a error
finding -lssp_nonshared).

We're using this patch in buildroot (http://buildroot.org)

Collaborator

michaelrsweet commented May 16, 2009

CUPS.org User: mike

Moving this to CUPS 1.4; don't want to potentially destabilize 1.3.x...

Collaborator

michaelrsweet commented May 17, 2009

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented May 17, 2009

"cups-fix-stack-protector-check.patch":

[PATCH]: use AC_TRY_LINK for stack protector check

Actually try to link an executable to test for stack protector support,
as gcc seems to accept the -fstack-protector argument even when it's
compiled with --disable-libssp (but linking fails with a error
finding -lssp_nonshared).

Signed-off-by: Peter Korsgaard jacmet@sunsite.dk

config-scripts/cups-compiler.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: cups-1.3.9/config-scripts/cups-compiler.m4

--- cups-1.3.9.orig/config-scripts/cups-compiler.m4
+++ cups-1.3.9/config-scripts/cups-compiler.m4
@@ -109,7 +109,7 @@ if test -n "$GCC"; then
AC_MSG_CHECKING(if GCC supports -fstack-protector)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector"

  • AC_TRY_COMPILE(,,
  • AC_TRY_LINK(,,
    OPTIM="$OPTIM -fstack-protector"
    AC_MSG_RESULT(yes),
    AC_MSG_RESULT(no))

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment