Building qt5-imageformats will not build from source in FreeBSD 13.2. Building with kde-qtimageformats-5.15.12p12 will not build. A prior version, kde-qtimageformat-5.15.11p12 will build but is no longer current. The build compiles until it tries to link then fails when the linker can't resolve "mng_setcb_writedata" and other symbols which looks like it is part of libmng. c++ -Wl,--undefined-version -Wl,--as-needed -fstack-protector-strong -Wl,--no-undefined -pthread -Wl,-rpath,/usr/local/lib/qt5 -shared -o libqmng.so .obj/main.o .obj/qmnghandler.o -L/usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL -lmng --- sub-tiff-all --- mv -f libqtiff.so ../../../../plugins/imageformats/libqtiff.so --- sub-icns-all --- mv -f libqicns.so ../../../../plugins/imageformats/libqicns.so --- sub-mng-all --- ld: error: undefined symbol: mng_setcb_writedata >>> referenced by qmnghandler.cpp >>> .obj/qmnghandler.o:(QMngHandlerPrivate::QMngHandlerPrivate(QMngHandler*)) ld: error: undefined symbol: mng_create >>> referenced by qmnghandler.cpp >>> .obj/qmnghandler.o:(QMngHandlerPrivate::writeImage(QImage const&))
Build fine for me on live system 13.2-p9 amd64. Try to rebuild graphics/libmng.
I did a make and make reinstall on libmng. Then a make clean and make on qt5-imageformats. I still get the same failure that it cannot reference mng_setcb_writedata and other libmng components. I am building on a 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64 machine.
Probably your environment is broken or outdated. Show: freebsd-version uname -srm pkg version -v -P | grep -v 'up-to-date with port'
It looks like I am up to date the results are: fbsdhost# freebsd-version 13.2-RELEASE fbsdhost# uname -srm FreeBSD 13.2-RELEASE amd64 fbsdhost# pkg version -v -P | grep -v 'up-to-date with port' Nothing was output from the pkg version. I tested without the "grep" and all lines say "up-to-date with port" just to be sure.
(In reply to dennis from comment #4) $ freebsd-version 13.2-RELEASE-p9 $ uname -srm FreeBSD 13.2-RELEASE-p8 amd64 Show: pkg check -d pkg check -B pkg info -oa cd /usr/ports/graphics/qt5-imageformats && make configure
Created attachment 247520 [details] result from pkg info -oa
It looks like it lost my comment after I attached the pkg info. Again thanks for your help in trying to solve this. I appreciate it. The results from pkg check: fbsdhost# pkg check -d Checking all packages: 100% fbsdhost# pkg check -B Checking all packages: 100% I went to the "/usr/ports/graphics/qt5-imageformats" directory and did a "make clean" and "make configure". The results are below. I also did a "make" after the configure, it failed again with the same undefined symbol error. --make configure-- fbsdhost# make configure ===> License LGPL21 accepted by the user ===> qt5-imageformats-5.15.12p12 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by qt5-imageformats-5.15.12p12 for building ===> Extracting for qt5-imageformats-5.15.12p12 => SHA256 Checksum OK for KDE/Qt/5.15.12/kde-qtimageformats-5.15.12p12.tar.xz. ===> Patching for qt5-imageformats-5.15.12p12 ===> Applying FreeBSD patches for qt5-imageformats-5.15.12p12 from /usr/ports/graphics/qt5-imageformats/files ===> qt5-imageformats-5.15.12p12 depends on package: qt5-buildtools>=5.15 - found ===> qt5-imageformats-5.15.12p12 depends on package: qt5-qmake>=5.15 - found ===> qt5-imageformats-5.15.12p12 depends on shared library: libjasper.so - found (/usr/local/lib/libjasper.so) ===> qt5-imageformats-5.15.12p12 depends on shared library: libmng.so - found (/usr/local/lib/libmng.so) ===> qt5-imageformats-5.15.12p12 depends on shared library: libtiff.so - found (/usr/local/lib/libtiff.so) ===> qt5-imageformats-5.15.12p12 depends on shared library: libwebp.so - found (/usr/local/lib/libwebp.so) ===> qt5-imageformats-5.15.12p12 depends on shared library: libQt5Core.so - found (/usr/local/lib/qt5/libQt5Core.so) ===> qt5-imageformats-5.15.12p12 depends on shared library: libQt5Gui.so - found (/usr/local/lib/qt5/libQt5Gui.so) ===> Configuring for qt5-imageformats-5.15.12p12 /bin/mkdir -p /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12 echo 'CMAKE_MODULE_TESTS = -' > /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.cache touch /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.git touch /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.conf # easier than to -f before the sed /usr/bin/sed -i.bak -e '/MODULE_VERSION/s|5\.15\.\([0-9]*\)|5.15.12|g' /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.conf echo 'QMAKE_LIBDIR_FLAGS = -L/usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/lib' >> /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.cache echo 'QMAKE_DEFAULT_LIBDIRS += /usr/local/lib /usr/lib /lib' >> /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.cache echo 'QMAKE_DEFAULT_INCDIRS += /usr/local/include /usr/include' >> /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.cache Info: creating stash file /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/.qmake.stash Running configuration tests... Done running configuration tests. Configure summary: Further Image Formats: JasPer ................................. yes MNG .................................... yes TIFF ................................... yes Using system libtiff ................. yes WEBP ................................... yes Using system libwebp ................. yes Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/usr/local'. Prior to reconfiguration, make sure you remove any leftovers from the previous build. Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/src.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/imageformats/imageformats.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/plugins.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/imageformats.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/tga/tga.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/wbmp/wbmp.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/tiff/tiff.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/webp/webp.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/icns/icns.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/mng/mng.pro Reading /usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/src/plugins/imageformats/jp2/jp2.pro
Do you have qt5-imageformats installed? Try: pkg create qt5-imageformats pkg delete -yf qt5-imageformats cd /usr/ports/graphics/qt5-imageformats && make clean && make install clean
Still getting the same undefined symbols while trying to link. fbsdhost# pkg create qt5-imageformats pkg: No installed package matching "qt5-imageformats" found fbsdhost# pkg delete -yf qt5-imageformats Updating database digests format: 100% No packages matched for pattern 'qt5-imageformats' Checking integrity... done (0 conflicting) 1 packages requested for removal: 0 locked, 1 missing I did a "make clean", then "make install". It does the configure as noted earlier and then starts building. There are no compiler warnings, except for one about jasper. It occurs a few steps before the unresolved symbol error. --- main.o main.cpp --- sub-jp2-all --- --- .obj/qjp2handler.o --- In file included from qjp2handler.cpp:49: In file included from /usr/local/include/jasper/jasper.h:73: /usr/local/include/jasper/jas_config.h:117:2: warning: "Your code is being built against an older version of the C standard than JasPer was. Although this is supported, this may require some extra preprocessor defines when building." [-W#warnings] #warning "Your code is being built against an older version of the C standard than JasPer was. Although this is supported, this may require some extra preprocessor defines when building." ^ --- sub-tga-all --- --- ../../../../plugins/imageformats/libqtga.so --- rm -f libqtga.so c++ -Wl,--undefined-version -Wl,--as-needed -fstack-protector-strong -Wl,--no-undefined -pthread -Wl,-rpath,/usr/local/lib/qt5 -shared -o libqtga.so .obj/qtgahandler.o .obj/qtgafile.o .obj/main.o -L/usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL --- sub-wbmp-all --- --- ../../../../plugins/imageformats/libqwbmp.so --- rm -f libqwbmp.so c++ -Wl,--undefined-version -Wl,--as-needed -fstack-protector-strong -Wl,--no-undefined -pthread -Wl,-rpath,/usr/local/lib/qt5 -shared -o libqwbmp.so .obj/qwbmphandler.o .obj/main.o -L/usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL --- sub-mng-all --- --- ../../../../plugins/imageformats/libqmng.so --- rm -f libqmng.so c++ -Wl,--undefined-version -Wl,--as-needed -fstack-protector-strong -Wl,--no-undefined -pthread -Wl,-rpath,/usr/local/lib/qt5 -shared -o libqmng.so .obj/main.o .obj/qmnghandler.o -L/usr/ports/graphics/qt5-imageformats/work/kde-qtimageformats-5.15.12p12/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL -lmng --- sub-tga-all --- mv -f libqtga.so ../../../../plugins/imageformats/libqtga.so --- sub-wbmp-all --- mv -f libqwbmp.so ../../../../plugins/imageformats/libqwbmp.so --- sub-mng-all --- ld: error: undefined symbol: mng_setcb_writedata >>> referenced by qmnghandler.cpp >>> .obj/qmnghandler.o:(QMngHandlerPrivate::QMngHandlerPrivate(QMngHandler*)) ld: error: undefined symbol: mng_create
Try to update to 13.2-p9: freebsd-update fetch install
Update is done, it freebsd-update fetch install brought things up to version 13.2-RELEASE-p9 according to freebsd-version. After a reboot: freebsd-version: 13.2-RELEASE-p9 uname -srm gives: FreeBSD 13.2-RELEASE-p8 amd64 Not sure why freebsd-version gives p9 and uname gives p8. Went to the qt5-imageformats source directory, did a "make clean" and "make" and unfortunately I still see the same unresolved reference during linking.
> Not sure why freebsd-version gives p9 and uname gives p8. uname show the kernel version. freebsd-version show the general version. p9 fix doesn't change the kernel itself - it change userland and modules only. p8 fix changed the kernel. > Went to the qt5-imageformats source directory, did a "make clean" and "make" and unfortunately I still see the same unresolved reference during linking. You have something broken in environment… When I have similar issues, I start rebuilding the packages on which the faulty one depends. $ pkg info -d qt5-imageformats qt5-imageformats-5.15.12p12: qt5-gui-5.15.12p148 webp-1.3.2 tiff-4.4.0_2 libmng-1.0.10_4 jasper-4.1.1 qt5-core-5.15.12p148 You can install ports-mgmt/portmaster and then run: portmaster qt5-core qt5-gui webp tiff libmng jasper Also check: pkg check -s Do you something in /etc/make.conf?
Looks related to bug#276145. I think [1] may be the culprit. Not sure what that commit has to do with security/sst, because libmng doesn’t use it. It fits the timeframe for when things started breaking, though. [1] https://cgit.freebsd.org/ports/commit/?id=330e763f39ad2ffca43df9b2c9e37db3f0bb2d78
I did two source based builds a few days apart. I did a portsnap fetch to get the latest ports. The older one was downloaded at 11:41 on Dec 29 2023. This one builds qt5-imageformats just fine. It uses kde-qtimageformats-5.15.11p12. The more recent build, uses a port snapshot (portsnap fetch) downloaded at 15:35 on Jan 5 2024. This one does not build and is the subject of this bug report. It uses kde-qtimageformat-5.15.11p12. According to the change log, qt5-imageformats was updated in the interval between Dec 29 and Jan 5. I did not change anything in /etc/make.conf. The environments are the same in both cases.
Ooops. I have the wrong versons. Dec 29 2023 version: kde-qtimageformats-5.15.11p12 (builds) Jan 5 2024 version: qde-qtimageformats-5.15.12p12 (doesn't build)
As I suspected, the problem is with libmng. The problem was introduced with [1], the same commit I referenced c#13, but cgit.freebsd.org seems to be having issues, so here's a link to it on the GitHub mirror. After re-adding that deleted file and rebuilding/reinstalling libmng, qt5-imageformats builds again. [1] https://github.com/FreeBSD/freebsd-ports/commit/330e763f39ad2ffca43df9b2c9e37db3f0bb2d78
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=bc8813201e0f7c095a8d0152485424cf22336bf5 commit bc8813201e0f7c095a8d0152485424cf22336bf5 Author: Mikhail Teterin <mi@FreeBSD.org> AuthorDate: 2024-01-08 19:54:30 +0000 Commit: Mikhail Teterin <mi@FreeBSD.org> CommitDate: 2024-01-08 19:54:30 +0000 graphics/libmng: reinstate the accidentally-deleted old patch PR: 276145, 276182 graphics/libmng/files/patch-conf (new) | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
It is fixed now!! The problem is indeed the missing patch-conf file in /usr/ports/graphics/libmng/files. I added the missing patch-conf file into libmng/files, did a make deinstall, make clean, make install in libmng. Then went back to qt5-imageformats and did a make clean, make configure, make, make install. It built and installed cleanly. This also fixed a problem in gimp-app which also failed for a problem with libmng. I think can be marked as closed. Thanks everyone who helped track this down.
Missing patch has been restored to graphics/libmng. Confirmed fixed by reporter.