[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set flags based on compiler version?

From: Ralf Wildenhues
Subject: Re: set flags based on compiler version?
Date: Fri, 7 Jul 2006 07:05:21 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hi Tim,

* Tim Mooney wrote on Fri, Jul 07, 2006 at 01:13:25AM CEST:
> Is there a recommended way to modify libtool (I'm looking at 1.5.22) such
> that PIC flags are set based on compiler *version*?

Look at the output of the compiler.  For Sun compilers, we use something
  case `$CC -V 2>&1 | sed 5q` in
  *Sun\ C*) ...

to match C and C++ compilers (in the CVS HEAD and branch-1-5).  It
should be possible to amend this for a version check.

> The Sun Studio 11 compilers (C and C++) still accept -KPIC, but it's marked
> in the manual as obsolete and not to be used (and probably has been for a
> few revisions of the compiler).

Hmm, yes, I noted some of the flags we are using are obsolete.  I really
wonder though whether they really will kill support for -KPIC: that
would be a foolish thing to do, IMVHO. really
suggests to me that supporting -KPIC is a help for the user.

> The manual recommends instead using
> -xcode=pic32 , which, just to make things a bit more interesting, only
> works on sparc (not x86 or x86_64).
> That leaves us with three cases:

...which is exactly why I think killing support for -KPIC is not a good
idea on their side.  My gut feeling is that we should not act here until
things break.  Does the compiler issue a warning by default?

> - sparc*-sun-solaris* with an "old" version of Workshop/Forte/Studio
>   compiler:

> - sparc*-sun-solaris* with W/F/S compiler newer than some version (I know
>   this works with the 6u2 compiler, which reports its version as 5.3)

> - x86*-*-solaris* with W/F/S compiler, any version:

> If someone can provide some guidance on how to approach this, I'll send
> along a patch.

Well, match as above, plus against $host, or $host_os.  But your list is
incomplete: we have since added support for Solaris compilers on
GNU/Linux as well.  And we still have mostly working code for systems
matching against sunos* (there has been a bug report to this end
recently).  But likely both of those aren't an issue for your change.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]