bug-gnu-utils
[Top][All Lists]
Advanced

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

[gettext-0.16.1] undefined ceil() reference when building msgl-fsearch.c


From: gnu4u
Subject: [gettext-0.16.1] undefined ceil() reference when building msgl-fsearch.c
Date: Fri, 6 Apr 2007 17:26:08 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.1)

Hello!

Some month ago there was a message on this mailing list with the title 'Re: Upgrade to gettext-0.16.1 gives ceil undefined reference' (10. Feb. 2007) . There were no replies to this. Today I got the same error message and had a closer look.

Description

When compiling gettext-0.16.1 make stops with:
msgl-fsearch.c:589: undefined reference to `ceil'
collect2: ld returned 1 exit status

As stated in the other mail, the symbol MSGMERGE_LIBM is not set. The reason for this is, that the test is somewhat 'special': the program that is used to look if -lm must be used or not is:

#include <math.h>
int
main ()
{
static double x; x = ceil(x); x = sqrt(x);
  ;
  return 0;
}

When compiling this with
 gcc -o conftest -g -O2 conftest.c
it results in no error on my system (Linux i686, gcc 4.1.2, binutils 2.17) because there are inline functions for ceil() and sqrt() and they are used. So there is really no need for '-lm' in this case.
[When using: -fno-inline the complilation fails.]


What I do not understand is, that also the msgl-fsearch.c is build with -O2 but it seems that in this case the compiler does *NOT* inline the ceil().

Also I have no real patch for this. For GCC it might be ok when using -fno-inline - but for other compilers? (And also I'm not sure if other compilers are supported.). Maybe a better test is to use 'nm' on the libm.* and have a look if the 'ceil' symbol is defined there? (Which also heavily depends on (the output) of the used nm.)

Kind regards

Andreas Florath








reply via email to

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