[vlc-devel] [PATCH] libvlc/core: Use a revision.h in build dir instead of .c file

Marvin Scholz epirat07 at gmail.com
Fri Jun 21 22:03:13 CEST 2019

On 21 Jun 2019, at 21:21, Rémi Denis-Courmont wrote:

> Le vendredi 21 juin 2019, 12:18:01 EEST Marvin Scholz a écrit :
>> I mainly need this change for meson and I do not want the
>> code to diverge between the meson branch and our current
>> buildsystem.
> I utterly fail to see how this relates to Meson TBH.

Hi, sorry I guess my explanation was a bit confusing.

> (...)
>> If the file is a .c file though, meson will compile + link
>> the file into both libraries. The problem with that is that
>> lib/core.c additionally includes the .c file, so now the
>> library would end up with the symbol twice, one time from the
>> linked revision.o, one time from the included revision.c,
>> which will fail to link.
> No it won't fail to link - unless you messed something else up.
> It's perfectly fine to have the same extern symbol in an underlying 
> library,

Yeah the issue is not the two libraries, thats completely fine.

> indeed even if it is statically linked. What's not fine is having the 
> same
> extern symbols in multiple objects of the *same* library/executable.

Yes thats exactly what I meant what happens with meson. Adding the 
revision.c to the libvlc sources (which I have to, for it to properly 
on it) and on top of that including it in lib/core.c will effectively 
cause the
symbol to be present twice in the libraries object files (revision.o and 
which will fail to link.

> And that's really down to linker requirements, has nothing to do with 
> the
> build system.

The issue is basically that I can not have a generated source file (.c) 
just as
dependency of a lib/exe without it getting built/linked into it. (At 
least not
With a header file this is a non-issue as it does not implicitly builds 

Maybe a different solution instead of renaming to .h could be to remove 
include in lib/core.c and instead add revision.c as source of libvlc in 
automake Makefile?

> -- 
> Rémi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list