From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: linux-media@vger.kernel.org, gjasny@googlemail.com
Subject: Re: [v4l-utils PATCH 1/1] Fix static linking of v4l2-compliance and v4l2-ctl
Date: Mon, 19 Sep 2016 16:21:30 +0300 [thread overview]
Message-ID: <57DFE65A.5040607@linux.intel.com> (raw)
In-Reply-To: <20160919082226.43cd1bc9@vento.lan>
Hi Mauro,
On 09/19/16 14:22, Mauro Carvalho Chehab wrote:
> Em Mon, 19 Sep 2016 13:50:25 +0300
> Sakari Ailus <sakari.ailus@linux.intel.com> escreveu:
>
>> v4l2-compliance and v4l2-ctl depend on librt and libpthread. The symbols
>> are found by the linker only if these libraries are specified after the
>> objects that depend on them.
>>
>> As LDFLAGS variable end up expanded on libtool command line before LDADD,
>> move the libraries to LDADD after local objects. -lpthread is added as on
>> some systems librt depends on libpthread. This is the case on Ubuntu 16.04
>> for instance.
>>
>> After this patch, creating a static build using the command
>>
>> LDFLAGS="--static -static" ./configure --disable-shared --enable-static
>
> It sounds weird to use LDFLAGS="--static -static" here, as the
> configure options are already asking for static.
>
> IMHO, the right way would be to change configure.ac to add those LDFLAGS
> when --disable-shared is used.
That's one option, but then shared libraries won't be built at all. I'm
not sure what would be the use cases for that, though: static linking
isn't very commonly needed except when you need to run the binaries
elsewhere (for whatever reason) where you don't have the libraries you
linked against available.
That's still a separate issue from what this patch fixes.
Ideally it should be possible to link the binaries statically while
still building shared libraries: both are built by default right now,
yet shared libraries are always used for linking unless you disable
shared libraries. Most of the time this makes sense but not always.
I'm sending a separate patch to fix that by adding
--with-static-binaries option.
--
Sakari Ailus
sakari.ailus@linux.intel.com
next prev parent reply other threads:[~2016-09-19 13:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 10:50 [v4l-utils PATCH 1/1] Fix static linking of v4l2-compliance and v4l2-ctl Sakari Ailus
2016-09-19 11:22 ` Mauro Carvalho Chehab
2016-09-19 13:21 ` Sakari Ailus [this message]
2016-09-19 14:19 ` Mauro Carvalho Chehab
2016-09-26 15:46 ` Sakari Ailus
2016-09-26 16:59 ` Mauro Carvalho Chehab
2016-09-26 21:40 ` Sakari Ailus
2016-09-27 16:04 ` Mauro Carvalho Chehab
2016-09-27 17:35 ` Mauro Carvalho Chehab
2016-09-19 13:22 ` [v4l-utils PATCH 2/2] Add --with-static-binaries option to link binaries statically Sakari Ailus
2016-09-19 14:21 ` Mauro Carvalho Chehab
2016-09-19 14:34 ` Sakari Ailus
2016-09-26 17:41 ` Gregor Jasny
2016-09-26 18:02 ` Mauro Carvalho Chehab
2018-02-22 9:02 ` Sakari Ailus
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=57DFE65A.5040607@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=gjasny@googlemail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@s-opensource.com \
/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 NNTP newsgroup(s).