help / color / mirror / Atom feed
From: Ingo Schwarze <>
To: Sevan Janiyan <>
Subject: Re: Fwd: textproc/mdocml 1.13.3 on Solaris 10
Date: Mon, 16 Mar 2015 16:35:11 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Sevan,

Kristaps Dzonsons cited Sevan Janiyan on Mon, Mar 16, 2015 at 09:58:39PM +0900:

> I've just stumbled across an issue with mdocml when building on
> Solaris 10 via pkgsrc-current, mkdtemp(), dirfd() and vasprintf() are
> not available on there hence build fails:

It is hard to believe these are really unavailable.  mkdtemp() and dirfd()
are POSIX 2008.  Admittedly, vasprintf() is a GNU extension, but it is
so common and important that i don't understand how a system could live
without it.

Besides, this is a *linker* failure.  If these functions were really
unavailable, there would be no prototypes in the header files, and
the *compiler* would already fail.  So i suspect somebody merely
hid the object code away in some other shared library, not -lc.

Sevan, can you please investigate which library file these symbols
are contained in on Solaris 10?  That is, which -lfoo option is
needed?  If the respective section 3 manuals fail to provide
information, grepping /usr/lib (or whereever the libraries are)
might provide clues...

It is not easily possibly to provide portable fallback implementations
of these functions:

 - mkdtemp() needs randomness.  We all now that is almost impossible
   to get randomness in a portable way, POSIX is only now starting
   work on defining a good interface.  So mkdtemp() must really be
   built into the system, using whatever randomness is available
   there, or it can't work properly.
 - dirfd() depends on the internal structure of the opaque DIR
   datatype.  It cannot be implemented portably, it must be built
   into the system's "dirent" implementation or it can't work.
 - vasprintf() would require to include a complete printf(3)
   compat implementation which seems unreasonable.  It is also
   difficult to do because typical vasprintf(3) implementations
   are intricately tied to the internals of the opaque FILE type.


> gcc -L/home/sme/pkgsrc/pbulk/lib -Wl,-R/home/sme/pkgsrc/pbulk/lib -o
> mandoc eqn_html.o  html.o  man_html.o  mdoc_html.o  tbl_html.o
> mdoc_man.o  eqn_term.o  man_term.o  mdoc_term.o  term.o  term_ascii.o
>  term_ps.o  tbl_term.o  main.o  manpath.o  out.o  tree.o mandocdb.o
> mansearch.o  mansearch_const.o libmandoc.a
> - -L/home/sme/pkgsrc/pbulk/lib -Wl,-R/home/s e/pkgsrc/pbulk/lib -lsqlite3
> mandocdb.o: In function `dbopen':
> mandocdb.c:(.text+0x136f): undefined reference to `mkdtemp'
> libmandoc.a(compat_fts.o): In function `fts_read':
> compat_fts.c:(.text+0x79b): undefined reference to `dirfd'
> libmandoc.a(mandoc_aux.o): In function `mandoc_asprintf':
> mandoc_aux.c:(.text+0x1ab): undefined reference to `vasprintf'
> collect2: ld returned 1 exit status
> *** Error code 1
> Stop.
> bmake: stopped in /tmp/obj-pbulk/textproc/mdocml/work/mdocml-1.13.3
> *** Error code 1
 To unsubscribe send an email to

  reply	other threads:[~2015-03-16 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2015-03-16 12:58 ` Kristaps Dzonsons
2015-03-16 15:35   ` Ingo Schwarze [this message]
2015-03-16 17:25     ` Joerg Sonnenberger
     [not found]     ` <>
     [not found]       ` <>
2015-03-18 19:51         ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).