[FFmpeg-devel] [PATCH v2 1/2] configure: don't force specific C++ standard library linking

Kacper Michajlow kasper93 at gmail.com
Fri Sep 8 21:59:57 EEST 2023


On Fri, 8 Sept 2023 at 20:46, Kieran Kunhya <kierank at obe.tv> wrote:
>
> On Fri, 8 Sept 2023 at 19:42, Kacper Michajlow <kasper93 at gmail.com> wrote:
>
> > On Fri, 8 Sept 2023 at 00:11, Kieran Kunhya <kierank at obe.tv> wrote:
> > >
> > > On Thu, 7 Sept 2023 at 22:39, Kacper Michajlow <kasper93 at gmail.com>
> > wrote:
> > >
> > > > On Thu, 7 Sept 2023 at 15:12, Derek Buitenhuis
> > > > <derek.buitenhuis at gmail.com> wrote:
> > > > >
> > > > > On 9/6/2023 6:31 PM, Kacper Michajlow wrote:
> > > > > > What would be a downside of preferring CXX always if it exists?
> > > > >
> > > > > FFmpeg runs in a multitude of environments with a multitude of
> > > > portability
> > > > > requirements. Needlessly linking a C++ runtime is not OK.
> > > >
> > > > This does not answer my question. Let me rephrase. Do we know the case
> > > > where using C++ compiler driver rather than C would degrade the
> > > > quality of the resulting build?
> > > >
> > >
> > > The machine that ffmpeg is being compiled on is not necessarily the one
> > > that ffmpeg is going to be run on.
> >
> > Not sure how this is relevant to the discussion?
> >
>
> > > > > What would be a downside of preferring CXX always if it exists?
>
> Because it forces a dependency on libstdc++ even if another machine does
> not have it.

On all "affected" platforms, configure already adds -Wl,--as-needed,
so the resulting library has exactly the same dependencies. Unless
something references symbols from stdlib, but then it would just not
link with clang anyway.

~ clang++ m.o -Wl,--as-needed && ldd a.out
linux-vdso.so.1 (0x00007ffeeb912000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f64050a7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f64052ad000)

~ clang m.o -Wl,--as-needed && ldd a.out
linux-vdso.so.1 (0x00007ffe1fb36000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5e7a3c2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5e7a5c8000)

- Kacper


More information about the ffmpeg-devel mailing list