Bug 151008 - KDE Hidden Visibility Broken in kde.eclass
Bug#: 151008 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: CLOSED Severity: normal Priority: P2
Resolution: INVALID Assigned To: kde@gentoo.org Reported By: roderick_greening@hotmail.com
Component: KDE
URL:  http://forums.gentoo.org/viewtopic.php?p=3640533#3640533
Summary: KDE Hidden Visibility Broken in kde.eclass
Keywords:  
Status Whiteboard: 
Opened: 2006-10-12 06:21 0000
Description:   Opened: 2006-10-12 06:21 0000
Here's the kde.eclass relevant code:

                if hasq kdehiddenvisibility ${IUSE} && use kdehiddenvisibility;
then 
                     if [[ $(gcc-major-version)$(gcc-minor-version) -ge 41 ]];
then 
                         if [[ ${PN} != "kdelibs" && ${PN} != "arts" ]] && \ 
                             ! fgrep -q "#define __KDE_HAVE_GCC_VISIBILITY"
"${KDEDIR}/include/kdemacros.h"; then 

                             eerror "You asked to enable hidden visibility, but
your kdelibs was" 
                             eerror "built without its support. Please rebuild
kdelibs with the" 
                             eerror "kdehiddenvisibility useflag enabled." 
                             die "kdelibs without hidden visibility" 
                         else 
                             unset kde_cv_prog_cxx_fvisibility_hidden 
                             myconf="$myconf $(use_enable kdehiddenvisibility
gcc-hidden-visibility)" 
                         fi 
                     else 
                         eerror "You're trying to enable hidden visibility,
but" 
                         eerror "you are using an old GCC version. Hidden
visibility" 
                         eerror "can be enabled only with GCC 4.1 and later." 
                     fi 
                 fi 

The problem is that it is looking for a define not present in the header file
(nor any of the headers installed in that path for that matter):

"#define __KDE_HAVE_GCC_VISIBILITY" "${KDEDIR}/include/kdemacros.h"

THis needs to be corrected as this is preventing any KDE app from being built
with hidden visibility.

------- Comment #1 From Diego E. 'Flameeyes' Pettenò 2006-10-12 06:35:28 0000 -------
Rebuild qt and kdelibs. If that define is not present, it means that you don't
have Hidden Visibility enabled in kdelibs. The check is _perfectly_ valid on
this.

------- Comment #2 From Roderick B. Greening 2006-10-12 08:11:22 0000 -------
(In reply to comment #1)
> Rebuild qt and kdelibs. If that define is not present, it means that you don't
> have Hidden Visibility enabled in kdelibs. The check is _perfectly_ valid on
> this.

Yeah. Looks like kdecore/kdemacros.h is simply missing the define on my system.
No idea why it is missing as it was compiled correctly. Only thing I can figure
is I have confcache installed and perhaps it broke something.

I am going to re-emerge and see if the kdemacros.h file correctly has the
define.

------- Comment #3 From Diego E. 'Flameeyes' Pettenò 2006-10-12 08:28:10 0000 -------
Remember to re-emerge qt first.

------- Comment #4 From Roderick B. Greening 2006-10-13 13:00:48 0000 -------
No need ot re-emerge qt. Qt was compiled correctly with hidden visibility from
previous kde install (at least in my case). I was simply upgrading.

As it turns out, confcache was definately the culprit here.

Recommend, if you use confcache, then disable it when emerging kdelibs (seemed
safe to leave on after - at least for me).

------- Comment #5 From Diego E. 'Flameeyes' Pettenò 2006-10-13 13:26:00 0000 -------
confcache is not supported, definitely not supported.