[FFmpeg-devel] [PATCH] avutil: only duplicate hal2float and float2half in shared builds

James Almer jamrial at gmail.com
Mon Mar 17 04:48:56 EET 2025


As a side effect, this also fixes compilation in shared builds in some
specific configurations after 1eafbf820312d45b31907e16877ae780022598c4.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/Makefile | 13 +++++++++----
 libavutil/Makefile  |  2 ++
 libswscale/Makefile |  3 +--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3c7043a617..08a5985b68 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -366,8 +366,8 @@ OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER)    += 8svx.o
 OBJS-$(CONFIG_ESCAPE124_DECODER)       += escape124.o
 OBJS-$(CONFIG_ESCAPE130_DECODER)       += escape130.o
 OBJS-$(CONFIG_EVRC_DECODER)            += evrcdec.o acelp_vectors.o lsp.o
-OBJS-$(CONFIG_EXR_DECODER)             += exr.o exrdsp.o half2float.o
-OBJS-$(CONFIG_EXR_ENCODER)             += exrenc.o float2half.o
+OBJS-$(CONFIG_EXR_DECODER)             += exr.o exrdsp.o
+OBJS-$(CONFIG_EXR_ENCODER)             += exrenc.o
 OBJS-$(CONFIG_FASTAUDIO_DECODER)       += fastaudio.o
 OBJS-$(CONFIG_FFV1_DECODER)            += ffv1dec.o ffv1_parse.o ffv1.o
 OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1enc.o ffv1_parse.o ffv1.o
@@ -613,8 +613,8 @@ OBJS-$(CONFIG_PGMYUV_DECODER)          += pnmdec.o pnm.o
 OBJS-$(CONFIG_PGMYUV_ENCODER)          += pnmenc.o
 OBJS-$(CONFIG_PGSSUB_DECODER)          += pgssubdec.o
 OBJS-$(CONFIG_PGX_DECODER)             += pgxdec.o
-OBJS-$(CONFIG_PHM_DECODER)             += pnmdec.o pnm.o half2float.o
-OBJS-$(CONFIG_PHM_ENCODER)             += pnmenc.o float2half.o
+OBJS-$(CONFIG_PHM_DECODER)             += pnmdec.o pnm.o
+OBJS-$(CONFIG_PHM_ENCODER)             += pnmenc.o
 OBJS-$(CONFIG_PHOTOCD_DECODER)         += photocd.o
 OBJS-$(CONFIG_PICTOR_DECODER)          += pictordec.o cga_data.o
 OBJS-$(CONFIG_PIXLET_DECODER)          += pixlet.o
@@ -1075,6 +1075,11 @@ OBJS-$(CONFIG_VVC_VAAPI_HWACCEL)          += vaapi_vvc.o
 # Objects duplicated from other libraries for shared builds
 SHLIBOBJS                              += log2_tab.o reverse.o
 
+SHLIBOBJS-$(CONFIG_EXR_DECODER)        += half2float.o float2half.o
+SHLIBOBJS-$(CONFIG_EXR_ENCODER)        += float2half.o
+SHLIBOBJS-$(CONFIG_PHM_DECODER)        += half2float.o
+SHLIBOBJS-$(CONFIG_PHM_ENCODER)        += float2half.o
+
 # General libavformat dependencies
 OBJS-$(CONFIG_FITS_DEMUXER)            += fits.o
 OBJS-$(CONFIG_TAK_DEMUXER)             += tak.o
diff --git a/libavutil/Makefile b/libavutil/Makefile
index b7ed339ab3..b03c50444f 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -139,9 +139,11 @@ OBJS = adler32.o                                                        \
        file.o                                                           \
        file_open.o                                                      \
        float_dsp.o                                                      \
+       float2half.o                                                     \
        film_grain_params.o                                              \
        fixed_dsp.o                                                      \
        frame.o                                                          \
+       half2float.o                                                     \
        hash.o                                                           \
        hdr_dynamic_metadata.o                                           \
        hdr_dynamic_vivid_metadata.o                                     \
diff --git a/libswscale/Makefile b/libswscale/Makefile
index 4cf4bb2602..d5e10d17dc 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -13,7 +13,6 @@ OBJS = alphablend.o                                     \
        format.o                                         \
        gamma.o                                          \
        graph.o                                          \
-       half2float.o                                     \
        input.o                                          \
        lut3d.o                                          \
        options.o                                        \
@@ -28,7 +27,7 @@ OBJS = alphablend.o                                     \
        vscale.o                                         \
 
 # Objects duplicated from other libraries for shared builds
-SHLIBOBJS                    += log2_tab.o
+SHLIBOBJS                    += log2_tab.o half2float.o
 
 # Windows resource file
 SHLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o
-- 
2.48.1



More information about the ffmpeg-devel mailing list