Bug 108838 - make fails during link step
Summary: make fails during link step
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Cmake (show other bugs)
Version: 0.7.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-10 05:57 UTC by Felix
Modified: 2022-01-31 16:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.6.0


Attachments
config.log (115.62 KB, text/plain)
2005-07-12 03:13 UTC, Felix
Details
modified kdemacros.h (5.28 KB, text/plain)
2005-07-13 02:28 UTC, Felix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Felix 2005-07-10 05:57:45 UTC
Version:           0.7.3 (using KDE KDE 3.3.1)
Installed from:    Fedora RPMs
OS:                Linux

when making digikam I got the following error:
/bin/sh ../../libtool --silent --mode=link --tag=CXX g++  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wno-non-virtual-dtor -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -fvisibility=hidden -fvisibility-inlines-hidden -DQT_CLEAN_NAMESPACE    -o digikamimageplugin_core.la -rpath /usr/lib/kde3 -module -avoid-version -module -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined -R /usr/lib -R /usr/lib -R /usr/lib/qt-3.3/lib -R /usr/X11R6/lib  -L/usr/lib -L/usr/lib/qt-3.3/lib -L/usr/X11R6/lib    imageplugin_core.lo imageeffect_bwsepia.lo imageeffect_ratiocrop.lo imageeffect_bcg.lo imageeffect_redeye.lo imageeffect_blur.lo imageeffect_sharpen.lo imageeffect_rgb.lo imageeffect_hsl.lo -lkparts ../../digikam/digikam/libdigikam.la
.libs/imageplugin_core.o(.text+0x32): In function `ImagePlugin_Core::ImagePlugin_Core(QObject*, char const*, QStringList const&)':
: undefined reference to `Digikam::ImagePlugin::ImagePlugin(QObject*, char const*)'
.libs/imageplugin_core.o(.text+0xf6e): In function `ImagePlugin_Core::ImagePlugin_Core(QObject*, char const*, QStringList const&)':
: undefined reference to `Digikam::ImagePlugin::ImagePlugin(QObject*, char const*)'
.libs/imageplugin_core.o(.text+0x1ea7): In function `ImagePlugin_Core::~ImagePlugin_Core()':
: undefined reference to `Digikam::ImagePlugin::~ImagePlugin()'
.libs/imageplugin_core.o(.text+0x1ee3): In function `ImagePlugin_Core::~ImagePlugin_Core()':
: undefined reference to `Digikam::ImagePlugin::~ImagePlugin()'
.libs/imageplugin_core.o(.text+0x1f20): In function `ImagePlugin_Core::~ImagePlugin_Core()':
: undefined reference to `Digikam::ImagePlugin::~ImagePlugin()'
.libs/imageplugin_core.o(.text+0x204f): In function `ImagePlugin_Core::slotBlur()':
: undefined reference to `Digikam::ImagePlugin::parentWidget()'
.libs/imageplugin_core.o(.text+0x2097): In function `ImagePlugin_Core::slotSharpen()':
: undefined reference to `Digikam::ImagePlugin::parentWidget()'
.libs/imageplugin_core.o(.text+0x20df): In function `ImagePlugin_Core::slotBCG()':
: undefined reference to `Digikam::ImagePlugin::parentWidget()'
.libs/imageplugin_core.o(.text+0x2127): In function `ImagePlugin_Core::slotRGB()':
: undefined reference to `Digikam::ImagePlugin::parentWidget()'
.libs/imageplugin_core.o(.text+0x216f): In function `ImagePlugin_Core::slotHSL()':
: undefined reference to `Digikam::ImagePlugin::parentWidget()'
.libs/imageplugin_core.o(.text+0x21b9): more undefined references to `Digikam::ImagePlugin::parentWidget()' follow
.libs/imageplugin_core.o(.gnu.linkonce.d._ZTI16ImagePlugin_Core+0x8): undefined reference to `typeinfo for Digikam::ImagePlugin'
collect2: ld returned 1 exit status
make[4]: *** [digikamimageplugin_core.la] Error 1
make[4]: Leaving directory `/opt/download/digikam-0.7.3/digikam/imageplugins'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/download/digikam-0.7.3/digikam/imageplugins'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/download/digikam-0.7.3/digikam'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/download/digikam-0.7.3'
make: *** [all] Error 2

for what it's worth, there *is* digikam/utilities/imageeditor/imageplugin.lo and compilation didn't give any errors:
/bin/sh ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H-I. -I. -I../../.. -I../../../digikam/digikam -I../../../digikam/libs/widgets -I../../../digikam/libs/histogram -I../../../digikam/utilities/splashscreen -I/usr/X11R6/include  -I/usr/include/kde -I/usr/lib/qt-3.3/include -I/usr/X11R6/include    -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wno-non-virtual-dtor -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION-fvisibility=hidden -fvisibility-inlines-hidden -DQT_CLEAN_NAMESPACE  -c -o imageplugin.lo `test -f 'imageplugin.cpp' || echo './'`imageplugin.cpp

Thank you
Comment 1 Renchi Raju 2005-07-11 07:44:14 UTC
seems to be a visibility issue with the fedora compiler. i have heard only the fedora users complaining about this problem
Comment 2 Felix 2005-07-11 16:16:28 UTC
Renchi,
I am not sure if I understand what you are saying, but I *did* make a change recommended http://bugs.kde.org/show_bug.cgi?id=108458#c5 - that is, I changed visibility to "default" in kdemacros.h
Comment 3 Renchi Raju 2005-07-11 20:35:57 UTC
nevermind about my earlier comment. what is the compiler version you have? 
(g++ -v should give you that info). Also can you attach your config.log (it will be present in your top level digikam source directory once you run configure).
Comment 4 Felix 2005-07-12 03:13:17 UTC
Created attachment 11771 [details]
config.log

config.log from ./configure
Comment 5 Felix 2005-07-12 03:13:40 UTC
g++ -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.fc3)
Comment 6 Renchi Raju 2005-07-12 19:29:17 UTC
i have a strong feeling its a visibility bug. can you also attach your kdemacros.h (should be in /usr/include/kde) and then i will know for sure.
Comment 7 Felix 2005-07-13 02:28:17 UTC
Created attachment 11787 [details]
modified kdemacros.h

I changed 'visible' to 'default'
Comment 8 Renchi Raju 2005-07-13 02:52:32 UTC
one more quick test. 
$ cd digikam-0.7.3/ digikam/digikam/.libs
$ objdump -t -C libdigikam.so |grep ImagePlugin::ImagePlugin

and let me know of the output of the above command
Comment 9 Thiago Macieira 2005-07-13 04:11:34 UTC
"visible" only affects KDE 3.3.0. No version later or before.

Yes, those errors are typical of visibility problems. 
Comment 10 Felix 2005-07-13 05:48:04 UTC
$objdump -t -C libdigikam.so |grep ImagePlugin::ImagePlugin
00134088 l     F .text  00000054              .hidden Digikam::ImagePlugin::ImagePlugin(QObject*, char const*)
001340dc l     F .text  00000054              .hidden Digikam::ImagePlugin::ImagePlugin(QObject*, char const*)

the obvious question, of course, is whether this ".hidden" is a problem...

>"visible" only affects KDE 3.3.0. No version later or before. 
Ihave KDE 3.3.1 (straight from FC3 distribution) As I mentioned earlier, I am getting compile-time "visible" problem with the original kdemacros.h. So, either there is something else in play (that affects both compile and link) or this assertion is incorrect.
Comment 11 Thiago Macieira 2005-07-13 05:56:29 UTC
Sorry, you're right. 3.3.1 is also affected:

$ svn cat svn://anonsvn.kde.org/home/kde/tags/KDE/3.3.0/kdelibs/kdecore/kdemacros.h | grep KDE_EXPORT\ __attribute__
#define KDE_EXPORT __attribute__ ((visibility("visible")))

$ svn cat svn://anonsvn.kde.org/home/kde/tags/KDE/3.3.1/kdelibs/kdecore/kdemacros.h | grep KDE_EXPORT\ __attribute__
#define KDE_EXPORT __attribute__ ((visibility("visible")))

$ svn cat svn://anonsvn.kde.org/home/kde/tags/KDE/3.3.2/kdelibs/kdecore/kdemacros.h | grep KDE_EXPORT\ __attribute__
#define KDE_EXPORT __attribute__ ((visibility("default")))

Please upgrade your kdelibs to >= 3.3.2, or manually patch kdemacros.h to reflect the correct value.
Comment 12 Felix 2005-07-13 08:05:34 UTC
> Please upgrade your kdelibs to >= 3.3.2, or manually patch kdemacros.h to reflect the correct value. 
I did patch kdemacros.h (see attached file); that's why I don't get the compile error any more. Are you sure the link error (undefined reference to `Digikam::ImagePlugin::...') is also due to visibility problem? I am not quite following the logic here
Comment 13 Vardhman 2005-07-13 11:15:35 UTC
> ------- Additional Comments From felix rabinovich org  2005-07-13 08:05 -------
> > Please upgrade your kdelibs to >= 3.3.2, or manually patch kdemacros.h to reflect the correct value.
> I did patch kdemacros.h (see attached file); that's why I don't get the compile error any more. Are you sure the link error (undefined reference to `Digikam::ImagePlugin::...') is also due to visibility problem? I am not quite following the logic here


I am not sure but probably the error arises because the default
visibilty will now be hidden but the plugin will need that to be
visible. Since compile time error is solved it means its a linking
issue and these kind of errors(Undefined reference) existed even
without visibility when the symbols were not found (due to improper
linking).
I didn't do a proper study on visibility attribute but what I could
make is it is some kind of exposing/non exposing of symbols. So if
visibility is hidden it acts like not exposing the symbols and that
might be stopping the linking as it is undefined reference case.

some one could clarify these issues please? As I already told briefly
in previous post setting visible to hidden patch in kdemacros.h helped
me in compiling digikam but the kipi-plugins were not showing up in
the interface of digikam. So I finally had to disable the visibility
stuff from my configure.in.in files.

--
Comment 14 Renchi Raju 2005-07-13 19:12:05 UTC
001340dc l     F .text  00000054  .hidden Digikam::ImagePlugin::ImagePlugin(QObject*, char const*) 

the above indicates its a visiblity problem. that is a bit surprising considering that your kdemacros.h is patched to enable visibility. i'm emailing you my kdemacros.h. replace your system one with that and rebuild the tarball from scratch.
Comment 15 Felix 2005-07-13 19:41:09 UTC
will do tonight (that is in 8-10 hours). In the meantime I noticed that the flags in link command (see above) are "-fvisibility=hidden -fvisibility-inlines-hidden". Wouldn't that override visibility flag from kdemacros.h?

Now, I have to admit, I have no idea what 'visibility' means here (visibility of object module for the linker; visibility/scope of the variable at runtime, something else - I haven't programmed professionally for over 10 years). so I am not even sure that my question makes sense :-) But for those who know better - didn't want to overlook this visibility=hidden thingy during link!
Comment 16 Renchi Raju 2005-07-14 01:25:16 UTC
while you are at it, you might as well install the soon to be released digikam 0.7.4. the tarballs are here:
http://pooh.tam.uiuc.edu/digikam/split_tarballs/
Comment 17 Felix 2005-07-14 05:58:11 UTC
no luck! tried the new kdemacros.h (from email) with both 0.7.3 and 0.7.4 - I still get the linking error :-( there gotta be something else (or something else as well ;-/ )
Comment 18 Renchi Raju 2005-07-14 23:00:28 UTC
Felix, i got hold of a fedora core 3 and was able to reproduce the problem and subsequently fix the problem. here is the list of fixes:
* if kde < 3.3.2, then don't enable hidden visibility
* a missing config.h was added to digikam_export.h 
* instead of relying on kdemacros.h the digikam_export.h directly uses the gcc default attribute.

this enable compilation on all kde versions (with no requirement to change kdemacros.h). currently only the digikam tarball is fixed. i will update the digikamimageplugins package as well.

as before the tarballs are here:
http://pooh.tam.uiuc.edu/digikam/split_tarballs/ 

Comment 19 Felix 2005-07-15 06:44:04 UTC
for the record, I also had to install libtool-ltdl-devel. Otherwise I got "missing /usr/lib/libltdl.la" error. Once I had that, everything gets built (and starts up) OK. Looking forward to updated digikamimageplugins package as well...

Thanks a lot for the quick fix! Hopefully, I won't be the only one to enjoy it :-)