This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch,Fortran,Build] PR driver/46516: Add -lquadmath in the FE not as libgfortran.spec file


On Thu, Nov 18, 2010 at 12:05:15PM +0100, Tobias Burnus wrote:
> On 11/18/2010 11:31 AM, Jakub Jelinek wrote:
> >On Thu, Nov 18, 2010 at 11:22:58AM +0100, Tobias Burnus wrote:
> >>The automatic addition of -lquadmath is guarded by
> >>LIBGCC2_HAS_TF_MODE, which should be a sufficiently safe check.
> >The macro looks misnamed to me, it is something only i?86/x86_64
> >define,
> and ia64
> 
> >which is good for libquadmath, but there are many other
> >targets that have TF mode, but as long double rather than __float128,
> >and those won't have libquadmath (talking about sparc*/powerpc*/s390* etc.).
> 
> I agree that it is misnamed - and that it is confusing. (The need
> for a comment why one cannot use LIBGCC2_HAS_TF_MODE directly
> already indicates that the macro is not well named, cf.
> gcc/config/dfp-bit.h.)
> 
> I terms of the patch, one could make it more explicit by using:
> 
>   #if LONG_DOUBLE_HAS_TF_MODE \
> && LIBGCC2_LONG_DOUBLE_TYPE_SIZE != 128

Well, you can'd do that in the driver.
LIBGCC2_* macros are really meant for use in libgcc code only (could be
in other target libraries, but definitely not in the driver).
The thing is that e.g. on alpha/sparc*/powerpc* we have
/* Define this to set long double type size to use in libgcc2.c, which can
   not depend on target_flags.  */
#ifdef __LONG_DOUBLE_128__
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
#else
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
#endif

and __LONG_DOUBLE_128__ is a macro defined by the compiler depending on
the compiler switches.  If you use it in the driver, it will depend on
whatever macro has been defined in the host compiler (if any).
LIBGCC2_HAS_TF_MODE currently happens to work because it is only
defined to 1 on the targets you care about and not defined at all elsewhere,
but e.g. as soon as the support would be dependent on compiler switches on
some target this wouldn't work anymore.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]