Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Sep 2010 20:16:27 +0400
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/150442: [patch] games/frogatto: prevent ld(1) from picking up wrong -lstdc++
Message-ID:  <86aanqvqn8.fsf@gmail.com>
Resent-Message-ID: <201009091620.o89GK0B5027776@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         150442
>Category:       ports
>Synopsis:       [patch] games/frogatto: prevent ld(1) from picking up wrong -lst=
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 09 16:20:00 UTC 2010
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
 dc++



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86aanqvqn8.fsf>