Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] duplicate symbol '_dec_init' in: fftools/ffmpeg_dec.o
Date: Mon, 18 Mar 2024 09:32:51 +0200 (EET)
Message-ID: <b739a479-ce11-9cb3-6feb-92f2cc723c79@martin.st> (raw)
In-Reply-To: <4ADDB2F1-9DBD-454F-BAAA-E67418D7CE91@remlab.net>

On Sun, 17 Mar 2024, Rémi Denis-Courmont wrote:

> Obviously not. Imported libraries are only there to resolve missing 
> symbols.

Sure - but if resolving the missing symbols brings in those conflicting 
object files, there's not much to do about it. If the static library 
contains dec_init in a standalone object file that nothing references, 
then sure, it won't be an issue. But if linking libbr brings in the object 
file that defines that symbol, we can't get around it.

Example:

$ cat mylib.h
void mylib_func(void);
$ cat mylib.c
#include "mylib.h"
void mylib_func(void) { }
void dec_init(void) { }
$ cat main.c
#include "mylib.h"

void dec_init(void) { }

int main(int argc, char **argv) {
     mylib_func();
     return 0;
}
$ gcc -c mylib.c
$ ar rcs libmylib.a mylib.o
$ gcc -c main.c
$ gcc main.o -o main -L. -lmylib
/usr/bin/ld: ./libmylib.a(mylib.o): in function `dec_init':
mylib.c:(.text+0xb): multiple definition of `dec_init'; 
main.o:main.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status

I don't see what you propose that the FFmpeg build system should do 
differently to get around this issue, other than libbr not exposing global 
symbols outside of their namespace.

// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2024-03-18  7:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16  1:04 Helmut K. C. Tessarek
2024-03-16 14:07 ` Gnattu OC via ffmpeg-devel
2024-03-16 14:26   ` Christopher Degawa
2024-03-16 20:58     ` James Almer
2024-03-17 17:26       ` Rémi Denis-Courmont
2024-03-17 17:29         ` Andreas Rheinhardt
2024-03-17 17:37           ` Rémi Denis-Courmont
2024-03-17 21:13             ` Timo Rothenpieler
2024-03-18  0:32               ` Rémi Denis-Courmont
2024-03-18  1:21                 ` Timo Rothenpieler
2024-03-18  2:31                   ` Rémi Denis-Courmont
2024-03-18  7:32                     ` Martin Storsjö [this message]
2024-03-18 10:52                       ` Andreas Rheinhardt
2024-03-16 21:09     ` Helmut K. C. Tessarek
2024-03-17  8:05       ` Gnattu OC via ffmpeg-devel
2024-03-17 12:10         ` Timo Rothenpieler
2024-03-17 19:45           ` Helmut K. C. Tessarek
2024-03-16 20:55   ` Helmut K. C. Tessarek
2024-03-17 21:19 ` Helmut K. C. Tessarek

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=b739a479-ce11-9cb3-6feb-92f2cc723c79@martin.st \
    --to=martin@martin.st \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git