[ 74% 64/67] : && /usr/local/libexec/ccache/cc -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -DNDEBUG -fstack-protector-strong -Xlinker --dependency-file=CMakeFiles/avifdec.dir/link.d CMakeFiles/avifdec.dir/apps/avifdec.c.o -o avifdec -Wl,-rpath,/tmp/ports/usr/ports/graphics/libavif/work/.build:/usr/local/lib: libavif_apps.a libavif.so.16.2.0 /usr/local/lib/libpng.so /usr/lib/libz.so /usr/local/lib/libjpeg.so && : FAILED: avifdec : && /usr/local/libexec/ccache/cc -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -DNDEBUG -fstack-protector-strong -Xlinker --dependency-file=CMakeFiles/avifdec.dir/link.d CMakeFiles/avifdec.dir/apps/avifdec.c.o -o avifdec -Wl,-rpath,/tmp/ports/usr/ports/graphics/libavif/work/.build:/usr/local/lib: libavif_apps.a libavif.so.16.2.0 /usr/local/lib/libpng.so /usr/lib/libz.so /usr/local/lib/libjpeg.so && : ld: error: undefined symbol: round >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced 10 more times ld: error: undefined symbol: roundf >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateGrayICC) in archive libavif_apps.a cc: error: linker command failed with exit code 1 (use -v to see invocation) [ 76% 64/67] : && /usr/local/libexec/ccache/cc -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -DNDEBUG -fstack-protector-strong -Xlinker --dependency-file=CMakeFiles/avifenc.dir/link.d CMakeFiles/avifenc.dir/apps/avifenc.c.o -o avifenc -Wl,-rpath,/tmp/ports/usr/ports/graphics/libavif/work/.build:/usr/local/lib: libavif_apps.a libavif.so.16.2.0 /usr/local/lib/libpng.so /usr/lib/libz.so /usr/local/lib/libjpeg.so && : FAILED: avifenc : && /usr/local/libexec/ccache/cc -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/libavif/work/libavif-1.2.0=. -DNDEBUG -fstack-protector-strong -Xlinker --dependency-file=CMakeFiles/avifenc.dir/link.d CMakeFiles/avifenc.dir/apps/avifenc.c.o -o avifenc -Wl,-rpath,/tmp/ports/usr/ports/graphics/libavif/work/.build:/usr/local/lib: libavif_apps.a libavif.so.16.2.0 /usr/local/lib/libpng.so /usr/lib/libz.so /usr/local/lib/libjpeg.so && : ld: error: undefined symbol: round >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced 10 more times ld: error: undefined symbol: roundf >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateRGBICC) in archive libavif_apps.a >>> referenced by iccmaker.c >>> iccmaker.c.o:(avifGenerateGrayICC) in archive libavif_apps.a cc: error: linker command failed with exit code 1 (use -v to see invocation)
Created attachment 258665 [details] patch
Build fine for me without -lm.
*** Bug 285405 has been marked as a duplicate of this bug. ***
(In reply to Vladimir Druzenko from comment #2) Probably options depend. # make showconfig ===> The following configuration options are available for libavif-1.2.0: MANPAGES=off: Install manpages (requires pandoc) PIXBUF=on: GDK-PixBuf library support ====> Options available for the group AV1 AOM=on: AV1 encoding/decoding via libaom DAV1D=on: AV1 decoding via libdav1d GAV1=off: AV1 decoding via libgav1 RAV1E=off: AV1 encoding via librav1e SVTAV1=on: AV1 encoding via SVT-AV1 ====> Options available for the group COLOR LIBSHARPYUV=off: Colorspace conversion via libsharpyuv LIBYUV=off: Colorspace conversion via libyuv ===> Use 'make config' to modify these settings FBSD 14/stable amd64 build less than 5 days ago.
(In reply to Ivan Rozhuk from comment #4) From email list: >> This error does not happen with OPTION LIBYUV enabled. This option has graphics/libyuv as dependency. > Adding LIBYUV_CFLAGS_OFF=-Wl,-lm seems to work.
(In reply to Ivan Rozhuk from comment #4) ===> The following configuration options are available for libavif-1.2.0: MANPAGES=off: Install manpages (requires pandoc) PIXBUF=on: GDK-PixBuf library support ====> Options available for the group AV1 AOM=on: AV1 encoding/decoding via libaom DAV1D=on: AV1 decoding via libdav1d GAV1=off: AV1 decoding via libgav1 RAV1E=off: AV1 encoding via librav1e SVTAV1=off: AV1 encoding via SVT-AV1 ====> Options available for the group COLOR LIBSHARPYUV=off: Colorspace conversion via libsharpyuv LIBYUV=off: Colorspace conversion via libyuv I noticed I have SVTAV1 off. I'll try again after enabling SVTAV1 and moving my patch out of the way.
(In reply to Vladimir Druzenko from comment #5) https://lists.freebsd.org/archives/dev-commits-ports-all/2025-March/152618.html
It is confirmed that this port builds fine with default options. Let me test it and I'll commit the fix. Thanks.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1e99b807283ac2743600d0db0832c97e8fcaa4db commit 1e99b807283ac2743600d0db0832c97e8fcaa4db Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2025-03-15 13:01:11 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2025-03-15 13:01:11 +0000 graphics/libavif: Fix build with non-default options libavif uses round/roundf which is in the math library. It builds fine with default options because libm is brought in via its dependencies. Therefore, we add it to LDFLAGS explicitly. PR: 285403, 285405 Reported by: many graphics/libavif/Makefile | 1 + 1 file changed, 1 insertion(+)