> > The vsyslog() call [in fsl] 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 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.
> > 
> OSSP fsl was fixed, see http://cvs.ossp.org/chngview?cn=4516
> 
> OpenPKG l2 and fsl packages rolled, see
> http://cvs.openpkg.org/chngview?cn=16093
> http://cvs.openpkg.org/chngview?cn=16094
> 
> You are very close to getting access to Tru64 using OpenPKG 
> OpenSSH :-)

What's that saying again: "1 step forward, 2 steps back.."
:-(

$ openpkg rpm --rebuild fsl-1.5a1-20040422.src.rpm
[...]
checking dynamic linker characteristics... osf5.1 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pcre-config
config.status: creating config.h
config.status: executing adjustment commands
+ /usr/users/kvo/openpkg/dev/bin/make --no-print-directory
===> lib_l2 (all)
./libtool --mode=compile --quiet /usr/users/kvo/openpkg/dev/bin/cc -c  
-O2 -I. l2_env.c
In file included from l2_p.h:45,
                 from l2_env.c:31:
l2_ut_sa.h:171: error: parse error before "socklen_t"
l2_ut_sa.h:173: error: parse error before "socklen_t"
make[2]: *** [l2_env.lo] Error 1
make[1]: *** [_SUBDIRS_STEPDOWN] Error 1
make: *** [_SUBDIRS_all] Error 2
error: Bad exit status from 
/usr/users/kvo/openpkg/dev/RPM/TMP/rpm-tmp.28823 (%build)


Looks like a problem with socklen_t.

 From /usr/include/sys/socket.h :

[...]
/*
 * This data type is needed for both UNIX98 and POSIX support.
 */
#if (defined (_XOPEN_SOURCE) && (_XOPEN_SOURCE>=500)) || \
    defined(_POSIX_PII_SOCKET) || defined(__VMS)
typedef unsigned long   socklen_t;      /* 64-bits */
#endif
[...]


Browsing through the man pages, I stumbled on the standards man page [1] and
found the solution & reason.

Compiling the source with:
./libtool --mode=compile --quiet /usr/users/kvo/openpkg/dev/bin/cc -c 
-D_XOPEN_SOURCE=500 -O2 -I. l2_env.c

Seems to do the trick for this file... but then lateron, I get another
error:


-----
./libtool --mode=compile --quiet /usr/users/kvo/openpkg/dev/bin/cc -c  -O2
-I. -D_XOPEN_SOURCE=500 l2_ut_sa.c
l2_ut_sa.c: In function `l2_util_sa_addr_u2a':
l2_ut_sa.c:487: error: storage size of 'ai_hints' isn't known
l2_ut_sa.c:613: error: `EAI_MEMORY' undeclared (first use in this function)
l2_ut_sa.c:613: error: (Each undeclared identifier is reported only once
l2_ut_sa.c:613: error: for each function it appears in.)
l2_ut_sa.c:615: error: `EAI_SYSTEM' undeclared (first use in this function)
l2_ut_sa.c:620: error: dereferencing pointer to incomplete type
l2_ut_sa.c:621: error: dereferencing pointer to incomplete type
l2_ut_sa.c:622: error: dereferencing pointer to incomplete type
l2_ut_sa.c:626: error: dereferencing pointer to incomplete type
l2_ut_sa.c: In function `l2_util_sa_addr_a2u':
l2_ut_sa.c:778: error: dereferencing pointer to incomplete type
l2_ut_sa.c:780: error: dereferencing pointer to incomplete type
l2_ut_sa.c: In function `l2_util_sa_addr_match':
l2_ut_sa.c:857: error: dereferencing pointer to incomplete type
l2_ut_sa.c:859: error: dereferencing pointer to incomplete type
l2_ut_sa.c:866: error: dereferencing pointer to incomplete type
l2_ut_sa.c:868: error: dereferencing pointer to incomplete type
l2_ut_sa.c:889: error: dereferencing pointer to incomplete type
l2_ut_sa.c:890: error: dereferencing pointer to incomplete type
l2_ut_sa.c:891: error: dereferencing pointer to incomplete type
l2_ut_sa.c:892: error: dereferencing pointer to incomplete type
l2_ut_sa.c: In function `l2_util_sa_accept':
l2_ut_sa.c:1587: error: field `sa6' has incomplete type
l2_ut_sa.c: In function `l2_util_sa_getremote':
l2_ut_sa.c:1670: error: field `sa6' has incomplete type
l2_ut_sa.c: In function `l2_util_sa_getlocal':
l2_ut_sa.c:1710: error: field `sa6' has incomplete type
l2_ut_sa.c: In function `l2_util_sa_recv':
l2_ut_sa.c:2169: error: field `sa6' has incomplete type
make: *** [l2_ut_sa.lo] Error 1
-----

This is caused by struct addrinfo not being defined. However looking in
/usr/include/netdb.h, I see that struct addrinfo is wrapped between an
#ifdef _OSF_SOURCE, which according to the 'man standards' [1] page means:

"+ _OSF_SOURCE, which includes interface prototypes that are proprietary"

.. didn't know addrinfo was proprietary!



And then lastly...


./libtool --quiet --mode=link /usr/users/kvo/openpkg/dev/bin/cc -o libcfg.la
cfg_main.lo cfg_buf.lo cfg_grid.lo cfg_data.lo cfg_node.lo cfg_fmt.lo
cfg_syn.lo cfg_syn_parse.lo cfg_syn_scan.lo cfg_util.lo cfg_vers.lo -rpath
/usr/users/kvo/openpkg/dev/lib \
    -version-info `./shtool version -l c -d libtool cfg_vers.c`
/usr/users/kvo/openpkg/dev/bin/cc -D_XOPEN_SOURCE_EXTENDED -Ilib_l2
-Ilib_cfg -Ilib_pcre -DPCRE_PREFIX=fsl_ -DHAVE_CONFIG_H -O2 -c cfg_test.c
./libtool --quiet --mode=link /usr/users/kvo/openpkg/dev/bin/cc  -o cfg_test
cfg_test.o libcfg.la
modf
collect2: ld returned 1 exit status
make[2]: *** [cfg_test] Error 1
make[2]: Leaving directory
`/usr/users/kvo/openpkg/dev/RPM/TMP/fsl-1.5a1/lib_cfg'
make[1]: *** [_SUBDIRS_STEPDOWN] Error 1
make[1]: Leaving directory `/usr/users/kvo/openpkg/dev/RPM/TMP/fsl-1.5a1'
make: *** [_SUBDIRS_all] Error 2


Looks like lib_cfg() is also using modf().. so either add -lm or use the
workaround from the previous patch.



Recap:
- add compiler flags -D_XOPEN_SOURCE=500 -D_OSF_SOURCE
  maybe this is best done in rpmtool cflags?!
- fix modf() call in lib_cfg

Regards,
Karl

-----------------------
[1] -
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN5/0001
____.HTM

[...]
  Controlling Definition Environments in Header Files

  The -D option's arguments control the different compiler definition
  environments supported by the header files that are supplied by the 
operat-
  ing system.

  When no compilation definition macros are explicitly defined, the default
  action for both the cc and c89 compilers is to include the following mac-
  ros:

    +  _XOPEN_SOURCE, which includes interfaces defined in Version 4 of The
       Open Group's XBD, XCU, and XSH CAE specifications

    +  _OSF_SOURCE, which includes interface prototypes that are proprietary

  The _XOPEN_SOURCE macro does not correspond to the current versions of the
  Open Group's CAE specifications. In other words, you must explicitly
  specify _XOPEN_SOURCE=500 if you are using functions as defined in the 
XSH5
  CAE specification (which is recommended) or _XOPEN_SOURCE=420 if you are
  using functions as defined in the XSH4.2 CAE specification. (Note that
  _XOPEN_SOURCE is equivalent to _XOPEN_SOURCE=400 and 
_XOPEN_SOURCE_EXTENDED
  is equivalent to _XOPEN_SOURCE=420.)
[...]
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to