public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/30878] New: Alpine Linux: libinproctrace: undefined reference to libintl_gettext
@ 2023-09-22 14:11 jan at jankratochvil dot net
  2023-09-25  2:50 ` [Bug build/30878] " lienze at sourceware dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jan at jankratochvil dot net @ 2023-09-22 14:11 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30878
           Summary: Alpine Linux: libinproctrace: undefined reference to
                    libintl_gettext
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: jan at jankratochvil dot net
  Target Milestone: ---

e7bb5090cb094ab9d9d13c1852a7cd7e65128b66 = 2023-09-19

$ cat /etc/alpine-release 
3.17.5
$ ./configure;make
...
make[2]: Entering directory '/home/azul/azul/gdb-clean/gdbserver'
  CXXLD  libinproctrace.so
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
ax-ipa.o: in function `ax_printf(unsigned long, unsigned long, char const*,
int, unsigned long*)':
ax.cc:(.text+0x291): undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
ax.cc:(.text+0x5a6): undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
ax-ipa.o: in function `gdb_eval_agent_expr(eval_agent_expr_context*,
agent_expr*, unsigned long*)':
ax.cc:(.text+0x1a8b): undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
gdbsupport/common-utils-ipa.o: in function `xstrvprintf(char const*,
__va_list_tag*)':
common-utils.cc:(.text+0x157): undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
gdbsupport/common-utils-ipa.o: in function `xsnprintf(char*, unsigned long,
char const*, ...)':
common-utils.cc:(.text+0x282): undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
gdbsupport/common-utils-ipa.o:common-utils.cc:(.text+0xe81): more undefined
references to `libintl_gettext' follow
collect2: error: ld returned 1 exit status

--disable-inprocess-agent will workaround it

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

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

* [Bug build/30878] Alpine Linux: libinproctrace: undefined reference to libintl_gettext
  2023-09-22 14:11 [Bug build/30878] New: Alpine Linux: libinproctrace: undefined reference to libintl_gettext jan at jankratochvil dot net
@ 2023-09-25  2:50 ` lienze at sourceware dot org
  2023-09-25  3:05 ` jan at jankratochvil dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: lienze at sourceware dot org @ 2023-09-25  2:50 UTC (permalink / raw)
  To: gdb-prs

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

Enze Li <lienze at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lienze at sourceware dot org

--- Comment #1 from Enze Li <lienze at sourceware dot org> ---
(In reply to Jan Kratochvil from comment #0)
> e7bb5090cb094ab9d9d13c1852a7cd7e65128b66 = 2023-09-19
> 
> $ cat /etc/alpine-release 
> 3.17.5
> $ ./configure;make
> ...
> make[2]: Entering directory '/home/azul/azul/gdb-clean/gdbserver'
>   CXXLD  libinproctrace.so
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-
> musl/bin/ld: ax-ipa.o: in function `ax_printf(unsigned long, unsigned long,
> char const*, int, unsigned long*)':
> ax.cc:(.text+0x291): undefined reference to `libintl_gettext'
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-
> musl/bin/ld: ax.cc:(.text+0x5a6): undefined reference to `libintl_gettext'
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-
> musl/bin/ld: ax-ipa.o: in function
> `gdb_eval_agent_expr(eval_agent_expr_context*, agent_expr*, unsigned long*)':
> ax.cc:(.text+0x1a8b): undefined reference to `libintl_gettext'
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-
> musl/bin/ld: gdbsupport/common-utils-ipa.o: in function `xstrvprintf(char
> const*, __va_list_tag*)':
> common-utils.cc:(.text+0x157): undefined reference to `libintl_gettext'
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-
> musl/bin/ld: gdbsupport/common-utils-ipa.o: in function `xsnprintf(char*,
> unsigned long, char const*, ...)':
> common-utils.cc:(.text+0x282): undefined reference to `libintl_gettext'
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-
> musl/bin/ld: gdbsupport/common-utils-ipa.o:common-utils.cc:(.text+0xe81):
> more undefined references to `libintl_gettext' follow
> collect2: error: ld returned 1 exit status
> 
> --disable-inprocess-agent will workaround it

It seems to me that the Native Language Support is not present by default on
Alpine Linux.  Without NLS support, you may get error messages like that when
building.

BTW, I use --disable-nls to workaround it.

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

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

* [Bug build/30878] Alpine Linux: libinproctrace: undefined reference to libintl_gettext
  2023-09-22 14:11 [Bug build/30878] New: Alpine Linux: libinproctrace: undefined reference to libintl_gettext 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
  3 siblings, 0 replies; 5+ messages in thread
From: jan at jankratochvil dot net @ 2023-09-25  3:05 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan at jankratochvil dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan at jankratochvil dot net

--- Comment #2 from Jan Kratochvil <jan at jankratochvil dot net> ---
If there is anything missing in the OS and there is an option to disable it the
configure script should detect such missing OS feature and disable it on its
own. I did not enforce --enable-nls, in such case it should correctly fail.

I see now binutils/README does describe it:

Native Language Support
=======================

By default Native Language Support will be enabled for binutils.  On
some systems however this support is not present and can lead to error
messages such as "undefined reference to `libintl_gettext'" when
building there tools.  If that happens the NLS support can be disabled
by adding the --disable-nls switch to the configure line like this:

        ../binutils-XXX/configure --disable-nls

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

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

* [Bug build/30878] Alpine Linux: libinproctrace: undefined reference to libintl_gettext
  2023-09-22 14:11 [Bug build/30878] New: Alpine Linux: libinproctrace: undefined reference to libintl_gettext 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
  3 siblings, 0 replies; 5+ messages in thread
From: sam at gentoo dot org @ 2023-09-26  0:27 UTC (permalink / raw)
  To: gdb-prs

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

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

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

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

* [Bug build/30878] Alpine Linux: libinproctrace: undefined reference to libintl_gettext
  2023-09-22 14:11 [Bug build/30878] New: Alpine Linux: libinproctrace: undefined reference to libintl_gettext jan at jankratochvil dot net
                   ` (2 preceding siblings ...)
  2023-09-26  0:27 ` sam at gentoo dot org
@ 2023-11-26  9:42 ` larserik at netix dot se
  3 siblings, 0 replies; 5+ messages in thread
From: larserik at netix dot se @ 2023-11-26  9:42 UTC (permalink / raw)
  To: gdb-prs

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.

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

end of thread, other threads:[~2023-11-26  9:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22 14:11 [Bug build/30878] New: Alpine Linux: libinproctrace: undefined reference to libintl_gettext 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 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).