From swell.k@gmail.com  Thu Sep  9 16:17:20 2010
Return-Path: <swell.k@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F59610656C6
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  9 Sep 2010 16:17:20 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182])
	by mx1.freebsd.org (Postfix) with ESMTP id E49848FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  9 Sep 2010 16:17:19 +0000 (UTC)
Received: by eyx24 with SMTP id 24so1169840eyx.13
        for <FreeBSD-gnats-submit@freebsd.org>; Thu, 09 Sep 2010 09:17:18 -0700 (PDT)
Received: by 10.213.22.18 with SMTP id l18mr71879ebb.85.1284049038628;
        Thu, 09 Sep 2010 09:17:18 -0700 (PDT)
Received: from localhost (tor-exit-proxy5-readme.formlessnetworking.net [208.53.142.41])
        by mx.google.com with ESMTPS id u9sm2239597eeh.11.2010.09.09.09.17.14
        (version=SSLv3 cipher=RC4-MD5);
        Thu, 09 Sep 2010 09:17:17 -0700 (PDT)
Message-Id: <86aanqvqn8.fsf@gmail.com>
Date: Thu, 09 Sep 2010 20:16:27 +0400
From: Anonymous <swell.k@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] games/frogatto: prevent ld(1) from picking up wrong -lstdc++

>Number:         150442
>Category:       ports
>Synopsis:       [patch] games/frogatto: prevent ld(1) from picking up wrong -lst=
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    danfe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 09 16:20:00 UTC 2010
>Closed-Date:    Wed Sep 22 10:42:40 UTC 2010
>Last-Modified:  Wed Sep 22 10:42:40 UTC 2010
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
LOCALBASE =3D /usr/pkg
boost-libs compiled with gcc45 and linked against gcc45's -lstdc++
>Description:
When compiling the port with gcc45 linker first tries to use gcc's own
-lstdc++ in LOCALBASE/lib/gcc45. But if you specify -L/usr/lib on
command line it'll use -lstdc++ from our ancient gcc42 in base.

IOW, let gcc decide where to search for it's own -lstdc++. And while
here remove -L/sw/lib as well, we don't have /sw in our hier(7).
>How-To-Repeat:
$ echo 'int main(void) { return(0); }' | g++45 -xc++ -o/dev/null - -Wl,--ve=
rbose |& fgrep -- -lstdc++
-lstdc++ (/usr/pkg/lib/gcc45/gcc/x86_64-portbld-freebsd9.0/4.5.2/../../../l=
ibstdc++.so)
$ realpath /usr/pkg/lib/gcc45/gcc/x86_64-portbld-freebsd9.0/4.5.2/../../../=
libstdc++.so
/usr/pkg/lib/gcc45/libstdc++.so.6
$ echo 'int main(void) { return(0); }' | g++45 -xc++ -o/dev/null - -Wl,--ve=
rbose -L/usr/lib |& fgrep -- -lstdc++
-lstdc++ (/usr/lib/libstdc++.so)

$ make
...
g++45 -O2 -pipe -fno-strict-aliasing  -fno-inline-functions -L. -L/sw/lib -=
L/usr/pkg/lib -L. -lX11 -D_GNU_SOURCE=3D1 -D_REENTRANT -Wnon-virtual-dtor -=
Wreturn-type -L/usr/lib `sdl-config --libs` -lSDLmain -lSDL -lGL -lGLU -lGL=
EW -lSDL_image -lSDL_ttf -lSDL_mixer -lpng -lboost_regex -lboost_system -ft=
hreadsafe-statics IMG_savepng.o background.o blur.o border_widget.o button.=
o character_editor_dialog.o current_generator.o editor_dialogs.o editor_for=
mula_functions.o editor_layers_dialog.o editor_stats_dialog.o editor_variab=
le_info.o collision_utils.o color_utils.o controls.o custom_object.o custom=
_object_callable.o custom_object_functions.o custom_object_type.o debug_con=
sole.o dialog.o draw_number.o draw_scene.o draw_tile.o editor.o editor_leve=
l_properties_dialog.o entity.o filesystem.o font.o formula.o formula_callab=
le_definition.o formula_constants.o formula_function.o formula_profiler.o f=
ormula_tokenizer.o formula_variable_storage.o frame.o framed_gui_element.o =
geometry.o graphical_font.o graphical_font_label.o grid_widget.o group_prop=
erty_editor_dialog.o gui_formula_functions.o gui_section.o image_widget.o i=
nput.o inventory.o iphone_controls.o joystick.o key.o label.o level.o level=
_logic.o level_object.o level_runner.o level_solid_map.o load_level_nothrea=
d.o main.o message_dialog.o movement_script.o multi_tile_pattern.o multipla=
yer.o object_events.o options_dialog.o particle_system.o pause_game_dialog.=
o playable_custom_object.o player_info.o powerup.o preferences.o preprocess=
or.o preview_tileset_widget.o property_editor_dialog.o random.o raster.o ra=
ster_distortion.o rectangle_rotator.o settings_dialog.o solid_map.o sound.o=
 speech_dialog.o stats.o string_utils.o surface_cache.o surface_formula.o s=
urface_palette.o surface_scaling.o surface.o texture.o text_entry_widget.o =
thread.o tile_map.o tileset_editor_dialog.o tooltip.o translate.o utils.o v=
ariant.o water.o water_particle_system.o weather_particle_system.o widget.o=
 wml_formula_adapter.o wml_formula_callable.o wml_modify.o wml_node.o wml_p=
arser.o wml_schema.o wml_utils.o wml_writer.o unit_test.o formula_test.o wm=
l_parser_test.o loading_screen.o utility_object_compiler.o utility_object_e=
ditor.o -o game
collect2: ld terminated with signal 11 [Segmentation fault: 11]
debug_console.o: In function `std::list<graphics::texture, std::allocator<g=
raphics::texture> >::_M_insert(std::_List_iterator<graphics::texture>, grap=
hics::texture const&)':
/usr/pkg/lib/gcc45/include/c++/bits/stl_list.h:1435: undefined reference to=
 `std::_List_node_base::_M_hook(std::_List_node_base*)'
debug_console.o: In function `std::list<graphics::texture, std::allocator<g=
raphics::texture> >::_M_erase(std::_List_iterator<graphics::texture>)':
/usr/pkg/lib/gcc45/include/c++/bits/stl_list.h:1451: undefined reference to=
 `std::_List_node_base::_M_unhook()'
gmake: *** [game] Error 1
>Fix:
--- a.diff begins here ---
Index: games/frogatto/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /a/.cvsup/ports/games/frogatto/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- games/frogatto/Makefile	22 Aug 2010 14:29:08 -0000	1.4
+++ games/frogatto/Makefile	9 Sep 2010 16:14:03 -0000
@@ -31,6 +31,7 @@ post-patch:
 	@${REINPLACE_CMD} -E -e 's,(ccache )?g\+\+,$$(CXX) $$(CXXFLAGS),' \
 		-e 's,-O2,, ; s,-g,, ; s,/usr/X11R6,${LOCALBASE},' \
 		-e 's,-mt,,g ; /server/s,`.*mixer,${PTHREAD_LIBS},' \
+		-e 's,-L/usr/lib,, ; s,-L/sw/lib,,' \
 		-e '/server/s,-lX11,,' ${WRKSRC}/Makefile
 # Point to the right location where look for the resources on FreeBSD
 	@${REINPLACE_CMD} -e 's,HAVE_CONFIG_H,__FreeBSD__,' \
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->danfe 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Sep 9 16:20:13 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/150442: commit references a PR
Date: Wed, 22 Sep 2010 10:37:58 +0000 (UTC)

 danfe       2010-09-22 10:37:51 UTC
 
   FreeBSD ports repository
 
   Modified files:
     games/frogatto       Makefile distinfo 
   Log:
   - Update to version 1.0.3
   - Prevent ld(1) from picking up wrong -lstdc++ when using non-default
     compiler (e.g. GCC from ports) and thus unbreak the build [1]
   - Mute chmod(1) command
   - Adjust Makefile header and touch couple of comments while here
   
   PR:     ports/150442 [1]
   
   Revision  Changes    Path
   1.5       +7 -6      ports/games/frogatto/Makefile
   1.2       +3 -3      ports/games/frogatto/distinfo
 _______________________________________________
 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: danfe 
State-Changed-When: Wed Sep 22 10:41:55 UTC 2010 
State-Changed-Why:  
Fixed in Makefile rev. 1.5; thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=150442 
>Unformatted:
 dc++
