After r487226, building print/tex-luatex is failing with a linker error on 11-stable/amd64. . . . c++ -Wimplicit -Wreturn-type -Wno-unknown-pragmas -Wno-write-strings -O2 -pipe -fstack-protector -fno-strict-aliasing -fstack-protector -o luatex luatexdir/luatex-luatex.o mplibdir/luatex-lmplib.o -fstack-protector -Wl,--export-dynamic libluatex.a libff.a libluamisc.a libluasocket.a -L/usr/local/lib -ltexlua52 libmplib.a -lmpfr -lgmp -lcairo -lpthread -lpixman-1 -lzzip -lpng16 -lz /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a lib/lib.a -lkpathsea libmputil.a libunilib.a libmd5.a -lm /usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information. /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a(Form.o): In function `_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE16_M_insert_uniqueIRKiEESt4pairISt17_Rb_tree_iteratorIiEbEOT_': Form.cc:(.text._ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE16_M_insert_uniqueIRKiEESt4pairISt17_Rb_tree_iteratorIiEbEOT_[_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE16_M_insert_uniqueIRKiEESt4pairISt17_Rb_tree_iteratorIiEbEOT_]+0x90): undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)' Form.cc:(.text._ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE16_M_insert_uniqueIRKiEESt4pairISt17_Rb_tree_iteratorIiEbEOT_[_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE16_M_insert_uniqueIRKiEESt4pairISt17_Rb_tree_iteratorIiEbEOT_]+0xcf): undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)' /usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information. /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a(Gfx.o): In function `Gfx::opXObject(Object*, int)': Gfx.cc:(.text+0x12a99): undefined reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)' /usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
Adding committer.
Created attachment 200309 [details] [log] manual link invocation (with -v) Attached is a copy of the output of the c++ link command that is failing (with -v).
Moin moin I cannot reproduce this in my 11 jail. mfg Tobias
Same here on HEADamd64 r342007: /bin/sh ./libtool --tag=CXX --mode=link c++ -Wimplicit -Wreturn-type -Wno-unknown-pragmas -Wno-write-strings -O2 -pipe -fstack-protector -fno-strict-aliasing -export-dynamic -fstack-protector -o luatex luatexdir/luatex-luatex.o mplibdir/luatex-lmplib.o libluatex.a libff.a libluamisc.a libluasocket.a -L/usr/local/lib -ltexlua52 libmplib.a -L/usr/local/lib -lmpfr -L/usr/local/lib -lgmp -L/usr/local/lib -lcairo -lpthread -L/usr/local/lib -lpixman-1 -L/usr/local/lib -fstack-protector -lzzip -lz -L/usr/local/lib -lpng16 -lz -lz /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a lib/lib.a -L/usr/local/lib -lkpathsea libmputil.a libunilib.a libmd5.a -lm libtool: link: c++ -Wimplicit -Wreturn-type -Wno-unknown-pragmas -Wno-write-strings -O2 -pipe -fstack-protector -fno-strict-aliasing -fstack-protector -o luatex luatexdir/luatex-luatex.o mplibdir/luatex-lmplib.o -fstack-protector -Wl,--export-dynamic libluatex.a libff.a libluamisc.a libluasocket.a -L/usr/local/lib -ltexlua52 libmplib.a -lmpfr -lgmp -lcairo -lpthread -lpixman-1 -lzzip -lpng16 -lz /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a lib/lib.a -lkpathsea libmputil.a libunilib.a libmd5.a -lm ld: error: undefined symbol: std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) >>> referenced by stl_tree.h:1771 (/usr/local/lib/gcc8/include/c++/bits/stl_tree.h:1771) >>> Form.o:(std::pair<std::_Rb_tree_iterator<int>, bool> std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_insert_unique<int const&>(int const&)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::_Rb_tree_decrement(std::_Rb_tree_node_base*) >>> referenced by stl_tree.h:302 (/usr/local/lib/gcc8/include/c++/bits/stl_tree.h:302) >>> Form.o:(std::pair<std::_Rb_tree_iterator<int>, bool> std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_insert_unique<int const&>(int const&)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) >>> referenced by stl_tree.h:2491 (/usr/local/lib/gcc8/include/c++/bits/stl_tree.h:2491) >>> Gfx.o:(Gfx::opXObject(Object*, int)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_length_error(char const*) >>> referenced by stl_vector.h:1643 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:1643) >>> CachedFile.o:(std::vector<CachedFile::Chunk, std::allocator<CachedFile::Chunk> >::_M_default_append(unsigned long)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_out_of_range_fmt(char const*, ...) >>> referenced by stl_vector.h:960 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:960) >>> StructElement.o:(StructElement::findAttribute(Attribute::Type, bool, Attribute::Owner) const) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_out_of_range_fmt(char const*, ...) >>> referenced by stl_vector.h:960 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:960) >>> StructElement.o:(StructElement::findAttribute(Attribute::Type, bool, Attribute::Owner) const) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_out_of_range_fmt(char const*, ...) >>> referenced by stl_vector.h:960 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:960) >>> StructElement.o:(StructElement::parseAttributes(Dict*, bool)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_out_of_range_fmt(char const*, ...) >>> referenced by stl_vector.h:960 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:960) >>> StructElement.o:(StructElement::parse(Dict*)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_out_of_range_fmt(char const*, ...) >>> referenced by stl_vector.h:960 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:960) >>> StructElement.o:(StructElement::appendSubTreeText(GooString*, bool) const) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) >>> referenced by stl_tree.h:1771 (/usr/local/lib/gcc8/include/c++/bits/stl_tree.h:1771) >>> StructElement.o:(std::pair<std::_Rb_tree_iterator<int>, bool> std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_insert_unique<int>(int&&)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::_Rb_tree_decrement(std::_Rb_tree_node_base*) >>> referenced by stl_tree.h:302 (/usr/local/lib/gcc8/include/c++/bits/stl_tree.h:302) >>> StructElement.o:(std::pair<std::_Rb_tree_iterator<int>, bool> std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_insert_unique<int>(int&&)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_length_error(char const*) >>> referenced by stl_vector.h:1643 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:1643) >>> StructTreeRoot.o:(std::vector<std::vector<StructTreeRoot::Parent, std::allocator<StructTreeRoot::Parent> >, std::allocator<std::vector<StructTreeRoot::Parent, std::allocator<StructTreeRoot::Parent> > > >::_M_default_append(unsigned long)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a ld: error: undefined symbol: std::__throw_length_error(char const*) >>> referenced by stl_vector.h:1643 (/usr/local/lib/gcc8/include/c++/bits/stl_vector.h:1643) >>> StructTreeRoot.o:(std::vector<StructTreeRoot::Parent, std::allocator<StructTreeRoot::Parent> >::_M_default_append(unsigned long)) in archive /usr/ports/print/tex-luatex/work/texlive-20150521-source/libs/poppler/libpoppler.a c++: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1 Stop. make[3]: stopped in /usr/ports/print/tex-luatex/work/texlive-20150521-source/texk/web2c *** Error code 1 Stop. make[2]: stopped in /usr/ports/print/tex-luatex/work/texlive-20150521-source/texk/web2c *** Error code 1 Stop. make[1]: stopped in /usr/ports/print/tex-luatex/work/texlive-20150521-source/texk/web2c *** Error code 1 Stop. make: stopped in /usr/ports/print/tex-luatex
Moin moin I reproduce this on neither * Jail OSVERSION: 1102000 (11.2-RELEASE-p7 i386) * Jail OSVERSION: 1300005 (13-CURRENT r342109) Please, update your systems/packages and try again. mfg Tobias
(In reply to Tobias C. Berner from comment #5) Hi Tobias, Thanks for your work and suggestion. I just rebuilt the whole dependencies tree for print/tex-luatex with recent ports tree and unfortunately it fails like before: portmaster pixman-0.34.0_1 texlive-texmf-20150523_4 tex-formats-20150521_2 mpfr-4.0.1_2 poppler-0.72.0 png-1.6.35 cairo-1.15.12,2 zziplib-0.13.69_1 tex-web2c-20150521_3 tex-libtexluajit-2.0.3 tex-libtexlua-5.2.4 tex-kpathsea-6.2.1_2 tex-luatex-0.80.0_9
Hi Rainer I now also tried it with a CURRENT jail at r42007. Still builds fine. So my guess still is, that your package are way out of sync with each other and the tree underlying it. Please try to update your ports tree and *all* the installed packages to the latest version -- not selectively only the dependencies of tex-luatex. Then try again. mfg Tobias
(In reply to Tobias C. Berner from comment #7) Hi Tobias, Thanks for testing also in a CURRENT jail. Unfortunately, the boxes, where this happens on my side, are all in production use. The ports are all built via portmaster, with several non default options enabled, because they are needed by GIS software. Additionally, the rebuild does not work for several ports, because they have problems ATM (e.g math/libpgmath). I haven't tried to do this via an own Poudriere repository until now. If I would change, this would take a long time (~ 2700 ports to build).
Hi there As I could not reproduce this with an up-to-date ports tree and the FreeBSD versions mentioned in the PR I have to assume that it is related to pkgs/ports being out of sync. Please reopen this issue if you updated everything and it still fails :) mfg Tobias
It compiles with poudriere testport. But still not outside that environment. It's happening on another host (11/stable i386) as well. Trying to determine the jail and out-of-jail differences.
(In reply to John Hein from comment #10) print/tex-xetex has the same problem.
Re-opening. The problem is reproduced (in poudriere jail or out) if lang/gcc (and thus also lang/gcc8) is installed. The 'configure' stage looks for gcc and uses it (instead of /usr/bin/cc) if it finds it.
Workaround: make CC=/usr/bin/cc CXX=/usr/bin/c++
(In reply to John Hein from comment #12) I have lang/gcc8 installed, and it does not fail. * Do you have CC&Co overriden in your make.conf/environemnt? * Please upload a full build log.
Created attachment 200667 [details] [build log] log of build failure with gcc (In reply to Tobias C. Berner from comment #14) Build log is attached. There is no CC defined in make.conf Compare to your build log (feel free to attach yours as well). Pay particular attention to the configure phase where it tries to detect gcc. You should see: checking for gcc... gcc If gcc is not detected, you will see: checking for gcc... no And then the build will use /usr/bin/cc (and /usr/bin/c++) and not fail. If you are trying to use poudriere to reproduce, you may want to use 'bulk -i lang/gcc' or 'testport -i lang/gcc' and then run 'make -C /usr/ports/print/tex-luatex' manually inside the jail. Or manually add 'BUILD_DEPENDS=gcc:lang/gcc' to tex-luatex/Makefile before 'testport print/tex-luatex'. I don't know of another way currently to force poudriere to have a set of non-dependent packages (e.g., lang/gcc) installed before it tries to build a particular port (e.g., print/tex-luatex).
I can confirm I have the same problem as John on a fresh install with updated ports tree (FreeBSD 12.0-RELEASE-p3) John's workaround in Comment 13 worked.
*** Bug 237902 has been marked as a duplicate of this bug. ***
I am seeing this with 12.0-STABLE r343501 GENERIC_4BSD amd64. Using make "CC=/usr/bin/cc CXX=/usr/bin/c++" fixes the issue.
Created attachment 204593 [details] [patch] fix for mixed clang/gcc mismatch triggering link failure Attached is a patch to tell configure which CC/CXX to use (rather than let it try to detect the compiler to use and have it pick something that results in a mix of clang & gcc built products that trigger the link failure). Flagging maintainer-approval request, although it's been a long time since I've seen much ports interaction from the maintainer (none for this PR since it was opened).
p.s. It was probably not necessary to bump PORTREVISION on this port after the recent poppler update since tex-luatex was modified to use the internal bundled poppler code.
*** Bug 239608 has been marked as a duplicate of this bug. ***
*** Bug 236882 has been marked as a duplicate of this bug. ***
Maintainer timeout? If a committer takes this simple patch to ensure consistent suite of compiler tools at each build stage, please also apply to print/tex-xetex. Enough people have hit this problem, I think. I hit this again on a machine after building due to the recent PORTREVISION bump. QA: Both ports have been tested with poudriere with this change. No new portlint warnings.
Maintainer Timout
(In reply to Tobias C. Berner from comment #24) I am sorry for the delay getting back to this PR. This issue was due to the mismatch between libc++ and libstdc++, not mismatch of clang and gcc themselves. Putting CC and CXX into CONFIGURE_ARGS hides it but does not solve the root cause.
Created attachment 218841 [details] Patch to fix mixing libc++/libstdc++ and -fcommon issues Here's a patch that fixes both issues: * Add CC and CXX to CONFIGURE_ARGS to force using system specified cc/c++ * Add patches to remove duplicated symbols
(In reply to Dimitry Andric from comment #26) Many thanks for the patch! It works fine for me on Poudriere and even outside, build by Portmaster. For me too, the problem also exists for print/tex-xetex, as mentioned by John Hein in comment #11.
Created attachment 218857 [details] Patch to fix mixing libc++/libstdc++ in print/tex-xetex Sure, here is a similar patch for print/tex-xetex. With that port, only adding CC and CXX to the configure arguments is enough.
(In reply to Dimitry Andric from comment #28) Thanks for the patch for print/tex-xetex. This one also builds, installs and works fine for me within and outside of Poudriere. However, with DEVELOPER=yes set in /etc/make.conf, I get some errors and a warning during stage-qa: ====> Running Q/A tests (stage-qa) Error: '/usr/bin/env python' is an invalid shebang you need USES=shebangfix for 'share/texmf-dist/doc/xelatex/xepersian/undk-0.6.py' Error: '/usr/bin/env python' is an invalid shebang you need USES=shebangfix for 'share/texmf-dist/doc/xelatex/xepersian/unldk-0.2.py' Error: '/usr/bin/env python' is an invalid shebang you need USES=shebangfix for 'share/texmf-dist/doc/xelatex/xepersian/dkun-0.3.py' Error: '/usr/bin/env python' is an invalid shebang you need USES=shebangfix for 'share/texmf-dist/doc/xelatex/xepersian/dkun-0.4.py' Error: '/usr/bin/perl' is an invalid shebang you need USES=shebangfix for 'share/texmf-dist/source/xelatex/arabxetex/makemaps.pl' Error: '/usr/bin/perl' is an invalid shebang you need USES=shebangfix for 'share/texmf-dist/scripts/xetex/perl/xdv2pdf_mergemarks' Error: /usr/local/bin/xetex is linked to /usr/local/lib/libfontconfig.so.1 from x11-fonts/fontconfig but it is not declared as a dependency Warning: you need LIB_DEPENDS+=libfontconfig.so:x11-fonts/fontconfig Probably this is for another PR?
(In reply to Rainer Hurling from comment #29) Yes, those are all not strictly necessary now for getting the port building successfully. It looks like they're are all most "lint-like" things, making the port more nicely behaved. That said, adding the LIB_DEPENDS+=libfontconfig.so:x11-fonts/fontconfig to the xetex port should not be too much hassle.
Created attachment 218859 [details] Patch to fix mixing libc++/libstdc++ in print/tex-xetex, also pet portlint Hi Dimitry, Don't know, if I understand you right in comment #30. But here is a possible patch for print/tex-xetex, which includes the missing dependency, some SHEBANG fixes and some sorting in LIB_DEPENDS. What I am unsure about is, if USES=python:env is really needed here?
(In reply to Rainer Hurling from comment #29) Regarding the shebang issues, see the 3 1/2 year pr and patch, bug 218924.
(In reply to Rainer Hurling from comment #31) And I think your patch doesn't work because the files are not available at "patch" time (which is some of what that old bug discusses). The final patch in that bug uses post-install to fix the shebangs.
(In reply to John Hein from comment #33) Thanks for the hint to bug #218924. Very much the same I tried to do ;) And yes, you are right. What I forgot to add to my patch is something like: post-install: cd ${STAGEDIR}${PREFIX} && \ ${FIND} ${SHEBANG_FILES} -type f \ -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + I personally would be also fine without this SHEBANG fix. But I think, it is a good opportunity to solve this problem.
Please commit the fix for the dwarf linker problem. I keep hitting this on unpatched port trees. We are well past maintainer timeout, and we have reports of this being helpful, both for print/tex-luatex and print/tex-xetex. So we need a champion to commit this.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b8aceeb60194bcd8f8caf6789193c46271d3480e commit b8aceeb60194bcd8f8caf6789193c46271d3480e Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-05-06 21:29:24 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-05-06 21:29:24 +0000 print/tex-luatex: Avoid mixing libc++ and libstdc++, and don't use -fcommon This port was not respecting the CC and CXX variables, thus it could pick up gcc and g++ instead, and that would cause mixups between libstdc++ (which is preferred by gcc) and libc++ (which is in base), ultimately leading to link errors. Also, the port uses a very old version of tex so it suffers from a few -fno-common issues, mostly variables that have been declared without an 'extern' specifier. Add a few patches to fix these. Appproved by: maintainer timeout PR: 234221 MFH: 2021Q2 print/tex-luatex/Makefile | 8 +++----- .../tex-luatex/files/patch-luatexdir_font_luatexfont.h (new) | 11 +++++++++++ print/tex-luatex/files/patch-luatexdir_image_writeimg.h (new) | 11 +++++++++++ print/tex-luatex/files/patch-luatexdir_image_writeimg.w (new) | 11 +++++++++++ print/tex-luatex/files/patch-luatexdir_pdf_pdftables.h (new) | 11 +++++++++++ print/tex-luatex/files/patch-luatexdir_tex_textoken.w (new) | 11 +++++++++++ 6 files changed, 58 insertions(+), 5 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c42622b6afc5b4fcf32552dbdc1a2d07433ae24d commit c42622b6afc5b4fcf32552dbdc1a2d07433ae24d Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-05-06 21:32:00 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-05-06 21:32:24 +0000 print/tex-xetex: Avoid mixing libc++ and libstdc++ This port was not respecting the CC and CXX variables, thus it could pick up gcc and g++ instead, and that would cause mixups between libstdc++ (which is preferred by gcc) and libc++ (which is in base), ultimately leading to link errors. Appproved by: maintainer timeout PR: 234221 MFH: 2021Q2 print/tex-xetex/Makefile | 2 ++ 1 file changed, 2 insertions(+)
Can anyone confirm if it works as intended now?
(In reply to Daniel Engberg from comment #38) I can confirm that tex-luatex nw builds correctly without any hack to force the proper library. 13-STABLE-n246941-20f96f21556 I have not tried tex-xetex as I don't use it.
(In reply to rkoberman from comment #39) Thanks, I'll close this bug report. If anyone still are having issues please open a new one. Fixed by commit b8aceeb60194bcd8f8caf6789193c46271d3480e