On recent CURRENT and poudriere/jail (up to date as of the time of writing this PR), port net/xorp fails to build, see below. [... extract of LOG ...] ====>> Building net/xorp build started at Thu Feb 16 16:21:07 UTC 2017 port directory: /usr/ports/net/xorp building for: FreeBSD pkg.walstatt.dynvpn.de 12.0-CURRENT FreeBSD 12.0-CURRENT amd64 maintained by: hrs@FreeBSD.org Makefile ident: $FreeBSD: head/net/xorp/Makefile 430692 2017-01-06 08:45:03Z jbeich $ Poudriere version: 3.1.14 Host OSVERSION: 1200020 Jail OSVERSION: 1200020 [...] Error: [...] Symlink("/wrkdirs/usr/ports/net/xorp/work/xorp.ct-xorp-1.8.5/xorp/obj/x86_64-unknown-freebsd12.0/fea/libxorp_fea.so", as "/wrkdirs/usr/ports/net/xorp/work/xorp.ct-xorp-1.8.5/xorp/obj/x86_64-unknown-freebsd12.0/lib/libxorp_fea.so") c++ -o obj/x86_64-unknown-freebsd12.0/policy/backend/policy_filter.os -c -pipe -fstack-protector -fno-strict-aliasing -O3 -g3 -Werror -W -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -Wcast-align -Woverloaded-virtual -ftemplate-depth-25 -DXORP_BUILDINFO -fPIC -DXRL_PF=120 -DXORP_VERSION=1.8.5 -DBOOST_DISABLE_THREADS -I/usr/local/include -Iobj/x86_64-unknown-freebsd12.0 -I. -I. policy/backend/policy_filter.cc fib2mrib/fib2mrib_varrw.cc:43:30: error: instantiation of variable 'ElemNet<IPNet<IPv4> >::id' required here, but no definition is available [-Werror,-Wundefined-var-template] _ef.create(ElemIPv4Net::id, ^ ./policy/common/element.hh:448:24: note: forward declaration of template entity is here static const char* id; [...]
Has anyone looked at this? I am running into the same problem now on FreeBSD 11.1-RELEASE.
I don't reach your error, I got: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] return ((const char *)a - (const char *)0) + (char *)0; ^ ~~~~~~~~~ don't know how to solve this.
Created attachment 194840 [details] svn-diff-xorp The only way I found to build it, is to patch out "-Werror" from SConstruct and other/lookup/configure.in.
Comment on attachment 194840 [details] svn-diff-xorp No, does not work, throws another error.
Created attachment 194845 [details] svn-diff-xorp It is an "ugly" patch. But the code is very old (January 2012). (And I think undefined-var-template makes incorrect error messages).
Thanks. I haven't tested this patch, but I confirmed earlier today that adding -Wno-undefined-var-template to the C++ flags in SConstruct makes it compile at least. Your change is more selective. btw, FreeBSD 11.1-RELEASE doesn't have Clang 5.0; I compiled with 4.0. Does it fail with 6.0?
Yes, see the error mentioned in comment2.
I take a quick look into xorp-hackers on http://www.xorp.org/. They removed the same compiler warnings from SConstruct as I do (except Werror). But not mentioned Wundefined-var-template. ((I don't know on which platforms they work, seems most of them on windows).
And they removed '-ftemplate-depth-25'. Maybe, this is important for armv6 (on which it is marked broken).
Created attachment 195056 [details] svn-diff-xorp_v2 And that was it. "-ftemplate-depth-25" caused the error. I think his patch is better.
Created attachment 195057 [details] svn-diff-xorp_v3 Attached wrong svn-diff.
Created attachment 195059 [details] svn-diff-xorp_v4 Include some more patches.
Created attachment 195071 [details] svn-diff-xorp_v5 Thought I don't need Wno-undefined-var-template, but it is needed.
Created attachment 195073 [details] svn-diff-xorp_v6 Was a typo in it , missed "," in patch-SConstruct.
Created attachment 195086 [details] svn-diff-xorp_v7
Created attachment 195088 [details] svn-diff-xorp_v8
Created attachment 195089 [details] svn-diff-xorp_v9 Was a typo in it.
Created attachment 195094 [details] svn-diff-xorp_v10 Seems no end... Pfff ... poudriere does not accepted "-Wno-undefined-var-template" (port does) (??). This version now builds fine with poudriere. This port is simply too old. I use the "hammer-method" and patched out "-Werror" again. But this one also builds also with clang60.
Created attachment 195125 [details] svn-diff-xorp_v11_remove_broken_armv vkarlssn on freebsd-bugs irc tested it on armv "xorp builds fine and seems to run without issues with v10 of your patch in my armv6 test bench (qemu)". So I remove the broken statement for armv.
Testbuilds are fine, committed, thanks!
A commit references this bug: Author: pi Date: Sat Jul 14 14:10:33 UTC 2018 New revision: 474640 URL: https://svnweb.freebsd.org/changeset/ports/474640 Log: net/xorp: fix build PR: 217152 Submitted by: Walter Schwarzenfeld <w.schwarzenfeld@utanet.at> Reported by: O. Hartmann <ohartmann@walstatt.org> Approved by: hrs (maintainer timeout) Changes: head/net/xorp/files/patch-SConstruct head/net/xorp/files/patch-cplfile.c head/net/xorp/files/patch-element.hh head/net/xorp/files/patch-expand.c head/net/xorp/files/patch-getline.c head/net/xorp/files/patch-history.c head/net/xorp/files/patch-homedir.c head/net/xorp/files/patch-io__ip__socket.cc head/net/xorp/files/patch-lex.boot.cc head/net/xorp/files/patch-lex.opcmd.cc head/net/xorp/files/patch-lex.tplt.cc head/net/xorp/files/patch-lex.yy__policy__backend__parser.cc head/net/xorp/files/patch-lex.yy__policy__parser.cc head/net/xorp/files/patch-libproto__packet.cc head/net/xorp/files/patch-netstream__access.h head/net/xorp/files/patch-pathutil.c head/net/xorp/files/patch-pcache.c head/net/xorp/files/patch-popen.cc head/net/xorp/files/patch-strptime.c head/net/xorp/files/patch-y.boot__tab.cc head/net/xorp/files/patch-y.opcmd__tab.cc head/net/xorp/files/patch-y.tplt__tab.cc