Solved libxml2 - Building fails due to linking error

Hello,
I'm having this issue on a brand new, otherwise empty 12.1 jail.

Code:
===>  Staging for libxml2-2.9.10_1
===>   Generating temporary packing list
if test -z 'strip'; then  /usr/bin/make  INSTALL_PROGRAM="/bin/sh /usr/ports/textproc/libxml2/work/libxml2-2.9.10/install-sh -c -s"  install_sh_PROGRAM="/bin/sh /usr/ports/textproc/libxml2/work/libxml2-2.9.10/install-sh -c -s" INSTALL_STRIP_FLAG=-s  install;  else  /usr/bin/make  INSTALL_PROGRAM="/bin/sh /usr/ports/textproc/libxml2/work/libxml2-2.9.10/install-sh -c -s"  install_sh_PROGRAM="/bin/sh /usr/ports/textproc/libxml2/work/libxml2-2.9.10/install-sh -c -s" INSTALL_STRIP_FLAG=-s  "INSTALL_PROGRAM_ENV=STRIPPROG='strip'" install;  fi
/usr/bin/make  install-recursive
Making install in include
Making install in libxml
 /bin/mkdir -p '/usr/ports/textproc/libxml2/work/stage/usr/local/include/libxml2/libxml'
 install  -m 0644 SAX.h entities.h encoding.h parser.h parserInternals.h xmlerror.h HTMLparser.h HTMLtree.h debugXML.h tree.h list.h hash.h xpath.h xpathInternals.h xpointer.h xinclude.h xmlIO.h xmlmemory.h nanohttp.h nanoftp.h uri.h valid.h xlink.h xmlversion.h DOCBparser.h catalog.h threads.h globals.h c14n.h xmlautomata.h xmlregexp.h xmlmodule.h xmlschemas.h schemasInternals.h xmlschemastypes.h xmlstring.h xmlunicode.h xmlreader.h relaxng.h dict.h '/usr/ports/textproc/libxml2/work/stage/usr/local/include/libxml2/libxml'
 install  -m 0644 SAX2.h xmlexports.h xmlwriter.h chvalid.h pattern.h xmlsave.h schematron.h '/usr/ports/textproc/libxml2/work/stage/usr/local/include/libxml2/libxml'
Making install in .
/bin/sh ./libtool  --tag=CC    --mode=link cc -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long -Wno-format-extra-args   -I/usr/include -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing   -fstack-protector-strong  -L/usr/lib -o xmllint xmllint.o   ./libxml2.la  -lz -L/usr/lib -llzma -L/usr/lib -lm
libtool: link: cc -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long -Wno-format-extra-args -I/usr/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong -o .libs/xmllint xmllint.o  -L/usr/lib ./.libs/libxml2.so -lz -llzma -lm -Wl,-rpath -Wl,/usr/local/lib
ld: error: ./.libs/libxml2.so: undefined reference to xmlValidatePopElement
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

I don't understand what has gone wrong. Ideas anyone?
 
I think there are some LDFLAGS= missing, pointing to the function 'xmlValidatePopElement'.

I would update the ports collection (portsnap fetch update), then try again. If the error persists, make a bug report or contact the maintainer.

You could try pkg install libxml2, since it's only a build error.
 
What's in /etc/make.conf? And please show the output from make showconfig.
 
I did the portsnap fetch update but no change.

There is no /etc/make.conf or /usr/local/etc/make.conf.
Here is the make showconfig output:

Code:
root@jail:/usr/ports/textproc/libxml2 # make showconfig
===> The following configuration options are available for libxml2-2.9.10_1:
     MEM_DEBUG=off: Memory debugging (DEVELOPERS ONLY!)
     SCHEMA=off: XML schema support
     THREADS=off: Threads support
     THREAD_ALLOC=off: Per-thread memory (DEVELOPERS ONLY!)
     VALID=off: Validation support
     XMLLINT_HIST=off: History for xmllint
===> Use 'make config' to modify these settings
 
I suggest you do make rmconfig and try to build it with the default options set. I suspect the error is because you turned off a couple of options that are on by default.
 
Thank you for the suggestion. I tried but was getting the same error.

I did the portsnap fetch update again, then make clean, make config, and make and this time it builds.
Maybe I actually hadn't updated it as I thought. Sorry for the trouble.
 
Back
Top