Bug 212432

Summary: www/squid: Fix build with clang 3.9.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Florian Smeets <flo>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: emaste, timp87
Priority: --- Flags: bugzilla: maintainer-feedback? (timp87)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 212343    
Attachments:
Description Flags
Adapted upstream revision 14776 to fix clang 3.9.0 and higher build none

Description Dimitry Andric freebsd_committer 2016-09-06 21:16:05 UTC
Created attachment 174441 [details]
Adapted upstream revision 14776 to fix clang 3.9.0 and higher build

While testing the clang390-import branch, I ran into the following -Werror warnings when building www/squid:

In file included from TcpAcceptor.cc:15:
In file included from ../../src/comm/AcceptLimiter.h:12:
In file included from ../../src/comm/TcpAcceptor.h:13:
In file included from ../../src/base/AsyncJob.h:12:
In file included from ../../src/base/AsyncCall.h:12:
../../src/base/InstanceId.h:28:27: error: instantiation of variable 'InstanceId<MasterXaction>::Last' required here, but no definition is available [-Werror,-Wundefined-var-template]
    InstanceId(): value(++Last ? Last : ++Last) {}
                          ^
../../src/MasterXaction.h:36:7: note: in instantiation of member function 'InstanceId<MasterXaction>::InstanceId' requested here
class MasterXaction : public RefCountable
      ^
../../src/base/InstanceId.h:47:18: note: forward declaration of template entity is here
    static Value Last; ///< the last used ID value
                 ^
1 error generated.
*** [TcpAcceptor.lo] Error code 1

This has been fixed in upstream revision 14776 [1], by changing the implementation of the InstanceId template class.  The upstream change does not directly apply to squid 3.5.20, so I adapted it a little.

[1] http://bazaar.launchpad.net/~squid/squid/trunk/revision/14776
Comment 1 Pavel Timofeev 2016-09-12 19:15:45 UTC
Give me some time. I'll check it and try to convince upstream to backport it into 3.5 branch
Comment 2 Florian Smeets freebsd_committer 2016-09-14 20:21:02 UTC
Take.
Comment 3 Pavel Timofeev 2016-09-15 14:50:36 UTC
Comment on attachment 174441 [details]
Adapted upstream revision 14776 to fix clang 3.9.0 and higher build

Feel free to commit it in case there is no news about official backporting.
Comment 4 Pavel Timofeev 2016-09-27 09:47:48 UTC
Comment on attachment 174441 [details]
Adapted upstream revision 14776 to fix clang 3.9.0 and higher build

Please, follow https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212909
It includes all official patches including officially backported fix for clang 3.9.
Close this one.
Comment 5 Dimitry Andric freebsd_committer 2016-09-27 10:02:30 UTC
Closed in favor of bug 212909.