discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Peter Bray <pdb_ml@yahoo.com.au>
To: discuss@mdocml.bsd.lv
Subject: mdocml [CVS_2015_11_07] Linking of soelim(1) fails on Solaris 10
Date: Sat, 07 Nov 2015 15:21:00 +1100	[thread overview]
Message-ID: <563D7C2C.1080903@yahoo.com.au> (raw)

Greetings,

soelim(1) fails to link on Solaris 10 systems as the appropriate
compatibility code has not been included in the linking of the
executable.

Changing the Makefile linking command to include additional
compatibility object code, as follows:   (helps but...)

--- Makefile.orig       2015-11-07 00:47:44.000000000 +0000
+++ Makefile    2015-11-07 03:39:21.786602977 +0000
@@ -414,5 +414,5 @@

  soelim: $(SOELIM_OBJS) compat_reallocarray.o compat_err.o 
compat_progname.o
-       $(CC) $(LDFLAGS) -o $@ $(SOELIM_OBJS) compat_reallocarray.o
+       $(CC) $(LDFLAGS) -o $@ $(SOELIM_OBJS) compat_reallocarray.o 
compat_err.o compat_progname.o

But, the Solaris 10 build then fails to find getline(3C).

Looking at the code base, getline(3C) is only used once:

   soelim.c:100:   while ((linelen = getline(&line, &linecap, f)) > 0) {

While a compatibility function fgetln() from compat_fgetln.c is used
in many places:

   manpage.c:127:  if (NULL != (cp = fgetln(stdin, &len)))
   cgi.c:720:      while (NULL != (p = fgetln(f, &len))) {
   cgi.c:1145:     while (NULL != (dp = fgetln(fp, &dpsz))) {
   main.c:791:     while ((line = fgetln(stream, &len)) != NULL) {
   main.c:821:             syscall = "fgetln";
   mandocdb.c:1309:        while (NULL != (line = fgetln(stream, &len)))
   mandocdb.c:1318:        while (NULL != (line = fgetln(stream, &len)))
   mandocdb.c:1332:        while (NULL != (line = fgetln(stream, &len))) {
   manpath.c:221:  while ((cp = fgetln(stream, &len)) != NULL) {

Both functions on the surface (and no, I didn't do any investigation),
seem to be doing a simalar task (reading a line from a file handle).

Question: Should soelim.c also be using fgetln()?

Back to the Makefile, I noticed that the unedited file contains:

Makefile:267:SOELIM_OBJS         = soelim.o compat_stringlist.o

Makefile:415:soelim: $(SOELIM_OBJS) compat_reallocarray.o
Makefile:416:   $(CC) $(LDFLAGS) -o $@ $(SOELIM_OBJS) compat_reallocarray.o

Question: Should compat_reallocarray.o and the compatibility object
code change I proposed be moved to the definition of SOELIM_OBJS?

Regards,

Peter Bray
Sydney, Australia

--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2015-11-07  4:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  4:21 Peter Bray [this message]
2015-11-07 21:56 ` 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=563D7C2C.1080903@yahoo.com.au \
    --to=pdb_ml@yahoo.com.au \
    --cc=discuss@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).