public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: "Jose E. Marchesi via Gdb-patches" <gdb-patches@sourceware.org>
Cc: Simon Marchi <simark@simark.ca>,
	indu.bhagat@oracle.com, elena.zannoni@oracle.com
Subject: Re: [Mike Frysinger] Re: [PATCH, V3 10/15] gdb: sim: buildsystem changes to accommodate libsframe
Date: Fri, 04 Nov 2022 16:36:02 +0100	[thread overview]
Message-ID: <877d0apw9p.fsf@oracle.com> (raw)
In-Reply-To: <87eduipx0f.fsf@oracle.com> (Jose E. Marchesi via Gdb-patches's message of "Fri, 04 Nov 2022 16:20:00 +0100")


>>> But first things first: how do you people feel about libtoolizing the
>>> rules in gdb/Makefile.in so GDB can handle the in-tree libtool libraries
>>> in a more graceful way?
>> What does "libtoolizing the rules" mean, in practice?
>
> I would say to be able to refer to the libtool libraries (.la) directly
> when linking, and let libtool do the magic of picking up the
> corresponding archive or shared object.
>
> This means that instead of the linker, you have to invoke something
> like:
>
>   libtool --mode=link foo.o bar.o baz.la ...

It may be as easy as the following, plus start referring to libraries
like ../libbacktrace/libbacktrace.la in CLIBS, plus the bits in
configure.ac to search and SUBST LIBTOOL, etc.

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index c528ee5aa80..d554e62b698 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -146,7 +146,7 @@ MAKEHTMLFLAGS =
 # Set this up with gcc if you have gnu ld and the loader will print out
 # line numbers for undefined references.
 #CC_LD = g++ -static
-CC_LD = $(CXX) $(CXX_DIALECT)
+CC_LD = $(LIBTOOL) --tag=CC --mode=link $(CXX) $(CXX_DIALECT)
 
 # Where is our "include" directory?  Typically $(srcdir)/../include.
 # This is essentially the header file directory for the library

> I have to confess I have never autotoolized a project that does not use
> Automake.  Automake takes care of generating the right rules for linking
> when you specify a .la library in either LIBADD or LDADD.
>
> From the libtool manual:
>
>   If you're not using Automake, and you don't know how to incorporate
>   libtool into your package you need to do one of the following:
>
>   1. Download the latest Automake distribution from your nearest GNU
>      mirror, install it, and start using it.
>
>   2. Learn how to write 'Makefile' rules by hand.  They're sometimes
>      complex, but if you're clever enough to write rules for compiling
>      your old libraries, then you should be able to figure out new rules
>      for libtool libraries (hint: examine the 'Makefile.in' in the
>      'tests/demo' subdirectory of the libtool distribution... note
>      especially that it was automatically generated from the
>      'Makefile.am' by Automake).

  reply	other threads:[~2022-11-04 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 12:02 Jose E. Marchesi
2022-11-04 13:59 ` Elena Zannoni
2022-11-04 14:46 ` Simon Marchi
2022-11-04 15:20   ` Jose E. Marchesi
2022-11-04 15:36     ` Jose E. Marchesi [this message]
2022-11-04 16:04       ` Simon Marchi
2022-11-05  8:25         ` Mike Frysinger

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=877d0apw9p.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=elena.zannoni@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=indu.bhagat@oracle.com \
    --cc=simark@simark.ca \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).