After adding the necessary -lm to LIBS in the Makefiles, I hit the following
error:
---
make[1]: Leaving directory
`/cluster/members/member0/tmp/openpkg/RPM/TMP/fsl-1.4.0'
/tmp/openpkg/bin/cc -D_XOPEN_SOURCE_EXTENDED -Ilib_l2 -Ilib_cfg -Ilib_pcre
-DHAVE_CONFIG_H -O -Ilib_l2 -Ilib_cfg -Ilib_pcre -c fsl.c -o fsl.o
fsl.c:951: error: conflicting types for 'vsyslog'
fsl.c:940: error: previous implicit declaration of 'vsyslog' was here
make: *** [fsl.lo] Error 1
---
The vsyslog() call is used in the syslog() function, which is BEFORE the
vsyslog() function and since there is no function prototype at the start of
the source, the compiler implicitly declares the vsyslog() function
(probably as 'int vsyslog(void)').
The fix is easy... put the vsyslog() function before the calls to it. Or put
a function prototype for vsyslog() at the top of the source.
[... fsl.c ...]
/* faked POSIX API function syslog(3) */
void syslog(int priority, const char *message, ...)
{
va_list args;
/* tracing */
fsldebug(L2_LEVEL_TRACE, "fsl in syslog(3); go ahead using vsyslog(3)");
/* wrap around vsyslog(3) */
va_start(args, message);
vsyslog(priority, message, args); <<<< used before declaration
va_end(args);
return;
}
/* faked POSIX API function vsyslog(3) */
#ifdef HAVE_VSYSLOG_USVALIST
void vsyslog(int priority, const char *fmt, __va_list args)
#else
void vsyslog(int priority, const char *fmt, va_list args)
#endif
{
[...]
> The fsl build is failing:
>
> ---
> ./libtool --mode=link --quiet /tmp/openpkg/bin/cc -L. -o
> l2tool l2tool.o
> libl2.la
> modf
> collect2: ld returned 1 exit status
> make: *** [l2tool] Error 1
> ---
>
>
> This looks familiar.. seems like the math lib is missing,
> adding -lm to the
> link line fixes this.
>
> $ grep modf *.c
> l2_ut_format.c: arg = modf(arg, &fi);
> l2_ut_format.c: fj = modf(fi / 10, &fi);
> l2_ut_format.c: arg = modf(arg, &fj);
>
>
> Works when linked with -lm :
> ./libtool --mode=link --quiet /tmp/openpkg/bin/cc -L. -o
> l2tool l2tool.o
> libl2.la -lm
> ______________________________________________________________________
> The OpenPKG Project www.openpkg.org
> Developer Communication List [EMAIL PROTECTED]
>
______________________________________________________________________
The OpenPKG Project www.openpkg.org
Developer Communication List [EMAIL PROTECTED]