This is the mail archive of the gcc-help@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]

-static with -mieee-fp flags Possible bug?


Hello:

I'm trying to compile a simple program using the flags -static and
-mieee-fp. The code is:

#include<stdio.h>
#include<math.h>
double calc(double a) {
    return sqrt(a);
}
int main()
{
    printf("Calc: %lf\n",calc(2.0));
    return 0;
}

I've compiled with gcc 4.7.1 in Debian and with gcc 4.1.2 and 4.6.0 in
RedHat, and the error is the same. I obtain the error:

/usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/libieee.a:(.data+0x0):
multiple definition of `_LIB_VERSION'
/usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/libm.a(s_lib_version.o):(.data+0x0):
first defined here collect2: error: ld returned 1 exit status

If I don't use the flas -mieee-fp the compilation runs without
problems and the static linked executable is created. Moreover, if I
use the sqrt() function in the main() instad of define the calc()
function, I can use the -mieee-fp flag without problems

#include<stdio.h>
#include<math.h>
int main()
{
    printf("Calc: %lf\n",sqrt(2.0));
    return 0;
}

Some time ago I posted a similar question
(http://gcc.gnu.org/ml/gcc-help/2009-12/msg00152.html) and the answer
was that the error was in libc from Debian. But the tests in RedHat
show that the error is not due to Debian, and depends on -mieee-fp
flag from gcc

Is this a bug?

Thanks

-- 
*****************************************
José Luis García Pallero
jgpallero@gmail.com
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************


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