public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Extra import symbol in debug build
@ 2023-02-16 15:23 i.nixman
  2023-02-16 15:29 ` Jonathan Wakely
  0 siblings, 1 reply; 14+ messages in thread
From: i.nixman @ 2023-02-16 15:23 UTC (permalink / raw)
  To: Gcc Help

hello,


I can successfully build the same C++ code using GCC-8.3.1 for Debug (-g 
-O0) and Release (-g -O2) build.
I can successfully debug the Release-executable on a remote host, but I 
can't debug the Debug-executable on a remote host, because the 
Debug-executable imports an extra symbol 
_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which doesn't 
exist.

but I don't want to debug libstdc++, so I think I shouldn't install 
additional debug version of libstdc++.

it looks like a bug, or am I wrong?

another my question is, what should I do to get rid of that extra symbol 
in Debug build?




best!

ps
I can't update GCC nor libstdc++.

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

* Re: Extra import symbol in debug build
  2023-02-16 15:23 Extra import symbol in debug build i.nixman
@ 2023-02-16 15:29 ` Jonathan Wakely
  2023-02-16 18:39   ` i.nixman
  0 siblings, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-02-16 15:29 UTC (permalink / raw)
  To: i.nixman; +Cc: Gcc Help

On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> hello,
>
>
> I can successfully build the same C++ code using GCC-8.3.1 for Debug (-g
> -O0) and Release (-g -O2) build.
> I can successfully debug the Release-executable on a remote host, but I
> can't debug the Debug-executable on a remote host, because the
> Debug-executable imports an extra symbol
> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which doesn't
> exist.

It should exist, it has been there since GCC 5.


>
> but I don't want to debug libstdc++, so I think I shouldn't install
> additional debug version of libstdc++.
>
> it looks like a bug, or am I wrong?
>
> another my question is, what should I do to get rid of that extra symbol
> in Debug build?
>
>
>
>
> best!
>
> ps
> I can't update GCC nor libstdc++.

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

* Re: Extra import symbol in debug build
  2023-02-16 15:29 ` Jonathan Wakely
@ 2023-02-16 18:39   ` i.nixman
  2023-02-16 20:08     ` Jonathan Wakely
  0 siblings, 1 reply; 14+ messages in thread
From: i.nixman @ 2023-02-16 18:39 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Gcc Help

On 2023-02-16 15:29, Jonathan Wakely wrote:
> On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
>> 
>> hello,
>> 
>> 
>> I can successfully build the same C++ code using GCC-8.3.1 for Debug 
>> (-g
>> -O0) and Release (-g -O2) build.
>> I can successfully debug the Release-executable on a remote host, but 
>> I
>> can't debug the Debug-executable on a remote host, because the
>> Debug-executable imports an extra symbol
>> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which 
>> doesn't
>> exist.
> 
> It should exist, it has been there since GCC

hmm...

I just checked the two binaries using this cmd:

> readelf -sW executable | grep 
> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv

it shows nothing for release build, and shows this for debug build:

>     54: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND 
> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> 199898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND 
> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv


what should I do next to understand the reason?
moreover, im unsure I understand the reason correctly...



best!


> 
>> 
>> but I don't want to debug libstdc++, so I think I shouldn't install
>> additional debug version of libstdc++.
>> 
>> it looks like a bug, or am I wrong?
>> 
>> another my question is, what should I do to get rid of that extra 
>> symbol
>> in Debug build?
>> 
>> 
>> 
>> 
>> best!
>> 
>> ps
>> I can't update GCC nor libstdc++.

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

* Re: Extra import symbol in debug build
  2023-02-16 18:39   ` i.nixman
@ 2023-02-16 20:08     ` Jonathan Wakely
  2023-02-17  8:51       ` i.nixman
  0 siblings, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-02-16 20:08 UTC (permalink / raw)
  To: niXman; +Cc: Gcc Help

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

On Thu, 16 Feb 2023, 18:39 , <i.nixman@autistici.org> wrote:

> On 2023-02-16 15:29, Jonathan Wakely wrote:
> > On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
> > <gcc-help@gcc.gnu.org> wrote:
> >>
> >> hello,
> >>
> >>
> >> I can successfully build the same C++ code using GCC-8.3.1 for Debug
> >> (-g
> >> -O0) and Release (-g -O2) build.
> >> I can successfully debug the Release-executable on a remote host, but
> >> I
> >> can't debug the Debug-executable on a remote host, because the
> >> Debug-executable imports an extra symbol
> >> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which
> >> doesn't
> >> exist.
> >
> > It should exist, it has been there since GCC
>
> hmm...
>
> I just checked the two binaries using this cmd:
>
> > readelf -sW executable | grep
> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>
> it shows nothing for release build, and shows this for debug build:
>
> >     54: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> > 199898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>


This only shows that the function is inlined in the optimized build, and
not in the debug build, so the debug one has an unresolved reference to a
symbol defined in the libstdc++ dynamic library. This is completely normal.


>
> what should I do next to understand the reason?
>

Check which libstdc++.so.6 is being used by the executable when you're
debugging it and make sure it's the one from the GCC build you're compiling
with.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic

Since the problem happens when debugging on a remote host, you need to make
sure you have the right libstdc++.so.6 when doing that debugging.


moreover, im unsure I understand the reason correctly...
>
>
>
> best!
>
>
> >
> >>
> >> but I don't want to debug libstdc++, so I think I shouldn't install
> >> additional debug version of libstdc++.
> >>
> >> it looks like a bug, or am I wrong?
> >>
> >> another my question is, what should I do to get rid of that extra
> >> symbol
> >> in Debug build?
> >>
> >>
> >>
> >>
> >> best!
> >>
> >> ps
> >> I can't update GCC nor libstdc++.
>

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

* Re: Extra import symbol in debug build
  2023-02-16 20:08     ` Jonathan Wakely
@ 2023-02-17  8:51       ` i.nixman
  2023-02-17 10:23         ` Xi Ruoyao
  2023-02-17 11:26         ` Jonathan Wakely
  0 siblings, 2 replies; 14+ messages in thread
From: i.nixman @ 2023-02-17  8:51 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Gcc Help

On 2023-02-16 20:08, Jonathan Wakely wrote:
> On Thu, 16 Feb 2023, 18:39 , <i.nixman@autistici.org> wrote:
> 
>> On 2023-02-16 15:29, Jonathan Wakely wrote:
>> > On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
>> > <gcc-help@gcc.gnu.org> wrote:
>> >>
>> >> hello,
>> >>
>> >>
>> >> I can successfully build the same C++ code using GCC-8.3.1 for Debug
>> >> (-g
>> >> -O0) and Release (-g -O2) build.
>> >> I can successfully debug the Release-executable on a remote host, but
>> >> I
>> >> can't debug the Debug-executable on a remote host, because the
>> >> Debug-executable imports an extra symbol
>> >> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which
>> >> doesn't
>> >> exist.
>> >
>> > It should exist, it has been there since GCC
>> 
>> hmm...
>> 
>> I just checked the two binaries using this cmd:
>> 
>> > readelf -sW executable | grep
>> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>> 
>> it shows nothing for release build, and shows this for debug build:
>> 
>> >     54: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
>> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>> > 199898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
>> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>> 
> 
> 
> This only shows that the function is inlined in the optimized build, 
> and
> not in the debug build, so the debug one has an unresolved reference to 
> a
> symbol defined in the libstdc++ dynamic library. This is completely 
> normal.
> 

then I have two questions:

1. will the problem be solved by "pushing" a debug version of libstdc++ 
on the remote machine?

2. how can I define this symbol in the project code for debug build to 
avoid having to use the debug version of libstdc++?
something like this? :
namespace std {
    template basic_ios<char, char_traits<char> >::operator bool() const;
}




best!

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

* Re: Extra import symbol in debug build
  2023-02-17  8:51       ` i.nixman
@ 2023-02-17 10:23         ` Xi Ruoyao
  2023-02-17 11:31           ` i.nixman
  2023-02-17 11:26         ` Jonathan Wakely
  1 sibling, 1 reply; 14+ messages in thread
From: Xi Ruoyao @ 2023-02-17 10:23 UTC (permalink / raw)
  To: i.nixman, Jonathan Wakely; +Cc: Gcc Help

On Fri, 2023-02-17 at 08:51 +0000, i.nixman--- via Gcc-help wrote:

> 1. will the problem be solved by "pushing" a debug version of libstdc++ 
> on the remote machine?

Yes if you set LD_LIBRARY_PATH or something correctly.  But
-static-libstdc++ is easier.

> 2. how can I define this symbol in the project code for debug build to
> avoid having to use the debug version of libstdc++?
> something like this? :
> namespace std {
>     template basic_ios<char, char_traits<char> >::operator bool() const;
> }

You can't.  Defining anything in std namespace is undefined behavior.


-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

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

* Re: Extra import symbol in debug build
  2023-02-17  8:51       ` i.nixman
  2023-02-17 10:23         ` Xi Ruoyao
@ 2023-02-17 11:26         ` Jonathan Wakely
  2023-02-17 11:32           ` i.nixman
  1 sibling, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-02-17 11:26 UTC (permalink / raw)
  To: niXman; +Cc: Gcc Help

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

On Fri, 17 Feb 2023, 08:51 , <i.nixman@autistici.org> wrote:

> On 2023-02-16 20:08, Jonathan Wakely wrote:
> > On Thu, 16 Feb 2023, 18:39 , <i.nixman@autistici.org> wrote:
> >
> >> On 2023-02-16 15:29, Jonathan Wakely wrote:
> >> > On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
> >> > <gcc-help@gcc.gnu.org> wrote:
> >> >>
> >> >> hello,
> >> >>
> >> >>
> >> >> I can successfully build the same C++ code using GCC-8.3.1 for Debug
> >> >> (-g
> >> >> -O0) and Release (-g -O2) build.
> >> >> I can successfully debug the Release-executable on a remote host, but
> >> >> I
> >> >> can't debug the Debug-executable on a remote host, because the
> >> >> Debug-executable imports an extra symbol
> >> >> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which
> >> >> doesn't
> >> >> exist.
> >> >
> >> > It should exist, it has been there since GCC
> >>
> >> hmm...
> >>
> >> I just checked the two binaries using this cmd:
> >>
> >> > readelf -sW executable | grep
> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> >>
> >> it shows nothing for release build, and shows this for debug build:
> >>
> >> >     54: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> >> > 199898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> >>
> >
> >
> > This only shows that the function is inlined in the optimized build,
> > and
> > not in the debug build, so the debug one has an unresolved reference to
> > a
> > symbol defined in the libstdc++ dynamic library. This is completely
> > normal.
> >
>
> then I have two questions:
>
> 1. will the problem be solved by "pushing" a debug version of libstdc++
> on the remote machine?
>

You don't need a debug version, the symbol is present in all builds of
libstdc++.



> 2. how can I define this symbol in the project code for debug build to
> avoid having to use the debug version of libstdc++?
> something like this? :
> namespace std {
>     template basic_ios<char, char_traits<char> >::operator bool() const;
> }
>
>
>
>
> best!
>

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

* Re: Extra import symbol in debug build
  2023-02-17 10:23         ` Xi Ruoyao
@ 2023-02-17 11:31           ` i.nixman
  0 siblings, 0 replies; 14+ messages in thread
From: i.nixman @ 2023-02-17 11:31 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: Gcc Help

On 2023-02-17 10:23, Xi Ruoyao wrote:
> On Fri, 2023-02-17 at 08:51 +0000, i.nixman--- via Gcc-help wrote:
> 
>> 1. will the problem be solved by "pushing" a debug version of 
>> libstdc++
>> on the remote machine?
> 
> Yes if you set LD_LIBRARY_PATH or something correctly.  But
> -static-libstdc++ is easier.

will try this way.


> You can't.  Defining anything in std namespace is undefined behavior.

ah, right...
thanks!

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

* Re: Extra import symbol in debug build
  2023-02-17 11:26         ` Jonathan Wakely
@ 2023-02-17 11:32           ` i.nixman
  2023-02-17 12:06             ` Jonathan Wakely
  0 siblings, 1 reply; 14+ messages in thread
From: i.nixman @ 2023-02-17 11:32 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Gcc Help

On 2023-02-17 11:26, Jonathan Wakely wrote:
> On Fri, 17 Feb 2023, 08:51 , <i.nixman@autistici.org> wrote:
> 
>> On 2023-02-16 20:08, Jonathan Wakely wrote:
>> > On Thu, 16 Feb 2023, 18:39 , <i.nixman@autistici.org> wrote:
>> >
>> >> On 2023-02-16 15:29, Jonathan Wakely wrote:
>> >> > On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
>> >> > <gcc-help@gcc.gnu.org> wrote:
>> >> >>
>> >> >> hello,
>> >> >>
>> >> >>
>> >> >> I can successfully build the same C++ code using GCC-8.3.1 for Debug
>> >> >> (-g
>> >> >> -O0) and Release (-g -O2) build.
>> >> >> I can successfully debug the Release-executable on a remote host, but
>> >> >> I
>> >> >> can't debug the Debug-executable on a remote host, because the
>> >> >> Debug-executable imports an extra symbol
>> >> >> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which
>> >> >> doesn't
>> >> >> exist.
>> >> >
>> >> > It should exist, it has been there since GCC
>> >>
>> >> hmm...
>> >>
>> >> I just checked the two binaries using this cmd:
>> >>
>> >> > readelf -sW executable | grep
>> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>> >>
>> >> it shows nothing for release build, and shows this for debug build:
>> >>
>> >> >     54: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
>> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>> >> > 199898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
>> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>> >>
>> >
>> >
>> > This only shows that the function is inlined in the optimized build,
>> > and
>> > not in the debug build, so the debug one has an unresolved reference to
>> > a
>> > symbol defined in the libstdc++ dynamic library. This is completely
>> > normal.
>> >
>> 
>> then I have two questions:
>> 
>> 1. will the problem be solved by "pushing" a debug version of 
>> libstdc++
>> on the remote machine?
>> 
> 
> You don't need a debug version, the symbol is present in all builds of
> libstdc++.

hmm..
but I can't confirm that using this cmd:
readelf -sW /lib64/libstdc++.so.6 | grep 
_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv


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

* Re: Extra import symbol in debug build
  2023-02-17 11:32           ` i.nixman
@ 2023-02-17 12:06             ` Jonathan Wakely
  2023-02-17 14:59               ` i.nixman
  0 siblings, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-02-17 12:06 UTC (permalink / raw)
  To: niXman; +Cc: Gcc Help

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

On Fri, 17 Feb 2023, 11:32 , <i.nixman@autistici.org> wrote:

> On 2023-02-17 11:26, Jonathan Wakely wrote:
> > On Fri, 17 Feb 2023, 08:51 , <i.nixman@autistici.org> wrote:
> >
> >> On 2023-02-16 20:08, Jonathan Wakely wrote:
> >> > On Thu, 16 Feb 2023, 18:39 , <i.nixman@autistici.org> wrote:
> >> >
> >> >> On 2023-02-16 15:29, Jonathan Wakely wrote:
> >> >> > On Thu, 16 Feb 2023 at 15:25, i.nixman--- via Gcc-help
> >> >> > <gcc-help@gcc.gnu.org> wrote:
> >> >> >>
> >> >> >> hello,
> >> >> >>
> >> >> >>
> >> >> >> I can successfully build the same C++ code using GCC-8.3.1 for
> Debug
> >> >> >> (-g
> >> >> >> -O0) and Release (-g -O2) build.
> >> >> >> I can successfully debug the Release-executable on a remote host,
> but
> >> >> >> I
> >> >> >> can't debug the Debug-executable on a remote host, because the
> >> >> >> Debug-executable imports an extra symbol
> >> >> >> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv from libstdc++ which
> >> >> >> doesn't
> >> >> >> exist.
> >> >> >
> >> >> > It should exist, it has been there since GCC
> >> >>
> >> >> hmm...
> >> >>
> >> >> I just checked the two binaries using this cmd:
> >> >>
> >> >> > readelf -sW executable | grep
> >> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> >> >>
> >> >> it shows nothing for release build, and shows this for debug build:
> >> >>
> >> >> >     54: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
> >> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> >> >> > 199898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
> >> >> > _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
> >> >>
> >> >
> >> >
> >> > This only shows that the function is inlined in the optimized build,
> >> > and
> >> > not in the debug build, so the debug one has an unresolved reference
> to
> >> > a
> >> > symbol defined in the libstdc++ dynamic library. This is completely
> >> > normal.
> >> >
> >>
> >> then I have two questions:
> >>
> >> 1. will the problem be solved by "pushing" a debug version of
> >> libstdc++
> >> on the remote machine?
> >>
> >
> > You don't need a debug version, the symbol is present in all builds of
> > libstdc++.
>
> hmm..
> but I can't confirm that using this cmd:
> readelf -sW /lib64/libstdc++.so.6 | grep
> _ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
>

That suggests either you built it wrong, or that library is from an older
GCC, not the one you're compiling with.

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

* Re: Extra import symbol in debug build
  2023-02-17 12:06             ` Jonathan Wakely
@ 2023-02-17 14:59               ` i.nixman
  2023-02-17 15:18                 ` i.nixman
  2023-02-17 15:30                 ` Jonathan Wakely
  0 siblings, 2 replies; 14+ messages in thread
From: i.nixman @ 2023-02-17 14:59 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Gcc Help

On 2023-02-17 12:06, Jonathan Wakely wrote:

> 
> That suggests either you built it wrong, or that library is from an 
> older
> GCC, not the one you're compiling with.

thank you Jonathan!

will check this now.


I have one more question.

just now I rebuild the executable using `-static-libstdc++`, and I can 
confirm I can see that option in the linker cmdline, but the executable 
still depends on libstdc++.so.
how can this be?




best!

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

* Re: Extra import symbol in debug build
  2023-02-17 14:59               ` i.nixman
@ 2023-02-17 15:18                 ` i.nixman
  2023-02-17 15:30                 ` Jonathan Wakely
  1 sibling, 0 replies; 14+ messages in thread
From: i.nixman @ 2023-02-17 15:18 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Gcc Help

On 2023-02-17 14:59, i.nixman--- via Gcc-help wrote:
> On 2023-02-17 12:06, Jonathan Wakely wrote:
> 
>> 
>> That suggests either you built it wrong, or that library is from an 
>> older
>> GCC, not the one you're compiling with.
> 
> thank you Jonathan!
> 
> will check this now.
> 
> 
> I have one more question.
> 
> just now I rebuild the executable using `-static-libstdc++`, and I can
> confirm I can see that option in the linker cmdline, but the
> executable still depends on libstdc++.so.
> how can this be?

and yes, now it looks like WEAK symbol:

   3515: 0000000000d80940     8 FUNC    WEAK   DEFAULT   13 
_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
200740: 0000000000d80940     8 FUNC    WEAK   DEFAULT   13 
_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv


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

* Re: Extra import symbol in debug build
  2023-02-17 14:59               ` i.nixman
  2023-02-17 15:18                 ` i.nixman
@ 2023-02-17 15:30                 ` Jonathan Wakely
  2023-02-17 15:35                   ` i.nixman
  1 sibling, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-02-17 15:30 UTC (permalink / raw)
  To: niXman; +Cc: Gcc Help

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

On Fri, 17 Feb 2023, 14:59 , <i.nixman@autistici.org> wrote:

> On 2023-02-17 12:06, Jonathan Wakely wrote:
>
> >
> > That suggests either you built it wrong, or that library is from an
> > older
> > GCC, not the one you're compiling with.
>
> thank you Jonathan!
>
> will check this now.
>
>
> I have one more question.
>
> just now I rebuild the executable using `-static-libstdc++`, and I can
> confirm I can see that option in the linker cmdline, but the executable
> still depends on libstdc++.so.
> how can this be?
>

If you're linking to some shared library that depends on libstdc++.so then
your executable will depend on it.

I think this thread has gone in too long without any details of what
commands you're actually using to compile and link. There's only so much
people can tell you by guessing.

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

* Re: Extra import symbol in debug build
  2023-02-17 15:30                 ` Jonathan Wakely
@ 2023-02-17 15:35                   ` i.nixman
  0 siblings, 0 replies; 14+ messages in thread
From: i.nixman @ 2023-02-17 15:35 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Gcc Help

On 2023-02-17 15:30, Jonathan Wakely wrote:

> If you're linking to some shared library that depends on libstdc++.so 
> then
> your executable will depend on it.

got it, thank you!

> I think this thread has gone in too long without any details of what
> commands you're actually using to compile and link. There's only so 
> much
> people can tell you by guessing.

you'r right!
closed.

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

end of thread, other threads:[~2023-02-17 15:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 15:23 Extra import symbol in debug build i.nixman
2023-02-16 15:29 ` Jonathan Wakely
2023-02-16 18:39   ` i.nixman
2023-02-16 20:08     ` Jonathan Wakely
2023-02-17  8:51       ` i.nixman
2023-02-17 10:23         ` Xi Ruoyao
2023-02-17 11:31           ` i.nixman
2023-02-17 11:26         ` Jonathan Wakely
2023-02-17 11:32           ` i.nixman
2023-02-17 12:06             ` Jonathan Wakely
2023-02-17 14:59               ` i.nixman
2023-02-17 15:18                 ` i.nixman
2023-02-17 15:30                 ` Jonathan Wakely
2023-02-17 15:35                   ` i.nixman

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).