From bf1783@googlemail.com  Tue Nov 24 01:31:47 2009
Return-Path: <bf1783@googlemail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45964106566B;
	Tue, 24 Nov 2009 01:31:47 +0000 (UTC)
	(envelope-from bf1783@googlemail.com)
Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226])
	by mx1.freebsd.org (Postfix) with ESMTP id EDEAA8FC0A;
	Tue, 24 Nov 2009 01:31:45 +0000 (UTC)
Received: by ewy26 with SMTP id 26so2721278ewy.3
        for <multiple recipients>; Mon, 23 Nov 2009 17:31:44 -0800 (PST)
Received: by 10.216.87.71 with SMTP id x49mr1854808wee.11.1259026304614; Mon, 
	23 Nov 2009 17:31:44 -0800 (PST)
Message-Id: <d873d5be0911231731q47857efdx39b7abab6161eb2e@mail.gmail.com>
Date: Tue, 24 Nov 2009 01:31:44 +0000
From: "b. f." <bf1783@googlemail.com>
To: Mario Sergio Fujikawa Ferreira <lioux@freebsd.org>
Cc: bug-followup@freebsd.org, miwi@freebsd.org, gerald@freebsd.org, 
	kan@freebsd.org, mezz@freebsd.org
In-Reply-To: <4B0B2A9C.3010001@FreeBSD.org>
Subject: Re: Fwd: ports/140791: [PATCH] textproc/libtre: Fix build on systems 
	where GCC stack protection was enabled for userland
References: <d873d5be0911221714l2f7ca3dfp64a1bdb50c1b30d2@mail.gmail.com>
	 <20091122222628.780caa12@kan.dnsalias.net>
	 <d873d5be0911222027t4aabd2e0x20f58a1afd4d3fba@mail.gmail.com>
	 <d873d5be0911222029r4f95a929y3232fc339dad1c84@mail.gmail.com>
	 <4B0B2A9C.3010001@FreeBSD.org>

>Number:         140815
>Category:       ports
>Synopsis:       Re: ports/140791: [PATCH] textproc/libtre: Fix build on systems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 24 01:40:01 UTC 2009
>Closed-Date:    Wed Nov 25 04:19:33 UTC 2009
>Last-Modified:  Wed Nov 25 04:19:33 UTC 2009
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 I think that your 8.0-PRERELEASE includes:
 
 http://svn.freebsd.org/changeset/base/198304
 
 but not:
 
 http://svn.freebsd.org/changeset/base/198471
 
 which arose from similar problems:
 
 http://lists.freebsd.org/pipermail/svn-src-all/2009-October/014724.html
 http://lists.freebsd.org/pipermail/svn-src-all/2009-October/014726.html
 
 Right? This probably accounts for 4.2 and 4.3, and it is likely that
 there is a similar problem in the other cases.  I will look into it
 when I have a moment. kan@ would know more about the details of a
 r198471 MFC.
 
 Regards,
                 b.
 
 On 11/24/09, Mario Sergio Fujikawa Ferreira <lioux@freebsd.org> wrote:
 > b. f. wrote:
 >  > ---------- Forwarded message ----------
 >  > From: "b. f." <bf1783@googlemail.com>
 >  > Date: Mon, 23 Nov 2009 04:27:00 +0000
 >  > Subject: Re: ports/140791: [PATCH] textproc/libtre: Fix build on
 >  > systems where GCC stack protection was enabled for userland
 >  > To: Alexander Kabaev <kabaev@gmail.com>
 >  >
 >  > On 11/23/09, Alexander Kabaev <kabaev@gmail.com> wrote:
 >  >> On Mon, 23 Nov 2009 01:14:49 +0000
 >  >> "b. f." <bf1783@googlemail.com> wrote:
 >  >>
 >  >>> On 11/22/09, Mario Sergio Fujikawa Ferreira <lioux@freebsd.org> wrote:
 >  >>>> b. f. wrote:
 >  >
 >  >> You do of course realize that copying anyone from the middle of
 >  >> conversation without providing any context is pretty much useless,
 >  >> right? What is that you wanted to ask me about exactly? Unfortunately,
 >  >> I cannot figure that about just from the text above.
 >  >
 >  > Sorry, I thought you might take a look at the full thread at:
 >  >
 >  > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=ports/140791
 >  >
 >  > There are two questions:
 >  >
 >  > 1) what is the source of the problems described by lioux@ in the three
 >  > ports he has mentioned (we may need to wait for him to furnish more
 >  > information if others cannot reproduce the failures he reports);
 >  >
 >  > and
 >  >
 >  > 2) how can we best accommodate the use of the stack protector in other
 >  > ports -- making the minimal changes that are necessary to handle
 >  > linking in both the case when it is used, and when it is not?
 >
 >    I apologize for the delay but I was otherwise engaged with work. :(
 >
 >    You can fetch all files mentioned below on a single package:
 >
 > http://people.freebsd.org/~lioux/stack_protector/stack_protector.tbz
 >
 >    1) The list of affected ports so far (on my system that is, I haven't
 > verified this elsewhere yet):
 > 	1.1) mail/crm114
 > 	1.2) multimedia/x264
 > 	1.3) net-p2p/mldonkey
 > 	1.4) textproc/libtre
 > 	1.5) x11/yelp
 >
 >    2) I was able to build all ports that was previously broken after the
 > addition of LDFLAGS "fix".
 >
 >    3) I backtracked my steps to produce a better report. It follows:
 > 	3.1) mail/crm114
 > 		3.1.1) Diagnostic: I can't build it with vanilla CFLAGS. Built without
 > PGO.
 > 		3.1.2) Broken build log:
 > http://people.freebsd.org/~lioux/stack_protector/crm114-broken-log.txt
 > 		3.1.3) Broken build log snippet:
 >
 > cc -I/usr/local/include -L/usr/local/lib -fprofile-generate
 > -L/usr/local/lib -liconv -lintl crm_main.o crm_compiler.o
 > crm_errorhandlers.o  crm_math_exec.o
 > crm_var_hash_table.o crm_expandvar.o  crm_stmt_parser.o
 > crm_vector_tokenize.o  crm_expr_alter.o crm_expr_match.o
 > crm_css_maintenance.o  crm_markovian.o crm
 > _osb_bayes.o crm_osb_hyperspace.o  crm_correlate.o crm_osb_winnow.o
 > crm_winnow_maintenance.o  crm_osbf_bayes.o crm_osbf_maintenance.o
 > crm_bit_entropy.o  cr
 > m_neural_net.o crm_expr_clump.o  crm_expr_window.o crm_expr_isolate.o
 > crm_expr_file_io.o  crm_expr_syscall.o crm_expr_classify.o
 > crm_expr_translate.o  crm_
 > exec_engine.o crm_debugger.o crm_str_funcs.o  crm_preprocessor.o
 > crmregex_tre.c  crm_expr_sks.o crm_stats.o crm_expr_svm.o
 > crm_fast_substring_compression.
 > o  -ltre -lm -o crm114
 > /usr/lib/libgcov.a(_gcov.o)(.text+0x1459): In function `gcov_exit':
 > : undefined reference to `__stack_chk_fail_local'
 >
 > 	3.2) textproc/libtre
 > 		3.2.1) Diagnostic: it can be built with vanilla CFLAGS. However, it
 > breaks with CFLAGS optimizations. Built without PGO.
 > 		3.2.2) Build log:
 > http://people.freebsd.org/~lioux/stack_protector/libtre-works-log.txt
 > 		3.2.2) Broken build log:
 > http://people.freebsd.org/~lioux/stack_protector/libtre-broken-log.txt
 > 		3.2.3) When it breaks, it breaks during the configure phase. I a am
 > providing the work directory for evaluation.
 > http://people.freebsd.org/~lioux/stack_protector/libtre__broken__work.tar.bz2
 >
 > 	3.3) net-p2p/mldonkey
 > 		3.3.1) Diagnostic: my mistake. This port is not broken. It is just a
 > matter of properly setting LDFLAGS.
 > 		3.3.2) Build log:
 > http://people.freebsd.org/~lioux/stack_protector/mldonkey-works-log.txt
 > 		3.3.2) Broken build log:
 > http://people.freebsd.org/~lioux/stack_protector/mldonkey-broken-log.txt
 >
 > 	3.4) multimedia/x264
 > 		3.4.1) Diagnostic: it can be built with vanilla CFLAGS. However, it
 > breaks with CFLAGS optimizations. Built without PGO.
 > 		3.4.2) Build log:
 > http://people.freebsd.org/~lioux/stack_protector/x264-works-log.txt
 > 		3.4.2) Broken build log:
 > http://people.freebsd.org/~lioux/stack_protector/x264-broken-log.txt
 > 		3.4.3) Broken build log snippet:
 >
 > cc -o x264 x264.o matroska.o muxers.o libx264.a -L/usr/local/lib
 > -L/usr/local/lib -L/usr/X11R6/lib -lX11 -lm -pthread -lgpac -s
 > -fprofile-generate
 > /usr/bin/ld.orig: warning: libm.so.3, needed by
 > /usr/local/lib/libGL.so.1, may conflict with libm.so.5
 > /usr/bin/ld.orig: warning: libc.so.5, needed by
 > /usr/local/lib/libGLcore.so.1, may conflict with libc.so.7
 > /usr/local/lib/compat/libc.so.5: warning: WARNING!  setkey(3) not
 > present in the system!
 > /usr/local/lib/compat/libc.so.5: warning: warning: this program uses
 > gets(), which is unsafe.
 > /usr/local/lib/compat/libc.so.5: warning: warning: mktemp() possibly
 > used unsafely; consider using mkstemp()
 > /usr/local/lib/compat/libc.so.5: warning: WARNING!  des_setkey(3) not
 > present in the system!
 > /usr/local/lib/compat/libc.so.5: warning: WARNING!  encrypt(3) not
 > present in the system!
 > /usr/local/lib/compat/libc.so.5: warning: warning: tmpnam() possibly
 > used unsafely; consider using mkstemp()
 > /usr/local/lib/compat/libc.so.5: warning: warning: this program uses
 > f_prealloc(), which is not recommended.
 > /usr/local/lib/compat/libc.so.5: warning: WARNING!  des_cipher(3) not
 > present in the system!
 > /usr/local/lib/compat/libc.so.5: warning: warning: tempnam() possibly
 > used unsafely; consider using mkstemp()
 > /usr/lib/libgcov.a(_gcov.o)(.text+0x1459): In function `gcov_exit':
 > : undefined reference to `__stack_chk_fail_local'
 >
 > 	3.3) x11/yelp
 > 		3.3.1) Diagnostic: I can't build it with vanilla CFLAGS.
 > 		3.3.2) Broken build log:
 > http://people.freebsd.org/~lioux/stack_protector/yelp-broken-log.txt
 > 		3.3.3) Broken build log snippet:
 >
 > c++ -DORBIT2=1 -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include/glib-2.0
 > -I/usr/local/lib/glib-2.0/include -I/usr/local/include/gconf/2
 > -I/usr/local/includ
 > e/orbit-2.0 -I/usr/local/include/dbus-1.0
 > -I/usr/local/include/dbus-1.0/include
 > -I/usr/local/include/gtk-unix-print-2.0 -I/usr/local/include/gtk-2.0 -I/usr
 > /local/include/atk-1.0 -I/usr/local/include/cairo
 > -I/usr/local/include/pango-1.0 -I/usr/local/lib/gtk-2.0/include
 > -I/usr/local/include -I/usr/local/include
 > /pixman-1 -I/usr/local/include/freetype2
 > -I/usr/local/include/libglade-2.0 -I/usr/local/include/libxml2
 > -I/usr/local/include/libgnome-2.0 -I/usr/local/incl
 > ude/gnome-vfs-2.0 -I/usr/local/lib/gnome-vfs-2.0/include
 > -I/usr/local/include/libbonobo-2.0
 > -I/usr/local/include/bonobo-activation-2.0 -I/usr/local/include
 > /libgnomeui-2.0 -I/usr/local/include/libart-2.0
 > -I/usr/local/include/gnome-keyring-1
 > -I/usr/local/include/libbonoboui-2.0 -I/usr/local/include/libgnomecanv
 > as-2.0 -I/usr/local/include/gail-1.0
 > -I/usr/local/include/startup-notification-1.0
 > -I/usr/local/include/rarian -fshort-wchar -I/usr/local/include/libxul/st
 > able -I/usr/local/include/nspr -fshort-wchar
 > -I/usr/local/include/libxul/stable -I/usr/local/include/nspr
 > -fshort-wchar -I/usr/local/include/libxul/unstabl
 > e -I/usr/local/include/nspr -fno-rtti -fshort-wchar -O2 -pipe
 > -march=athlon-mp -fno-strict-aliasing -Wall -Wno-unused
 > -Wno-ctor-dtor-privacy -Wno-non-virtu
 > al-dtor -O2 -pipe -march=athlon-mp -fno-strict-aliasing -o yelp
 > yelp-Yelper.o yelp-yelp-base.o yelp-yelp-bookmarks.o yelp-yelp-debug.o
 > yelp-yelp-error.o ye
 > lp-yelp-gecko-utils.o yelp-yelp-html.o yelp-yelp-io-channel.o
 > yelp-yelp-settings.o yelp-yelp-utils.o yelp-yelp-window.o
 > yelp-yelp-marshal.o yelp-yelp-main.
 > o yelp-yelp-print.o yelp-yelp-page.o yelp-yelp-transform.o
 > yelp-yelp-gecko-services.o yelp-yelp-document.o yelp-yelp-toc.o
 > yelp-yelp-docbook.o yelp-yelp-db
 > -print.o yelp-yelp-man-parser.o yelp-yelp-man.o yelp-yelp-info.o
 > yelp-yelp-info-parser.o yelp-gtkentryaction.o yelp-yelp-search.o
 > yelp-yelp-search-parser.o
 >   -pthread -Wl,-rpath -Wl,/usr/local/lib/libxul -pthread
 > -L/usr/local/lib /usr/local/lib/libglade-2.0.so
 > /usr/local/lib/libgnomeui-2.so /usr/local/lib/libg
 > nome-keyring.so /usr/local/lib/libbonoboui-2.so
 > /usr/local/lib/libgnomecanvas-2.so /usr/local/lib/libgailutil.so
 > /usr/local/lib/libgnome-2.so /usr/local/li
 > b/libgnomevfs-2.so -lssl -lcrypto /usr/local/lib/libavahi-glib.so
 > /usr/local/lib/libavahi-client.so /usr/local/lib/libavahi-common.so
 > -lssp -lutil /usr/loc
 > al/lib/libesd.so /usr/local/lib/libaudiofile.so
 > /usr/local/lib/libpopt.so /usr/local/lib/libbonobo-2.so
 > /usr/local/lib/libbonobo-activation.so /usr/local/l
 > ib/libORBitCosNaming-2.so /usr/local/lib/libart_lgpl_2.so
 > /usr/local/lib/libgtk-x11-2.0.so /usr/local/lib/libgdk-x11-2.0.so
 > /usr/local/lib/libatk-1.0.so /u
 > sr/local/lib/libgdk_pixbuf-2.0.so /usr/local/lib/libpangocairo-1.0.so
 > /usr/local/lib/libgio-2.0.so /usr/local/lib/libXinerama.so
 > /usr/local/lib/libXi.so /u
 > sr/local/lib/libXrandr.so /usr/local/lib/libXcursor.so
 > /usr/local/lib/libXcomposite.so /usr/local/lib/libXext.so
 > /usr/local/lib/libXdamage.so /usr/local/li
 > b/libpangoft2-1.0.so /usr/local/lib/libXfixes.so
 > /usr/local/lib/libcairo.so /usr/local/lib/libpixman-1.so
 > /usr/local/lib/libglitz.so -lpng /usr/local/lib/l
 > ibxcb-render-util.so /usr/local/lib/libxcb-render.so
 > /usr/local/lib/libXrender.so /usr/local/lib/libpango-1.0.so
 > /usr/local/lib/libfontconfig.so /usr/local
 > /lib/libfreetype.so /usr/local/lib/libexpat.so
 > /usr/local/lib/libgconf-2.so /usr/local/lib/libORBit-2.so
 > /usr/local/lib/libgthread-2.0.so /usr/local/lib/li
 > bgmodule-2.0.so /usr/local/lib/libexslt.so /usr/local/lib/libxslt.so
 > /usr/local/lib/libgcrypt.so /usr/local/lib/libgpg-error.so
 > /usr/local/lib/libxml2.so -
 > lm /usr/local/lib/libstartup-notification-1.so
 > /usr/local/lib/libxcb-aux.so /usr/local/lib/libxcb-event.so
 > /usr/local/lib/libxcb-atom.so /usr/local/lib/lib
 > dbus-glib-1.so /usr/local/lib/libdbus-1.so -pthread
 > /usr/local/lib/libgobject-2.0.so /usr/local/lib/libglib-2.0.so -licui18n
 > /usr/local/lib/libintl.so /usr
 > /local/lib/libiconv.so /usr/local/lib/libpcre.so
 > /usr/local/lib/librarian.so -lz -lbz2 /usr/local/lib/libSM.so
 > /usr/local/lib/libICE.so /usr/local/lib/libX
 > 11.so /usr/local/lib/libxcb.so /usr/local/lib/libXau.so
 > /usr/local/lib/libXdmcp.so -lrpcsvc -L/usr/local/lib/libxul/sdk/lib
 > -L/usr/local/lib/libxul -lxpcom
 > glue_s -lxpcom -lplds4 -lplc4 -lnspr4 -L/usr/local/lib/libxul/sdk/bin
 > -lxul   -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib
 > -Wl,--rpath -Wl
 > ,/usr/local/lib/libxul
 > /usr/local/lib/libxul/sdk/lib/libxpcomglue_s.a(nsStringAPI.o)(.text+0xe89):
 > In function `nsACString::AppendInt(int, int)':
 > : undefined reference to `__stack_chk_fail_local'
 > /usr/local/lib/libxul/sdk/lib/libxpcomglue_s.a(nsStringAPI.o)(.text+0x1422):
 > In function `nsAString::AppendInt(int, int)':
 > : undefined reference to `__stack_chk_fail_local'
 > gmake[3]: *** [yelp] Error 1
 > gmake[3]: Leaving directory `/usr/ports/x11/yelp/work/yelp-2.26.0/src'
 > gmake[2]: *** [all] Error 2
 > gmake[2]: Leaving directory `/usr/ports/x11/yelp/work/yelp-2.26.0/src'
 > gmake[1]: *** [all-recursive] Error 1
 > gmake[1]: Leaving directory `/usr/ports/x11/yelp/work/yelp-2.26.0'
 > gmake: *** [all] Error 2
 > *** Error code 1
 >
 >    4) It seems we can classify the broken builds as follows:
 > 	4.1) Incorrect LDFLAGS.
 > 		4.1.1) net-p2p/mldonkey
 > 		4.1.2) Analysis: Human operator mistake. Problem solved.
 > 	4.2) Vanilla CFLAGS, /usr/lib/libgcov.a linking problem
 > 		4.2.1) mail/crm114
 > 	4.3) Optimized CFLAGS, /usr/lib/libgcov.a linking problem
 > 		4.3.1) multimedia/x264
 > 	4.4) /usr/local/lib/libxul/sdk/lib/libxpcomglue_s.a linking problem
 > 		4.4.1) x11/yelp
 > 	4.5) Optimized CFLAGS.
 > 		4.5.1) textproc/libtre
 >
 >    5) How do we procceed?
 >
 > 	Regards,
 > 		Mario Ferreira
 >
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Nov 25 04:19:00 UTC 2009 
State-Changed-Why:  
Misfiled followup to ports/140791; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Nov 25 04:19:00 UTC 2009 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=140815 
>Unformatted:
 	where GCC stack protection was enabled for userland
