Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB cvs won't build on AIX 4.1
@ 2002-02-02 18:45 Alexandre Oliva
  2002-02-03 18:40 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2002-02-02 18:45 UTC (permalink / raw)
  To: gdb

While linking gdb, I get:

ld: 0711-224 WARNING: Duplicate symbol: PC
ld: 0711-224 WARNING: Duplicate symbol: BC
ld: 0711-341 WARNING: Replaced XTY_CM symbol BC requires an
        alignment more strict than the alignment of the symbol that replaces it.
ld: 0711-224 WARNING: Duplicate symbol: UP
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-781 ERROR: TOC overflow. TOC size: 76340       Maximum size: 65536
collect2: ld returned 12 exit status
make[2]: *** [gdb] Error 1

The duplicate-symbol warnings are probably not to be too concerned
about (they come from ncurses and readline, and have never hurt), but
the actual error is the TOC overflow.  Perhaps we should hard-code the
link option -bbigtoc for gdb to link properly on AIX?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-02 18:45 GDB cvs won't build on AIX 4.1 Alexandre Oliva
@ 2002-02-03 18:40 ` Andrew Cagney
  2002-02-04  4:15   ` Alexandre Oliva
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-02-03 18:40 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gdb

> While linking gdb, I get:
> 
> ld: 0711-224 WARNING: Duplicate symbol: PC
> ld: 0711-224 WARNING: Duplicate symbol: BC
> ld: 0711-341 WARNING: Replaced XTY_CM symbol BC requires an
>         alignment more strict than the alignment of the symbol that replaces it.
> ld: 0711-224 WARNING: Duplicate symbol: UP
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> ld: 0711-781 ERROR: TOC overflow. TOC size: 76340       Maximum size: 65536
> collect2: ld returned 12 exit status
> make[2]: *** [gdb] Error 1
> 
> The duplicate-symbol warnings are probably not to be too concerned
> about (they come from ncurses and readline, and have never hurt), but
> the actual error is the TOC overflow.  Perhaps we should hard-code the
> link option -bbigtoc for gdb to link properly on AIX?


That was the problem.  See gdb/294.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=294

Andrew


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-03 18:40 ` Andrew Cagney
@ 2002-02-04  4:15   ` Alexandre Oliva
  2002-02-04  8:06     ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2002-02-04  4:15 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

On Feb  4, 2002, Andrew Cagney <ac131313@cygnus.com> wrote:

>> Perhaps we should hard-code the link option -bbigtoc for gdb to
>> link properly on AIX?

> That was the problem.  See gdb/294.
> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=294

Thanks for the pointer.  Would it be pointless then to post a patch
that detected which version of GCC is in use, and whether the linker
it uses accepts -bbigtoc?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-04  4:15   ` Alexandre Oliva
@ 2002-02-04  8:06     ` Andrew Cagney
  2002-02-04  9:47       ` Elena Zannoni
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-02-04  8:06 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gdb

> On Feb  4, 2002, Andrew Cagney <ac131313@cygnus.com> wrote:
> 
> 
>>> Perhaps we should hard-code the link option -bbigtoc for gdb to
>>> link properly on AIX?
> 
> 
>> That was the problem.  See gdb/294.
>> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=294
> 
> 
> Thanks for the pointer.  Would it be pointless then to post a patch
> that detected which version of GCC is in use, and whether the linker
> it uses accepts -bbigtoc?


The oposite!  See Peter Schauer's comment - it would solve the problem.

Andrew


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-04  8:06     ` Andrew Cagney
@ 2002-02-04  9:47       ` Elena Zannoni
  2002-02-04 12:59         ` Peter.Schauer
  0 siblings, 1 reply; 8+ messages in thread
From: Elena Zannoni @ 2002-02-04  9:47 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Alexandre Oliva, gdb

Andrew Cagney writes:
 > > On Feb  4, 2002, Andrew Cagney <ac131313@cygnus.com> wrote:
 > > 
 > > 
 > >>> Perhaps we should hard-code the link option -bbigtoc for gdb to
 > >>> link properly on AIX?
 > > 
 > > 
 > >> That was the problem.  See gdb/294.
 > >> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=294
 > > 
 > > 
 > > Thanks for the pointer.  Would it be pointless then to post a patch
 > > that detected which version of GCC is in use, and whether the linker
 > > it uses accepts -bbigtoc?
 > 
 > 
 > The oposite!  See Peter Schauer's comment - it would solve the problem.
 > 
 > Andrew

Sorry for the late reply, but there is another way to solve that
problem which is to compile gdb passing the -mminimal-toc option to
gcc. This should be uniformly OK independently of the linker used.

There are also these options available, but I haven't tried them.

-mfull-toc 
-mno-fp-in-toc 
-mno-sum-in-toc 


FWIW, using the GNU linker and reverting that patch I get this
error: ../../powerpc-ibm-aix4.3.3.0/bin/ld: invalid BFD target
`bigtoc'collect2: ld returned 1 exit status

Elena


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-04  9:47       ` Elena Zannoni
@ 2002-02-04 12:59         ` Peter.Schauer
  2002-02-24  5:10           ` Alexandre Oliva
  0 siblings, 1 reply; 8+ messages in thread
From: Peter.Schauer @ 2002-02-04 12:59 UTC (permalink / raw)
  To: ezannoni; +Cc: ac131313, aoliva, gdb

-mminimal-toc is only available with gcc, so we might loose again, if someone
tries to build GDB with the native compiler.  It might be worthwile to add
-mminimal-toc if we are using gcc though, for performance reasons.

I have not been suggesting to revert the patch, but I was thinking along the
lines of (completely untested):

            # Do this only for native AIX builds

            # The GNU linker does not understand the -bbigtoc switch, which the
	    # native linker needs.
            hold_ldflags=$LDFLAGS
            AC_MSG_CHECKING(for the ld -bbigtoc flag)
            LDFLAGS="${LDFLAGS} -Wl,-bbigtoc"
            AC_TRY_LINK(, [int i;], nativeld=yes, nativeld=no)
            LDFLAGS=$hold_ldflags
            AC_MSG_RESULT($nativeld)
            if test $nativeld = yes; then
               CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-bbigtoc"
            fi

in gdb/configure.in, adapted from a similar Solaris test, which should work
for all compiler/linker combinations.

> Andrew Cagney writes:
>  > > On Feb  4, 2002, Andrew Cagney <ac131313@cygnus.com> wrote:
>  > > 
>  > > 
>  > >>> Perhaps we should hard-code the link option -bbigtoc for gdb to
>  > >>> link properly on AIX?
>  > > 
>  > > 
>  > >> That was the problem.  See gdb/294.
>  > >> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=294
>  > > 
>  > > 
>  > > Thanks for the pointer.  Would it be pointless then to post a patch
>  > > that detected which version of GCC is in use, and whether the linker
>  > > it uses accepts -bbigtoc?
>  > 
>  > 
>  > The oposite!  See Peter Schauer's comment - it would solve the problem.
>  > 
>  > Andrew
> 
> Sorry for the late reply, but there is another way to solve that
> problem which is to compile gdb passing the -mminimal-toc option to
> gcc. This should be uniformly OK independently of the linker used.
> 
> There are also these options available, but I haven't tried them.
> 
> -mfull-toc 
> -mno-fp-in-toc 
> -mno-sum-in-toc 
> 
> 
> FWIW, using the GNU linker and reverting that patch I get this
> error: ../../powerpc-ibm-aix4.3.3.0/bin/ld: invalid BFD target
> `bigtoc'collect2: ld returned 1 exit status
> 
> Elena

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-04 12:59         ` Peter.Schauer
@ 2002-02-24  5:10           ` Alexandre Oliva
  2002-03-01 15:51             ` Peter.Schauer
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2002-02-24  5:10 UTC (permalink / raw)
  To: Peter.Schauer; +Cc: ezannoni, ac131313, gdb

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

On Feb  4, 2002, "Peter.Schauer" <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE> wrote:

> -mminimal-toc is only available with gcc, so we might loose again, if someone
> tries to build GDB with the native compiler.

Besides, I'm not convinced the performance loss of -mminimal-toc would
be smaller than that of -bbigtoc, so I went with the latter for now.
Tested on AIX 4.1.  Ok to install?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-aix-bigtoc.patch --]
[-- Type: text/x-patch, Size: 1117 bytes --]

Index: gdb/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* configure.in (gdb_cv_bigtoc): Check for -bbigtoc on AIX.
	* configure: Rebuilt.

Index: gdb/configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.82
diff -u -p -r1.82 configure.in
--- gdb/configure.in 2002/02/24 04:31:13 1.82
+++ gdb/configure.in 2002/02/24 13:05:16
@@ -511,6 +511,23 @@ AC_MSG_RESULT($gdb_cv_scanf_has_long_dou
 
 AC_FUNC_MMAP
 
+case ${host_os} in
+aix*)
+  AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
+    SAVE_LDFLAGS=$LDFLAGS
+
+    case $GCC in
+    yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
+    *) gdb_cv_bigtoc=-bbigtoc ;;
+    esac
+
+    LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
+    AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
+  ])
+  CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
+  ;;
+esac
+
 dnl See if thread_db library is around for Solaris thread debugging.  Note that
 dnl we must explicitly test for version 1 of the library because version 0
 dnl (present on Solaris 2.4 or earlier) doesn't have the same API.

[-- Attachment #3: Type: text/plain, Size: 289 bytes --]


-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: GDB cvs won't build on AIX 4.1
  2002-02-24  5:10           ` Alexandre Oliva
@ 2002-03-01 15:51             ` Peter.Schauer
  0 siblings, 0 replies; 8+ messages in thread
From: Peter.Schauer @ 2002-03-01 15:51 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: ezannoni, kevinb, ac131313, gdb

I am no autoconf expert, but it looks ok to me.
It would be nice, if it could make it into the upcoming GDB release.

> --=-=-=
> 
> On Feb  4, 2002, "Peter.Schauer" <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE> wrote:
> 
> > -mminimal-toc is only available with gcc, so we might loose again, if someone
> > tries to build GDB with the native compiler.
> 
> Besides, I'm not convinced the performance loss of -mminimal-toc would
> be smaller than that of -bbigtoc, so I went with the latter for now.
> Tested on AIX 4.1.  Ok to install?
> 
> 
> --=-=-=
> Content-Type: text/x-patch
> Content-Disposition: inline; filename=gdb-aix-bigtoc.patch
> 
> Index: gdb/ChangeLog
> from  Alexandre Oliva  <aoliva@redhat.com>
> 
> 	* configure.in (gdb_cv_bigtoc): Check for -bbigtoc on AIX.
> 	* configure: Rebuilt.
> 
> Index: gdb/configure.in
> ===================================================================
> RCS file: /cvs/src/src/gdb/configure.in,v
> retrieving revision 1.82
> diff -u -p -r1.82 configure.in
> --- gdb/configure.in 2002/02/24 04:31:13 1.82
> +++ gdb/configure.in 2002/02/24 13:05:16
> @@ -511,6 +511,23 @@ AC_MSG_RESULT($gdb_cv_scanf_has_long_dou
>  
>  AC_FUNC_MMAP
>  
> +case ${host_os} in
> +aix*)
> +  AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
> +    SAVE_LDFLAGS=$LDFLAGS
> +
> +    case $GCC in
> +    yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
> +    *) gdb_cv_bigtoc=-bbigtoc ;;
> +    esac
> +
> +    LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
> +    AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
> +  ])
> +  CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
> +  ;;
> +esac
> +
>  dnl See if thread_db library is around for Solaris thread debugging.  Note that
>  dnl we must explicitly test for version 1 of the library because version 0
>  dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
> 
> --=-=-=
> 
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist                Professional serial bug killer
> 
> --=-=-=--
> 
> 


-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-03-01 23:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-02 18:45 GDB cvs won't build on AIX 4.1 Alexandre Oliva
2002-02-03 18:40 ` Andrew Cagney
2002-02-04  4:15   ` Alexandre Oliva
2002-02-04  8:06     ` Andrew Cagney
2002-02-04  9:47       ` Elena Zannoni
2002-02-04 12:59         ` Peter.Schauer
2002-02-24  5:10           ` Alexandre Oliva
2002-03-01 15:51             ` Peter.Schauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox