Bug 10916 - Interprets --exclude-libs completely different to old GNU ld
Summary: Interprets --exclude-libs completely different to old GNU ld
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-08 00:18 UTC by robert.wohlrab
Modified: 2009-12-31 12:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description robert.wohlrab 2009-11-08 00:18:16 UTC
I have currently the problem that kde4libs doesn't build.

Linking CXX shared library ../lib/libplasma.so
cd plasma && /usr/bin/cmake -E cmake_link_script CMakeFiles/plasma.dir/link.txt
--verbose=1
/usr/bin/g++  -fPIC -g -O2 -g -Wall -O2 -Wnon-virtual-dtor -Wno-long-long -ansi
-Wundef -Wcast-align -Wchar-subscripts -Wall 
-W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common
-Woverloaded-virtual -fno-threadsafe-statics 
-fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -DQT_NO_DEBUG -Wl,--
new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,--no-undefined -Wl,--
-o ../lib/libplasma.so.3.0.0 CMakeFiles/plasma.dir/plasma_automoc.o
CMakeFiles/plasma.dir/packagemetadata.o 
CMakeFiles/plasma.dir/packagestructure.o CMakeFiles/plasma.dir/package.o
CMakeFiles/plasma.dir/abstractrunner.o 
CMakeFiles/plasma.dir/animationdriver.o CMakeFiles/plasma.dir/animator.o
CMakeFiles/plasma.dir/applet.o 
CMakeFiles/plasma.dir/configloader.o CMakeFiles/plasma.dir/containment.o
CMakeFiles/plasma.dir/context.o 
CMakeFiles/plasma.dir/corona.o CMakeFiles/plasma.dir/datacontainer.o
CMakeFiles/plasma.dir/dataengine.o 
CMakeFiles/plasma.dir/dataenginemanager.o CMakeFiles/plasma.dir/delegate.o
CMakeFiles/plasma.dir/dialog.o 
CMakeFiles/plasma.dir/extender.o CMakeFiles/plasma.dir/extendergroup.o
CMakeFiles/plasma.dir/extenderitem.o 
CMakeFiles/plasma.dir/paintutils.o CMakeFiles/plasma.dir/framesvg.o
CMakeFiles/plasma.dir/plasma.o 
CMakeFiles/plasma.dir/popupapplet.o
CMakeFiles/plasma.dir/private/applethandle.o 
CMakeFiles/plasma.dir/private/datacontainer_p.o
CMakeFiles/plasma.dir/private/desktoptoolbox.o 
CMakeFiles/plasma.dir/private/extenderapplet.o
CMakeFiles/plasma.dir/private/extenderitemmimedata.o 
CMakeFiles/plasma.dir/private/nativetabbar.o
CMakeFiles/plasma.dir/private/packages.o 
CMakeFiles/plasma.dir/private/paneltoolbox.o
CMakeFiles/plasma.dir/private/runnerjobs.o 
CMakeFiles/plasma.dir/private/style.o CMakeFiles/plasma.dir/private/toolbox.o
CMakeFiles/plasma.dir/private/tooltip.o 
CMakeFiles/plasma.dir/private/wallpaperrenderthread.o
CMakeFiles/plasma.dir/private/windowpreview.o 
CMakeFiles/plasma.dir/querymatch.o CMakeFiles/plasma.dir/runnercontext.o
CMakeFiles/plasma.dir/runnermanager.o 
CMakeFiles/plasma.dir/runnersyntax.o
CMakeFiles/plasma.dir/scripting/appletscript.o 
CMakeFiles/plasma.dir/scripting/dataenginescript.o
CMakeFiles/plasma.dir/scripting/runnerscript.o 
CMakeFiles/plasma.dir/scripting/scriptengine.o CMakeFiles/plasma.dir/service.o
CMakeFiles/plasma.dir/servicejob.o 
CMakeFiles/plasma.dir/svg.o CMakeFiles/plasma.dir/theme.o
CMakeFiles/plasma.dir/tooltipcontent.o 
CMakeFiles/plasma.dir/tooltipmanager.o CMakeFiles/plasma.dir/version.o
CMakeFiles/plasma.dir/view.o 
CMakeFiles/plasma.dir/wallpaper.o CMakeFiles/plasma.dir/widgets/checkbox.o
CMakeFiles/plasma.dir/widgets/combobox.o 
CMakeFiles/plasma.dir/widgets/flashinglabel.o
CMakeFiles/plasma.dir/widgets/frame.o CMakeFiles/plasma.dir/widgets/groupbox.o 
CMakeFiles/plasma.dir/widgets/iconwidget.o
CMakeFiles/plasma.dir/widgets/label.o CMakeFiles/plasma.dir/widgets/lineedit.o 
CMakeFiles/plasma.dir/widgets/meter.o
CMakeFiles/plasma.dir/widgets/pushbutton.o
CMakeFiles/plasma.dir/widgets/radiobutton.o 
CMakeFiles/plasma.dir/widgets/scrollbar.o
CMakeFiles/plasma.dir/widgets/signalplotter.o 
CMakeFiles/plasma.dir/widgets/slider.o CMakeFiles/plasma.dir/widgets/spinbox.o
CMakeFiles/plasma.dir/widgets/toolbutton.o 
CMakeFiles/plasma.dir/widgets/busywidget.o
CMakeFiles/plasma.dir/widgets/scrollwidget.o 
CMakeFiles/plasma.dir/widgets/svgwidget.o
CMakeFiles/plasma.dir/widgets/tabbar.o
CMakeFiles/plasma.dir/widgets/textbrowser.o 
CMakeFiles/plasma.dir/widgets/treeview.o
CMakeFiles/plasma.dir/widgets/textedit.o
CMakeFiles/plasma.dir/widgets/webview.o 
CMakeFiles/plasma.dir/glapplet.o CMakeFiles/plasma.dir/widgets/videowidget.o -
../lib/libkdeui.so.5.3.0 ../lib/libkio.so.5.3.0 -lQtCore
../lib/libkdecore.so.5.3.0 ../lib/libkdeui.so.5.3.0 
../lib/libkio.so.5.3.0 ../lib/libkfile.so.4.3.0 ../lib/libknewstuff2.so.4.3.0 -
lQtWebKit ../lib/libthreadweaver.so.4.3.0 -lQtCore ../lib/libkdecore.so.5.3.0
../lib/libsolid.so.4.3.0 -lSM -lICE -lX11 -
lXext -lXau -lXdmcp -lphonon -ldl -lQtOpenGL -lGL ../lib/libkio.so.5.3.0
../lib/libkdeui.so.5.3.0 ../lib/libkdecore.so.5.3.0 
-lQtDBus -lQtSvg ../lib/libsolid.so.4.3.0 -lQtNetwork -lQtXml -lQtGui -lQtCore 
/usr/bin/ld: warning: hidden symbol 'QFont::pointSize() const' in
CMakeFiles/plasma.dir/delegate.o is referenced by DSO 
/usr/lib/gcc/x86_64-linux-gnu/4.3.4/../../../../lib/libQtWebKit.so
/usr/bin/ld: warning: hidden symbol 'QVariant::QVariant(QTime const&)' in
/usr/lib/gcc/x86_64-linux-
gnu/4.3.4/../../../../lib/libQtCore.so is referenced by DSO
/usr/lib/gcc/x86_64-linux-
gnu/4.3.4/../../../../lib/libQtWebKit.so
/usr/bin/ld: warning: hidden symbol 'QWidget::windowActivationChange(bool)' in
CMakeFiles/plasma.dir/dialog.o is referenced 
by DSO /usr/lib/gcc/x86_64-linux-gnu/4.3.4/../../../../lib/libQtWebKit.so
/usr/bin/ld: warning: hidden symbol 'QWidget::~QWidget()' in
CMakeFiles/plasma.dir/dialog.o is referenced by DSO 
/usr/lib/gcc/x86_64-linux-gnu/4.3.4/../../../../lib/libQtWebKit.so
/usr/bin/ld: warning: hidden symbol 'typeinfo for QWidget' in
CMakeFiles/plasma.dir/dialog.o is referenced by DSO 
/usr/lib/gcc/x86_64-linux-gnu/4.3.4/../../../../lib/libQtWebKit.so
/usr/bin/ld: warning: hidden symbol 'QVariant::constData() const' in
/usr/lib/gcc/x86_64-linux-
gnu/4.3.4/../../../../lib/libQtCore.so is referenced by DSO
/usr/lib/gcc/x86_64-linux-
gnu/4.3.4/../../../../lib/libQtWebKit.so
....

This is related to --exclude-libs specified on the commandline. The man page of
ld says "This option is available only for the i386 PE targeted port of the
linker and for ELF targeted ports".... "For ELF targeted ports, symbols
affected by this option will be treated as hidden". As it works with the old
linker without problem I would guess that the new linker just ommits everything
which is needed for the library specified by --exclude-libs. If I remove this
option the file gets linked also with binutils-gold.

Downstream bug: http://bugs.debian.org/555012
Comment 1 Ian Lance Taylor 2009-12-31 00:28:32 UTC
Thanks for the bug report.  I can't help but notice that though you mention --
exclude-libs in the description, you aren't actually using it in the link command 
line.  Still I will look to see if I can spot a difference in behaviour.
Comment 2 Sourceware Commits 2009-12-31 01:14:45 UTC
Subject: Bug 10916

CVSROOT:	/cvs/src
Module name:	src
Changes by:	ian@sourceware.org	2009-12-31 01:14:34

Modified files:
	gold           : ChangeLog symtab.cc 
	gold/testsuite : exclude_libs_test_1.c 

Log message:
	PR 10916
	* symtab.cc (Symbol_table::add_from_relobj): When not exporting
	symbols from this object, don't change the visibility of an
	undefined symbol.
	* testsuite/exclude_libs_test_1.c (lib1_ref): New function.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.412&r2=1.413
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/symtab.cc.diff?cvsroot=src&r1=1.134&r2=1.135
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/testsuite/exclude_libs_test_1.c.diff?cvsroot=src&r1=1.1&r2=1.2

Comment 3 Ian Lance Taylor 2009-12-31 01:17:09 UTC
I think I've spotted the problem.  I committed a patch for it.  Please let me 
know if you still have problems with this.
Comment 4 robert.wohlrab 2009-12-31 12:13:49 UTC
Weird that that information is missing. I thought that I just copied the
bugreport from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555012 .... were
you can see the --exclude-libs in the command line.

Little bit weird, but thanks for fixing it anyway :)