[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] -fvisibility problems
From: Szombathelyi György <gyurco () freemail ! hu>
Date: 2004-11-17 9:43:18
Message-ID: 419B1D36.3010001 () freemail ! hu
[Download RAW message or body]
Szombathelyi György wrote:
> Dirk Mueller wrote:
>
>> On Tuesday 16 November 2004 21:18, Szombathelyi György wrote:
>>
>>
>>>> That cannot be committed as is, for two reasons: installed header files
>>>> must not include config.h and kjs must not have dependencies on other
>>>> parts of kdelibs.
>>>
>>>
>>> Have you got a better idea for the feature test?
>>
>>
>>
>> Well, I'm not sure yet that it is necessary, I think older gcc's can
>> cope just fine with unsupported attributes. If not, we can either make
>> the configure check use -fvisibility based on the gcc version or
>> create an installable kdelibs_config.h that only contains the
>> KDE_EXPORT macro. Not sure which variant is best.. I'm not yet
>> convinced that the backportings of the -fvisibility stuff in the
>> various vendor compilers is bug free.
>>
> As I have nearly finished with arts, and compiled kdelibs with
> -fvisibility patched gcc 3.4.2, I didn't notice any problems yet.
> Some solution needed, because the current situtation breaks the compile
> process. The -fvisibility=hidden flag added, but the KDE_EXPORT macro
> not defined correctly.
> What about passing a -DHAVE_HIDDEN_VISIBILITY option with the
> -fvisibility=hidden flag, this doesn't require config.h?
>
The attaced patch does the trick, is it acceptable?
["kdelibs-visibility2.diff" (text/plain)]
Index: admin/acinclude.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/acinclude.m4.in,v
retrieving revision 2.478
diff -u -3 -p -u -r2.478 acinclude.m4.in
--- admin/acinclude.m4.in 15 Nov 2004 02:30:26 -0000 2.478
+++ admin/acinclude.m4.in 17 Nov 2004 09:40:19 -0000
@@ -3048,7 +3048,7 @@ AC_DEFUN([AC_CHECK_COMPILERS],
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
- KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, [CXXFLAGS="$CXXFLAGS \
-fvisibility=hidden"]) + KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, \
[CXXFLAGS="$CXXFLAGS -fvisibility=hidden -DHAVE_HIDDEN_VISIBILITY"])
KDE_CHECK_COMPILER_FLAG(fvisibility-inlines-hidden, [CXXFLAGS="$CXXFLAGS \
-fvisibility-inlines-hidden"])
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], \
USE_EXCEPTIONS= ) ENABLE_PERMISSIVE_FLAG="-fpermissive"
Index: kdecore/kdemacros.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kdemacros.h,v
retrieving revision 1.15
diff -u -3 -p -u -r1.15 kdemacros.h
--- kdecore/kdemacros.h 15 Sep 2004 15:37:28 -0000 1.15
+++ kdecore/kdemacros.h 17 Nov 2004 09:40:21 -0000
@@ -34,7 +34,7 @@
* \end
*/
-#if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 > 4)
+#if defined __GNUC__ && defined(HAVE_HIDDEN_VISIBILITY)
/* Visibility is available for GCC newer than 3.4.
* See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9283
*/
Index: kjs/global.h
===================================================================
RCS file: /home/kde/kdelibs/kjs/global.h,v
retrieving revision 1.10
diff -u -3 -p -u -r1.10 global.h
--- kjs/global.h 15 Nov 2004 02:31:24 -0000 1.10
+++ kjs/global.h 17 Nov 2004 09:40:26 -0000
@@ -34,7 +34,7 @@
#define KJS_PACKED
#endif
-#if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 > 4)
+#if defined __GNUC__ && defined(HAVE_HIDDEN_VISIBILITY)
#define KJS_EXPORT __attribute__ ((visibility("default")))
#else
#define KJS_EXPORT
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic