public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "larserik at netix dot se" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug build/30878] Alpine Linux: libinproctrace: undefined reference to libintl_gettext
Date: Sun, 26 Nov 2023 09:42:10 +0000	[thread overview]
Message-ID: <bug-30878-4717-9jbbzByhzy@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30878-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30878

Lars-Erik Wessman <larserik at netix dot se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |larserik at netix dot se

--- Comment #3 from Lars-Erik Wessman <larserik at netix dot se> ---
I also had this problem and tried to add intl lib LDFLAGS
LDFLAGS="-lintl" ./configure

But that did not work because in gdbserver/Makefile.in target $(IPA_LIB) the
$(INTERNAL_LDFLAGS) is before the "-o"

g++ docs tells that libraries "must be listed after the object or source files
that contain calls to their functions"
https://www.cs.bu.edu/fac/gkollios/cs113/Usingg++.html

INTERNAL_LDFLAGS is defined as $(LDFLAGS)

IPA_LIB is set to libinproctrace.so

Suggested solution:
Move $(INTERNAL_LDFLAGS) so it comes after "-o $(IPA_LIB)" in
gdbserver/Makefile.in in target $(IPA_LIB)

Source
https://sourceware.org/git/?p=binutils-gdb.git;a=blob_plain;f=gdbserver/Makefile.in;hb=HEAD

IPA_LIB = libinproctrace.so

$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
        $(SILENCE) rm -f $(IPA_LIB)
        $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
                -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
                 $(CXXFLAGS) \
                -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2023-11-26  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 14:11 [Bug build/30878] New: " jan at jankratochvil dot net
2023-09-25  2:50 ` [Bug build/30878] " lienze at sourceware dot org
2023-09-25  3:05 ` jan at jankratochvil dot net
2023-09-26  0:27 ` sam at gentoo dot org
2023-11-26  9:42 ` larserik at netix dot se [this message]

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=bug-30878-4717-9jbbzByhzy@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).