Dealing with symbol visibility mismatches

Benjamin Reed rangerrick at gmail.com
Tue May 26 15:48:44 BST 2009


I'm running into an interesting issue in Fink (on Mac OS X) with the
way KDE handles symbol visibility.

Fink is a source-based distribution (a la Gentoo) but it creates .deb
packages for actual package management.

I've run into a user who got his kdelibs from an apt-get repository
where an older compiler was used, and thus __KDE_HAVE_GCC_VISIBILITY
was set to 0.  $prefix/include/kdemacros.h then does not define
__KDE_HAVE_GCC_VISIBILITY=1.

Now, he is attempting to build kdebase-runtime from source, and the
visibility test run during cmake is saying "yes, we support symbol
visibility," even though kdemacros.h does not turn on the KDE_EXPORT
macros, so we end up with errors like this:

[  7%] Building CXX object kuiserver/CMakeFiles/kuiserver.dir/kuiserver_dummy.o
Linking CXX executable kuiserver
Undefined symbols:
  "_kdemain", referenced from:
      _main in kuiserver_dummy.o
      _kdeinitmain in kuiserver_dummy.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


I'm trying to figure out the best way to fix this.  The first thing I
tried was setting -D__KDE_HAVE_GCC_VISIBILITY:BOOL=FALSE but that
doesn't work, it gets overridden internally for some reason.

Does it seem correct to fix the visibility test to check for
kdemacros.h and short-circuit as failing if it's not defined?

-- 
Benjamin Reed a.k.a. Ranger Rick
Fink, KDE, and Mac OS X development

Blog: http://www.raccoonfink.com/
Music: http://music.raccoonfink.com/




More information about the kde-core-devel mailing list