libtool
[Top][All Lists]
Advanced

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

Re: HEAD and HP-UX C++ compiler


From: Gary V. Vaughan
Subject: Re: HEAD and HP-UX C++ compiler
Date: Fri, 21 Sep 2001 04:11:59 +0100
User-agent: Mutt/1.3.22.1i

On Thu, Sep 20, 2001 at 09:38:24AM -0500, address@hidden wrote:
> On Wed, Sep 19, 2001 at 10:03:12PM -0500, address@hidden wrote:
> > $ aCC -o conftest conftest.cc conftstm.o
> > Error 352: "conftest.cc", line 23 # Cannot take the address of main.
> >       {"main", (lt_ptr_t) &main},

Yow!  Thats pretty lame :-(

> Here's a patch for this. Note that I tried, as a solution, changing
> the default lt_cv_sys_global_symbol_to_cdecl to:
>   sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e \
>   's/^$symcode* .* \(.*\)$/extern char \1;/p'
> as we should mark functions with a ().

I have wondered about this myself on occasion but was afraid to
actually change it.

> This worked on Solaris, HP-UX,
> Tru64 UNIX, and IRIX but not on AIX. Given the following program:
>   void foo(){int a=1;}
>   int un_test;
>   int in_test=1;
> 
> AIX xlc does:
>   $ xlc -c a.c
>   $ nm -Bg a.o
>          0 T .foo
>         44 D foo
>         56 D in_test
>         60 B un_test
> 
> If we could have the sed magic change this to (on output):
>   T foo foo
>   D in_test in_test
>   D un_test un_test
> then we'd be set but that requires us to keep state and I can't see a
> quick hack to do this.

Well, since your patch helps aCC, and produces no regressions
elsewhere, I'll apply it on HEAD.  If it proves troublesome later, we
can give the sed munging some more thought then...

> 2001-09-20  Albert Chin-A-Young <address@hidden>
> 
>       * libtool.m4: Don't include main() when testing for
>       command to parse $NM output because some C++ compilers
>       don't allow you to take the address of main (e.g. HP-UX aCC).

Applied, thanks!

Cheers,
        Gary.
-- 
  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/



reply via email to

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