Opened 11 years ago
Closed 11 years ago
#40531 closed defect (fixed)
codeblocks: universal variant fails when non-universal codeblocks is already installed
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | mojca (Mojca Miklavec) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | codeblocks |
Description
Probably the -L
flags are in the wrong order.
Attachments (2)
Change History (10)
Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | main.log.bz2 added |
---|
comment:1 Changed 11 years ago by mojca (Mojca Miklavec)
comment:2 Changed 11 years ago by mojca (Mojca Miklavec)
Sorry, it turned out to be my outdated installation of wxGTK
. I'll try to explore if there is anything I can do, but I don't promise that I know how to fix this.
comment:3 Changed 11 years ago by mojca (Mojca Miklavec)
For me the solution was to replace
/opt/local/libcodeblocks.dylib
by
../sdk/.libs/libcodeblocks.dylib
in the following command that creates the codeblocks binary:
/usr/bin/clang++ -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -arch i386 -stdlib=libstdc++ -fPIC -DPIC -fexceptions -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 -o codeblocks app.o appglobals.o backtracedlg.o breakpointsdlg.o compilersettingsdlg.o cpuregistersdlg.o crashhandler.o debugger_interface_creator.o debuggermenu.o debuggersettingscommonpanel.o debuggersettingsdlg.o debuggersettingspanel.o disassemblydlg.o dlgabout.o dlgaboutplugin.o environmentsettingsdlg.o examinememorydlg.o infopane.o main.o notebookstyles.o prefix.o printdlg.o scriptconsole.o scriptingsettingsdlg.o splashscreen.o startherepage.o switcherdlg.o threadsdlg.o watchesdlg.o -Wl,-headerpad_max_install_names -L/opt/local/lib -L../sdk /opt/local/lib/libcodeblocks.dylib -L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/lib -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 /opt/local/lib/libgtk-x11-2.0.dylib /opt/local/lib/libgdk-x11-2.0.dylib /opt/local/lib/libpangocairo-1.0.dylib /opt/local/lib/libXrender.dylib /opt/local/lib/libXinerama.dylib /opt/local/lib/libXi.dylib /opt/local/lib/libXrandr.dylib /opt/local/lib/libXcursor.dylib /opt/local/lib/libXcomposite.dylib /opt/local/lib/libXdamage.dylib /opt/local/lib/libXfixes.dylib /opt/local/lib/libX11.dylib /opt/local/lib/libXext.dylib /opt/local/lib/libatk-1.0.dylib /opt/local/lib/libcairo.dylib /opt/local/lib/libgdk_pixbuf-2.0.dylib /opt/local/lib/libgio-2.0.dylib /opt/local/lib/libpangoft2-1.0.dylib /opt/local/lib/libpango-1.0.dylib -lm /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libglib-2.0.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/libfreetype.dylib -lpthread -ldl -pthread -framework ApplicationServices -framework System -framework CoreServices -framework IOKit
Now I'm buffled because I don't understand the following Makefile
rules.
am_codeblocks_OBJECTS = app.$(OBJEXT) appglobals.$(OBJEXT) \ backtracedlg.$(OBJEXT) breakpointsdlg.$(OBJEXT) \ compilersettingsdlg.$(OBJEXT) cpuregistersdlg.$(OBJEXT) \ crashhandler.$(OBJEXT) debugger_interface_creator.$(OBJEXT) \ debuggermenu.$(OBJEXT) debuggersettingscommonpanel.$(OBJEXT) \ debuggersettingsdlg.$(OBJEXT) debuggersettingspanel.$(OBJEXT) \ disassemblydlg.$(OBJEXT) dlgabout.$(OBJEXT) \ dlgaboutplugin.$(OBJEXT) environmentsettingsdlg.$(OBJEXT) \ examinememorydlg.$(OBJEXT) infopane.$(OBJEXT) main.$(OBJEXT) \ notebookstyles.$(OBJEXT) prefix.$(OBJEXT) printdlg.$(OBJEXT) \ scriptconsole.$(OBJEXT) scriptingsettingsdlg.$(OBJEXT) \ splashscreen.$(OBJEXT) startherepage.$(OBJEXT) \ switcherdlg.$(OBJEXT) threadsdlg.$(OBJEXT) \ watchesdlg.$(OBJEXT) codeblocks_OBJECTS = $(am_codeblocks_OBJECTS) codeblocks_LDADD = -L../sdk -lcodeblocks \ $(WX_LIBS) \ $(WX_GTK2_LIBS) codeblocks$(EXEEXT): $(codeblocks_OBJECTS) $(codeblocks_DEPENDENCIES) $(EXTRA_codeblocks_DEPENDENCIES)~ @rm -f codeblocks$(EXEEXT) $(CXXLINK) $(codeblocks_OBJECTS) $(codeblocks_LDADD) $(LIBS)
The variable $(codeblocks_OBJECTS)
is:
app.o appglobals.o backtracedlg.o breakpointsdlg.o compilersettingsdlg.o cpuregistersdlg.o crashhandler.o debugger_interface_creator.o debuggermenu.o debuggersettingscommonpanel.o debuggersettingsdlg.o debuggersettingspanel.o disassemblydlg.o dlgabout.o dlgaboutplugin.o environmentsettingsdlg.o examinememorydlg.o infopane.o main.o notebookstyles.o prefix.o printdlg.o scriptconsole.o scriptingsettingsdlg.o splashscreen.o startherepage.o switcherdlg.o threadsdlg.o watchesdlg.o
and $(WX_LIBS)
start with:
-L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/lib ...
So how does the
-L../sdk -lcodeblocks
part of $(codeblocks_LDADD)
result in
-Wl,-headerpad_max_install_names -L/opt/local/lib -L../sdk /opt/local/lib/libcodeblocks.dylib
?
Changed 11 years ago by mojca (Mojca Miklavec)
Attachment: | patch-src-src-Makefile.in.diff added |
---|
experimental patch for proper linking of the library
comment:4 Changed 11 years ago by mojca (Mojca Miklavec)
As Rainer Müller pointed it out on IRC, the Makefile
first generates
/bin/sh ../../libtool --tag=CXX --mode=link ccache /usr/bin/clang++ -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -arch i386 -stdlib=libstdc++ -fPIC -DPIC -fexceptions -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 -o codeblocks app.o [...] watchesdlg.o -L../sdk -lcodeblocks [...]
but libtool
turns that into
libtool: link: ccache /usr/bin/clang++ -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -arch i386 -stdlib=libstdc++ -fPIC -DPIC -fexceptions -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 -o codeblocks app.o [...] watchesdlg.o -Wl,-headerpad_max_install_names -L/opt/local/lib -L../sdk /opt/local/lib/libcodeblocks.dylib [...]
The problem is that
-L/opt/local/lib -L../sdk -lcodeblocks
will would link against the wrong library in either case (even if libtool
didn't replace the link). Based on his advice I created a patch that replaces
-L../sdk -lcodeblocks
with
../sdk/.libs/libcodeblocks.dylib
in the original Makefile
, hoping that this would solve the problem.
I'm not sure about a sane way to fix this upstream.
comment:5 Changed 11 years ago by mojca (Mojca Miklavec)
Ryan: please test if this works for you and if so, it may be committed and the ticket can be closed.
comment:6 Changed 11 years ago by mojca (Mojca Miklavec)
Committed in r111715. (An ugly solution, but feel free to close the ticket if it works.)
comment:7 Changed 11 years ago by mojca (Mojca Miklavec)
I made an upstream report (but I'm not exactly sure what to write there/how to describe the problem): https://developer.berlios.de/bugs/?func=detailbug&bug_id=19136&group_id=5358
comment:8 Changed 11 years ago by mojca (Mojca Miklavec)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Version: | 2.2.0 |
I wanted to test, but figured out I wasn't able to. I'm unable to install codeblocks as single architecture. The reason seems to be that Makefile contains undesired arch flags (most probably in one of the packages, most probably
wxGTK
'swx-config
returns-arch
)and I end up with:
I suspect that either the following line in wxWidgets'
Portfile
is missing the full path:or I must have a really old installation of wxGTK.