libtool-patches
[Top][All Lists]
Advanced

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

Re: Bug#485421: With icc, libtool tries -KPIC (removed option) instead o


From: Ralf Wildenhues
Subject: Re: Bug#485421: With icc, libtool tries -KPIC (removed option) instead of -fPIC
Date: Wed, 18 Jun 2008 22:31:49 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

[ <http://bugs.debian.org/485421> ]

Hello Vincent, and sorry for the slow reply,

* Vincent Lefevre wrote on Mon, Jun 09, 2008 at 02:45:11PM CEST:
> On 2008-06-09 14:24:00 +0200, Ralf Wildenhues wrote:
> > Sigh.  They can't even keep compatibility with their own compiler.
> > (IIRC at the point this code was introduced, -KPIC worked and -fPIC
> > didn't.)
> 
> Didn't they mark it as deprecated before being removed?

They did.  So?  What's the cost of Just Supporting It Indefinitely?
In this case, my guess is: close to zero.

If they didn't like -KPIC, why didn't they use -fPIC right from the
start?  (No need to answer, it's a long story, buying KCC and so on...)

See, even with them marking it as deprecated, and adding a warning
option and all, here, there's really no point in introducing
incompatible command line API changes.  I mean heck, ICC for years just
worked to emulate GCC's command line API, using such despicable
strategies such as ignoring unknown options matching '-f*' without an
error return:

> icpc: command line warning #10006: ignoring unknown option '-frpath'

but when it comes to their own, documented options, they introduce hard
failures.  That's just inconsistent in the extreme.

> icpc: error #10014: problem during multi-file optimization compilation
> (code 4)

That looks like you have a broken icpc installation.

Anyway, this is the patch I'd like to apply, plus put you in THANKS.
Please give it a whirl.

Thanks,
Ralf

2008-06-18  Ralf Wildenhues  <address@hidden>

        * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC) [linux] <icc, icpc>:
        Use -fPIC, newer Intel compilers (icc 10, ifort 9) reject -KPIC.
        * tests/localization.at: Skip test if the compiler fails merely
        due to the locale setting.
        * THANKS: Update.
        Report by Vincent Lefevre.

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index a2a4534..4a8d3e5 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3703,8 +3703,15 @@ m4_if([$1], [CXX], [
            _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
            ;;
-         icpc* | ecpc* )
-           # Intel C++
+         ecpc* )
+           # old Intel C++ for x86_64 which still supported -KPIC.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
            _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
            _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -3974,12 +3981,15 @@ m4_if([$1], [CXX], [
 
     linux* | k*bsd*-gnu)
       case $cc_basename in
-      icc* | ecc*)
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
        _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
         ;;
-      ifort*)
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
        _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
diff --git a/tests/localization.at b/tests/localization.at
index 311aca7..d489fef 100644
--- a/tests/localization.at
+++ b/tests/localization.at
@@ -38,6 +38,10 @@ AT_DATA([b.c],
 [[int y;
 ]])
 
+# First see if setting a locale is accepted at all.
+AT_CHECK([$CC $CPPFLAGS $CFLAGS -c b.c || exit 77], [], [stdout], [stderr])
+
+# Find out about expected output.
 AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr])
 mv -f stdout expected-stdout
 mv -f stderr expected-stderr




reply via email to

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