diff options
author | Darin Broady <dbroady1@yahoo.com> | 2010-01-22 14:12:02 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-22 14:12:02 (GMT) |
commit | 1ad847de17cb0e5f53bd5c62933ca887d9cdf7ef (patch) | |
tree | 22dd11174e27a61bc956d7aecb85e8ba4fbd4eff /config.tests | |
parent | a259511a2b76ddee2e1199802c66295b964c394e (diff) | |
download | Qt-1ad847de17cb0e5f53bd5c62933ca887d9cdf7ef.zip Qt-1ad847de17cb0e5f53bd5c62933ca887d9cdf7ef.tar.gz Qt-1ad847de17cb0e5f53bd5c62933ca887d9cdf7ef.tar.bz2 |
Add the ability for the SunStudio 8+ compilers to do
ELF symbol visibility.
Merge-request: 433
Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'config.tests')
-rwxr-xr-x | config.tests/unix/fvisibility.test | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test index b2bcc07..d716695 100755 --- a/config.tests/unix/fvisibility.test +++ b/config.tests/unix/fvisibility.test @@ -4,25 +4,41 @@ FVISIBILITY_SUPPORT=no COMPILER=$1 VERBOSE=$2 +CMDLINE= + + RunCompileTest() { cat >>fvisibility.c << EOF -__attribute__((visibility("default"))) void blah(); -#if !defined(__GNUC__) -# error "Visiblility support requires GCC" -#elif __GNUC__ < 4 -# error "GCC3 with backported visibility patch is known to miscompile Qt" +#if defined(__GNUC__) +# if (__GNUC__ < 4) +# error "GCC3 with backported visibility patch is known to miscompile Qt" +# endif +__attribute((visibility("default"))) void blah(); +#elif defined(__SUNPRO_CC) +# if (__SUNPRO_CC < 0x0550) +# error "SunStudio 8 or later is required for ELF visibility" +# endif +__global void blah(); +#else +# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" #endif EOF if [ "$VERBOSE" = "yes" ] ; then - "$COMPILER" -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes + "$COMPILER" -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes else - "$COMPILER" -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes + "$COMPILER" -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes fi rm -f fvisibility.c fvisibility.o } + case "$COMPILER" in +g++) + CMDLINE="-fvisibility=hidden" + RunCompileTest + ;; + aCC*) ;; @@ -34,14 +50,17 @@ icpc) ;; *) # the compile test works for the intel compiler because it mimics gcc's behavior + CMDLINE="-fvisibility=hidden" RunCompileTest ;; esac ;; - *) - RunCompileTest - ;; +CC) + # This should be SunStudio. If not, it'll get caught. + CMDLINE="-xldscope=hidden" + RunCompileTest + ;; esac # done |