Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple definition error when building a project using mpp and libvpx #580

Open
MarcA711 opened this issue Apr 24, 2024 · 1 comment · May be fixed by #621
Open

multiple definition error when building a project using mpp and libvpx #580

MarcA711 opened this issue Apr 24, 2024 · 1 comment · May be fixed by #621

Comments

@MarcA711
Copy link
Contributor

Rockchip mpp uses functions with the same name as libvpx. This leads to a multiple definition error when using both, mpp and libvpx, in a project together. Here is the build output when trying to build ffmpeg-rockchip from @nyanmisaka including libvpx:

/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):: (.rodata+0x0): multiple definition of `vp9_kf_partition_probs'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x190)/opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata+0x0): multiple definition of `vp9_kf_partition_probs'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(: first defined here
/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata.rodata+0x30): multiple definition of `vp9_kf_uv_mode_prob'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x+0x190): first defined here
/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld1c0: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata+0x)30): multiple definition of `vp9_kf_uv_mode_prob: first defined here'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x
1c0): first defined here/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld
/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata: +0xb0): multiple definition of `vp9_kf_y_mode_prob'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata/opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(+0x.rodata220): first defined here+0x
b0): multiple definition of `vp9_kf_y_mode_prob'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x220): first defined here
/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata+0x0): multiple definition of `vp9_kf_partition_probs'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x190): first defined here
/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata+0x30): multiple definition of `vp9_kf_uv_mode_prob'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x1c0): first defined here
/opt/ct-ng/lib/gcc/aarch64-ffbuild-linux-gnu/13.2.0/../../../../aarch64-ffbuild-linux-gnu/bin/ld: /opt/ffbuild/lib/librockchip_mpp.a(hal_vp9d_com.c.o):(.rodata+0xb0): multiple definition of `vp9_kf_y_mode_prob'; /opt/ffbuild/lib/libvpx.a(vp9_entropymode.c.o):(.rodata+0x220): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:133: ffmpeg_g] Error 1
make: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make: *** [Makefile:133: ffprobe_g] Error 1
collect2: error: ld returned 1 exit status
make: *** [Makefile:133: ffplay_g] Error 1

I propose to rename the functions that are also used in the libvpx project (maybe prefix them with mpp_).

It seems, that there were files copied from the libvpx project (similar to #530). Note, that libvpx is licensed under BSD-3-Clause license. As far as I know, this license allows to modify the source code of libvpx and include it in your project, but it obliges you to add a copy of the BSD license to your project. Maybe it is enough to just add the BSD license as a comment to the source code.

@HermanChen
Copy link
Collaborator

I know this is also the same issue mentioned by ffmpeg. We use some ffmpeg and libvpx code in parser.
We have to replace the code or fix the license but it is delayed for rk3576 support work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants