[Mesa-dev] [PATCH] configure: simplify visibility compiler flag detection

Marc Dietrich marvin24 at gmx.de
Sun Mar 1 11:50:18 PST 2015


Am Sonntag 01 März 2015, 10:30:08 schrieb Matt Turner:
> On Sun, Mar 1, 2015 at 6:09 AM, Marc Dietrich <marvin24 at gmx.de> wrote:
> > This patch simplifies the visibility compiler flag detection in configure
> > and makes it more generic to also support compilers other than gcc.
> 
> This simplification relies on the assumption that compilers support
> -fvisibility=... if and only if they support
> attribute(visibility("...")).
> 
> I guess that might be the case, but the logic doesn't seem very sound.

I think it's ok, because attribute(visibilty) is a gcc extension. So if any 
compiler supports this, it wants to be gcc compatible for some reason. 
Therefore -IMHO- this implicitly implies -fvisibility. 

> Is the 'if test "x$GCC" = xyes; then' test actually rejecting clang?
> It doesn't seem so, since above there's a 'if test "x$GCC" = xyes -a
> "x$acv_mesa_CLANG" = xno; then'
> 
> So, I guess it looks to me like we already support visibility
> detection for !gcc.

clang reports itself as gcc 4.2.1 or so (clang -dumpversion). This is why 
there is an extra test. I see no obvious reason to keep it inside the if block 
because it should be generic (not gcc/clang specific). 

Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150301/252f2514/attachment.sig>


More information about the mesa-dev mailing list