From nobody@FreeBSD.org  Mon Mar  7 05:58:36 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 570D4106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Mar 2011 05:58:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B2EF8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Mar 2011 05:58:36 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p275wZ1W031275
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 7 Mar 2011 05:58:35 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p275wZ2M031274;
	Mon, 7 Mar 2011 05:58:35 GMT
	(envelope-from nobody)
Message-Id: <201103070558.p275wZ2M031274@red.freebsd.org>
Date: Mon, 7 Mar 2011 05:58:35 GMT
From: Ron MacNeil <macro@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] Allow print/cups-client to build with lang/gcc45
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         155334
>Category:       ports
>Synopsis:       [patch] Allow print/cups-client to build with lang/gcc45
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 07 06:00:18 UTC 2011
>Closed-Date:    Mon Mar 07 21:53:25 CET 2011
>Last-Modified:  Mon Mar 07 21:53:25 CET 2011
>Originator:     Ron MacNeil
>Release:        FreeBSD 8.2-STABLE
>Organization:
>Environment:
FreeBSD ??? 8.2-STABLE FreeBSD 8.2-STABLE #0: Sat Mar  5 23:57:27 PST 2011     ???@???:/usr/obj/usr/src/sys/MYKERNEL  i386

>Description:

>How-To-Repeat:
1. Install lang/gcc45

2. Configure port builds to use gcc45 as per http://www.freebsd.org/doc/en_US.ISO8859-1/articles/custom-gcc/article.html

3. Attempt to build print/cups-client and observe breakage due to missing GCC stack smashing protection symbols:

[...]
Linking libcups.so.2...
gcc45  -L../cups -Wl,-R/usr/local/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -L/usr/local/lib -Wl,-soname,`basename libcups.so.2` -shared -Wall -Wno-format-y2k -fPIC -Os -g -fstack-protector -o libcups.so.2 adminutil.o array.o attr.o auth.o backchannel.o backend.o conflicts.o custom.o debug.o dest.o dir.o emit.o encode.o file.o getdevices.o getifaddrs.o getputfile.o globals.o http.o http-addr.o http-addrlist.o http-support.o ipp.o ipp-support.o langprintf.o language.o localize.o mark.o md5.o md5passwd.o notify.o options.o page.o ppd.o pwg-file.o pwg-media.o pwg-ppd.o request.o sidechannel.o snmp.o snprintf.o string.o tempfile.o transcode.o usersys.o util.o  \
		  -pthread -lm -lcrypt  -lz
adminutil.o: In function `get_cupsd_conf':
/usr/ports/print/cups-client/work/cups-1.4.6/cups/adminutil.c:2328: undefined reference to `__stack_chk_fail_local'
adminutil.o: In function `cupsAdminCreateWindowsPPD':
/usr/ports/print/cups-client/work/cups-1.4.6/cups/adminutil.c:393: undefined reference to `__stack_chk_fail_local'
adminutil.o: In function `cupsAdminExportSamba':
/usr/ports/print/cups-client/work/cups-1.4.6/cups/adminutil.c:840: undefined reference to `__stack_chk_fail_local'
adminutil.o: In function `cupsAdminGetServerSettings':
/usr/ports/print/cups-client/work/cups-1.4.6/cups/adminutil.c:1175: undefined reference to `__stack_chk_fail_local'
adminutil.o: In function `cupsAdminSetServerSettings':
/usr/ports/print/cups-client/work/cups-1.4.6/cups/adminutil.c:2146: undefined reference to `__stack_chk_fail_local'
attr.o:/usr/ports/print/cups-client/work/cups-1.4.6/cups/attr.c:88: more undefined references to `__stack_chk_fail_local' follow
collect2: ld returned 1 exit status
gmake[1]: *** [libcups.so.2] Error 1
gmake[1]: Leaving directory `/usr/ports/print/cups-client/work/cups-1.4.6/cups'
gmake: *** [all] Error 1
*** Error code 1

Stop in /usr/ports/print/cups-client.
*** Error code 1

>Fix:
Based on information from similar bugs such as...

http://www.freebsd.org/cgi/query-pr.cgi?pr=141238
http://www.freebsd.org/cgi/query-pr.cgi?pr=140791

..the following patch applied to print/cups-base permits print/cups-client to build successfully using lang/gcc45:

--- Makefile.old	2011-03-06 20:43:00.000000000 -0800
+++ Makefile	2011-03-06 21:43:43.000000000 -0800
@@ -214,6 +214,10 @@
 CONFIGURE_ARGS+=	--disable-libusb
 .endif
 
+.if ${OSVERSION} >= 800000
+CONFIGURE_ARGS+= LIBS="-lssp_nonshared"
+.endif
+
 .if defined(CUPS_CLIENT)
 MAN1=	cups-config.1
 .elif defined(CUPS_IMAGE)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Mar 7 06:00:32 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155334 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/155334: commit references a PR
Date: Mon,  7 Mar 2011 20:49:41 +0000 (UTC)

 dinoex      2011-03-07 20:49:32 UTC
 
   FreeBSD ports repository
 
   Modified files:
     print/cups-base      Makefile 
   Log:
   - fix build with lang/gcc45
   PR:             155334
   Submitted by:   Ron MacNeil
   
   Revision  Changes    Path
   1.155     +3 -0      ports/print/cups-base/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: dinoex 
State-Changed-When: Mon Mar 7 21:53:12 CET 2011 
State-Changed-Why:  
committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155334 
>Unformatted:
