ecc gives an error with '#pragma weak ' if -fPIC flag is used

ecc gives an error with '#pragma weak ' if -fPIC flag is used

Hi,

I am having trouble with compiling a C program which
has a '#pragma weak symbol ...' line on ia64 if the -fPIC
flag is used.

The program looks like this:

robin@pingu: cat conftest.c
#pragma weak RMCFoo=Foo
int Foo(int a) { return a; }
int t() {
return (RMCFoo(1));
}
int main() {
t();
return 0;
}
robin@pingu:

It compiles fine without -fPIC:

robin@fab0: ecc -o conftest conftest.c
conftest.c(6): warning #266: function declared implicitly
return (RMCFoo(1));
^

but fails with -fPIC:

robin@fab0: ecc -o conftest -fPIC conftest.c
conftest.c(6): warning #266: function declared implicitly
return (RMCFoo(1));
^

/tmp/ecc75PCzLs(185) : error A2042: symbol RMCFoo for equate is already defined
/tmp/eccVs4NiH.o - 1 error(s), 0 warning(s)
robin@fab0:

It works fine on an ia32 machine:

robin@pingu: icc -o conftest -fPIC conftest.c
conftest.c(6): warning #266: function declared implicitly
return (RMCFoo(1));
^

robin@pingu:

Can anyone offer any help or a workaround?

Thanks,
Robin

publicaciones de 6 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Just an addition to my previous post; I see that the
options should be -KPIC not -fPIC but the problem
still occurs.

Hi Robin,
I tried your test case with latest version of Intel compiler (v7.0.086) and it worked with -fPIC/-KPIC option.

Which version of Intel compiler are you using?

Regards,
CP

Thanks for replying; I am running 7.0-65 (information below). Where can I find 7.0-86? I can only find
-65 in the download section of the website.

ecc -V
Intel C++ Itanium Compiler for Itanium-based applications
Version 7.0, Build 20021018
Copyright (C) 1985-2002 Intel Corporation. All rights reserved.
robin@fab0: rpm -qi intel-ecc7-7.0-65
Name : intel-ecc7 Relocations: /opt/intel
Version : 7.0 Vendor: Intel Corporation
Release : 65 Build Date: Mon 04 Nov 2002 18:10:37 GMT
Install date: Fri 24 Jan 2003 17:52:57 GMT Build Host: pii-rh71-1.sc.intel.com
Group : Development/Languages Source RPM: intel-ecc7-7.0-65.src.rpm
Size : 94400988 License: Intel Copyright 2002
Packager : eric.e.koegler@intel.com
Summary : Intel C++ Itanium Compiler for Itanium-based applications Version 7.0, Build 20021018
Description :

robin@fab0:

You need to register yourself for Intel premier support to get the latest Intel compiler updates - please refer to
http://developer.intel.com/software/products/support/file_download.htm

CP

Thanks. It took a while to track down our login/password
to premier support but the upgrade to 086 has fixed the
problem.

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya