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

[jwe@bevo.che.wisc.edu: Re: Bug#166179: octave2.1_2.1.37-1(hppa/unstable): FTBFS: non-PIC in shared lib]



Hi folks,

John (Octave author) and I (.deb maintainer) need help with a build error of
the latest octave on s390.  Could you provide some insights?

Thanks,  Dirk

----- Forwarded message from "John W. Eaton" <jwe@bevo.che.wisc.edu> -----

Envelope-to: edd@edd.debian.net
Delivery-date: Thu, 24 Oct 2002 10:35:08 -0500
From: "John W. Eaton" <jwe@bevo.che.wisc.edu>
To: "Dirk Eddelbuettel" <edd@debian.org>
Cc: "John W. Eaton" <jwe@bevo.che.wisc.edu>, lamont+buildd@hp.com,
   166179-forwarded@bugs.debian.org, submit@bugs.debian.org
Subject: Re: Bug#166179: octave2.1_2.1.37-1(hppa/unstable): FTBFS: non-PIC =
in shared lib

On 24-Oct-2002, Dirk Eddelbuettel <edd@debian.org> wrote:

| Thanks for the quick reply. I'll apply the patch tonight.
|=20
| I just glanced at   http://buildd.debian.org/build.php?pkg=3Doctave2.1
| and there are some more arches failing. In some cases dependencies are
| not verified -- clearly a Debian issue.  But e.g. on s390 I noticed
| a C++ link error with ostream.=20

This is happening whtn compiling scripts/gethelp.cc.  The error is:

g++ -o gethelp gethelp.cc
/tmp/ccPYkLVU.o: In function `ostream & operator<<<char, string_char_traits=
<char>, __default_alloc_template<true, 0> >(ostream &, basic_string<char, s=
tring_char_traits<char>, __default_alloc_template<true, 0> > const &)':
/tmp/ccPYkLVU.o(.gnu.linkonce.t.__ls__H3ZcZt18string_char_traits1ZcZt24__de=
fault_alloc_template2b1i0_R7ostreamRCt12basic_string3ZX01ZX11ZX21_R7ostream=
+0x10): undefined reference to `ostream::write(char const *, long)'
collect2: ld returned 1 exit status

I have no idea why this is happening, because gethelp.cc is a simple,
157 line long, self-contained C++ program (appended below).  It
doesn't directly reference any ostream::write function (there is not
even the string write in the program).  I can compile it with
g++-2.95, g++-3.0, and g++-3.2 on my x86 system.  Can someone with
access to an s390 system please try to debug what is happening?

There is also another problem with configure on s390, but it would not
affect the failure to compiler gethelp.cc:

checking C++ ABI version used by /usr/bin/g++... ./configure: line 1: conft=
est.o: command not found
=2E/configure: line 1: conftest.o: command not found
=2E/configure: line 1: conftest.o: command not found
unknown

How can I get access to the config.log file?

Thanks,

jwe


#include <string>
#include <iostream>

#ifndef NPOS
#define NPOS std::string::npos
#endif

static bool
looks_like_octave_copyright (const std::string& s)
{
  bool retval =3D false;

  std::string t =3D s.substr (0, 14);

  if (t =3D=3D "Copyright (C) ")
    {
      size_t pos =3D s.find ('\n');

      if (pos !=3D NPOS)
	{
	  pos =3D s.find ('\n', pos + 1);

	  if (pos !=3D NPOS)
	    {
	      pos++;

	      t =3D s.substr (pos, 28);

	      if (t =3D=3D "This file is part of Octave."
		  || t =3D=3D "This program is free softwar")
		retval =3D true;
	    }
	}
    }

  return retval;
}

// Eat whitespace and comments from FFILE, returning the text of the
// first block of comments that doesn't look like a copyright notice,

static std::string
extract_help_text (void)
{
  std::string help_txt;

  bool first_comments_seen =3D false;
  bool begin_comment =3D false;
  bool have_help_text =3D false;
  bool in_comment =3D false;
  bool discard_space =3D true;
  int c;

  while ((c =3D std::cin.get ()) !=3D EOF)
    {
      if (begin_comment)
	{
	  if (c =3D=3D '%' || c =3D=3D '#')
	    continue;
	  else if (discard_space && c =3D=3D ' ')
	    {
	      discard_space =3D false;
	      continue;
	    }
	  else
	    begin_comment =3D false;
	}

      if (in_comment)
	{
	  if (! have_help_text)
	    {
	      first_comments_seen =3D true;
	      help_txt +=3D (char) c;
	    }

	  if (c =3D=3D '\n')
	    {
	      in_comment =3D false;
	      discard_space =3D true;

	      if ((c =3D std::cin.get ()) !=3D EOF)
		{
		  if (c =3D=3D '\n')
		    break;
		}
	      else
		break;
	    }
	}
      else
	{
	  switch (c)
	    {
	    case ' ':
	    case '\t':
	      if (first_comments_seen)
		have_help_text =3D true;
	      break;

	    case '\n':
	      if (first_comments_seen)
		have_help_text =3D true;
	      continue;

	    case '%':
	    case '#':
	      begin_comment =3D true;
	      in_comment =3D true;
	      break;

	    default:
	      goto done;
	    }
	}
    }

 done:

  if (! help_txt.empty ())
    {
      if (looks_like_octave_copyright (help_txt))=20
	help_txt.resize (0);

      if (help_txt.empty ())
	help_txt =3D extract_help_text ();
    }

  return help_txt;
}

int
main (int argc, char **argv)
{
  std::string name;

  if (argc !=3D 2)
    {
      std::cerr << "usage: gethelp name\n";
      return 1;
    }
  else
    name =3D argv[1];

  std::string help_text =3D extract_help_text (); =20

  if (! help_text.empty ())
    {
      std::cout << "=1F" << name << "\n" << help_text;

      if (help_text[help_text.length () - 1] !=3D '\n')
	std::cout << "\n";
    }

  return 0;
}


----- End forwarded message -----

-- 
Good judgement comes from experience; experience comes from bad judgement. 
							    -- Fred Brooks



Reply to: