bug-gnulib
[Top][All Lists]
Advanced

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

Re: libposix - is it done yet?


From: Bruno Haible
Subject: Re: libposix - is it done yet?
Date: Sun, 10 Oct 2010 18:00:02 +0200
User-agent: KMail/1.9.9

Hi Bruce,

> <a 
> href="http://www.woofiles.com/dl-208694-BfZFVR4K-libposix2010.10.05.tar.gz";>libposix-2010.10.05.tar.gz</a>

> The tarball rolls up to 2MB with these directories:
> 
> libposix-2010.10.05/libposix/uniwidth
> libposix-2010.10.05/libposix/unistr
> libposix-2010.10.05/libposix/glthread
> libposix-2010.10.05/glm4
> libposix-2010.10.05/build-aux
> libposix-2010.10.05/aclocal

IMO the unit tests should be included. If people install this on various
systems which we haven't tested, they should be able to see whether they
can trust what they are installing. And they should be enabled to report
failures that we haven't encountered.

> and installs these objects (not counting headers):
> 
> usr/local/libexec/libposix/pt_chown
> usr/local/lib/libposix.la
> usr/local/lib/libposix.so.0.0.0
> usr/local/lib/libposix.a
> usr/local/share/pkgconfig/libposix.pc
> usr/local/share/aclocal/libposix.m4

1) IMO the inclusion guards of the headers need to be transformed, e.g. from
_GL_STDLIB_H to _LIBPOSIX_STDLIB_H, or similar. So that programs that use
gnulib don't get confused.

2) The library should use libtool versioning:

# Libtool's library version information for libposix.
# See the libtool documentation, section "Library interface versions".
LTV_CURRENT=0
LTV_REVISION=0
LTV_AGE=0
libposix_la_LDFLAGS += -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE)

3) On MacOS X 10.5, the library does not link:

/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2   -o libposix.la -rpath 
/Users/bruno/data/inst-libposix/20101005/lib  -no-undefined                     
                             -liconv                          areadlink.lo 
areadlinkat.lo c-ctype.lo c-strcasecmp.lo c-strncasecmp.lo close-hook.lo 
exitfail.lo freading.lo fseterr.lo full-write.lo localcharset.lo 
glthread/lock.lo malloca.lo openat-die.lo printf-frexp.lo printf-frexpl.lo 
sockets.lo strnlen1.lo glthread/threadlib.lo glthread/tls.lo tmpdir.lo 
unistr/u8-mbtoucr.lo unistr/u8-uctomb.lo unistr/u8-uctomb-aux.lo 
uniwidth/width.lo xalloc-die.lo asnprintf.lo at-func2.lo basename-lgpl.lo 
canonicalize-lgpl.lo chdir-long.lo chown.lo cloexec.lo dirname-lgpl.lo 
dprintf.lo dup-safer.lo error.lo euidaccess.lo faccessat.lo fchmodat.lo 
fchownat.lo fcntl.lo fd-safer.lo fdopendir.lo fflush.lo filenamecat-lgpl.lo 
fprintf.lo fpurge.lo fseek.lo fseeko.lo fstatat.lo futimens.lo getcwd.lo 
getdelim.lo getline.lo getopt.lo getopt1.lo gettime.lo glob.lo group-member.lo 
ioctl.lo isfinite.lo isnand.lo isnanf.lo isnanl.lo lchown.lo link.lo linkat.lo 
lstat.lo mempcpy.lo memrchr.lo mkdirat.lo mkfifo.lo mkfifoat.lo mknod.lo 
mknodat.lo open.lo openat.lo openat-proc.lo pipe-safer.lo poll.lo printf.lo 
printf-args.lo printf-parse.lo rawmemchr.lo readlink.lo readlinkat.lo regex.lo 
remove.lo rename.lo renameat.lo safe-read.lo safe-write.lo save-cwd.lo 
setenv.lo snprintf.lo spawnattr_getschedparam.lo spawnattr_getschedpolicy.lo 
spawnattr_setschedparam.lo spawnattr_setschedpolicy.lo sprintf.lo stat.lo 
stpncpy.lo strchrnul.lo stripslash.lo strndup.lo strnlen.lo strstr.lo strtod.lo 
symlink.lo symlinkat.lo tempname.lo unlink.lo unlinkat.lo utimens.lo 
utimensat.lo vasnprintf.lo vdprintf.lo vfprintf.lo vprintf.lo vsnprintf.lo 
vsprintf.lo wcwidth.lo xgetcwd.lo xmalloc.lo  
...
Undefined symbols:
  "_program_name", referenced from:
      _program_name$non_lazy_ptr in error.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[4]: *** [libposix.la] Error 1

I would suggest to fix this by adding the 'progname' module to the library.
It's not the perfect solution, but better than nothing.

4) On MacOS X 10.5, the library does not link:

/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2   -o pt_chown  pt_chown.o 
libposix.la -lrt 
libtool: link: gcc -g -O2 -o .libs/pt_chown pt_chown.o  ./.libs/libposix.dylib 
/usr/lib/libiconv.dylib -lrt
ld: library not found for -lrt
collect2: ld returned 1 exit status
make[4]: *** [pt_chown] Error 1

Fix: Don't hardcode -lrt.

5) The libposix.m4 file should be rewritten from scratch to *not* use
pkg-config and instead use the macros from the gnulib 'havelib' module.
Gary has explaint well why pkg-config is a nuisance.

6) On Solaris 8, with gcc, the files fnmatch.h, float.h, errno.h, stddef.h,
stdbool.h, stdarg.h, sched.h get created after the library has been built,
with invalid contents (#include_next without argument, and such). The mistake
is that you have included stddef.h in nobase_nodist_pkginclude_HEADERS,
although STDDEF_H is empty on this platform. Likewise for the others.

Bruno



reply via email to

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