[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -DPIC - redundant?
From: |
Kevin F. Quinn |
Subject: |
Re: -DPIC - redundant? |
Date: |
Thu, 27 Jan 2005 9:18:57 +0100 |
Thanks people; I understand (now) that libtool supports many targets, each with
their own compilers. I guess that means the question becomes, why set -DPIC on
targets that use gcc, where that compiler defines __PIC__ if it's generating
PIC code (at least since gcc 2.8.1 to my knowledge - I don't know about earlier
versions)?
Presumably stuff that needs to use conditional compilation for PIC/non-PIC code
is compiler- and target-specific, so should use whatever support is provided in
each case (where libtool could add a define if otherwise there's nothing
available from which to decide on a given platform). In the case of gcc
targets, I think '#ifdef __PIC__' should always be used, however there's a lot
of code out there doing '#ifdef PIC' inside GCC-specific assembler blocks (for
example). I'd like to be able to say to people who use '#ifdef PIC' for
gcc-specific code (e.g. stuff inside an '#ifdef __GNUC__' block) that they
should be using __PIC__, and get it fixed accordingly.
Kevin