Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2, 1/1] package/wireshark: fix static build with snappy
Date: Wed, 29 May 2019 08:53:35 +0200	[thread overview]
Message-ID: <20190529085335.35bcbc35@windsurf.home> (raw)
In-Reply-To: <19f31deb-ea26-23aa-e2f7-eca629875ab2@mind.be>

Hello,

On Tue, 28 May 2019 23:04:28 +0200
Arnout Vandecappelle <arnout@mind.be> wrote:

> >> Is this really the right thing to do? Ideally a program written in C
> >> should not have to know that a library it is using is written in C++.  
> 
>  Hm, good point... Snappy provides a C wrapper, so there should indeed not be a
> need for the client to use the C++ linker. Of course, there also shouldn't be a
> need for the client to link with libstdc++ :-).

There is no need to link with libstdc++ when dynamic linking is used,
which to me is another indication that using the C++ linker is not the
right approach. Adding -lstdc++ is only necessary in static linking
configuration, for the usual reason that libA -> libB -> libC in static
linking scenarios requires passing -lC when linking libA.

> >> and there's a few other examples in the tree. To be honest, I don't
> >> know what is the most correct solution, I'm just trying to make
> >> sure we solve a given problem in the same way everywhere.  
> 
>  In most other cases we don't do any patching but we pass it through
> LIBS or similar. I don't think that that's possible with CMake.
> 
>  For ICU, we patch the .pc file, which is the proper thing to do, but
> Snappy doesn't have a .pc file.

Yes, but to me that's another indication that the right thing to do is
to pass -lstdc++: if the packages were better, they would be using .pc
files, and we would be able to specify -lstdc++ in their Libs.private.
Once again, it shows that using the C++ linker is (to me) not the right
approach.

> > I don't know either. You can apply the first or the second version
> > of this patch.  
> 
>  I reset its state to New. Now Thomas can decide :-)

For the reasons stated above, I think I prefer v1.

>  Maybe just send both versions upstream, since you have them both
> now. Then they can choose which one they like better.

The most correct solution for upstream would be for snappy to provide
a .pc file, and for wireshark to use it.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-05-29  6:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 20:32 [Buildroot] [PATCH v2, 1/1] package/wireshark: fix static build with snappy Fabrice Fontaine
2019-05-28 20:42 ` Thomas Petazzoni
2019-05-28 20:48   ` Fabrice Fontaine
2019-05-28 21:04     ` Arnout Vandecappelle
2019-05-29  6:53       ` Thomas Petazzoni [this message]
2019-05-29  8:49         ` Arnout Vandecappelle
2019-05-29  9:15           ` Fabrice Fontaine
2020-01-10 17:37 ` Yann E. MORIN

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=20190529085335.35bcbc35@windsurf.home \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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