Bug 241804

Summary: www/squid: fix build on GCC architectures
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Piotr Kubaj <pkubaj>
Status: Closed FIXED    
Severity: Affects Only Me CC: linimon, timp87
Priority: --- Flags: bugzilla: maintainer-feedback? (timp87)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch timp87: maintainer-approval+

Description Piotr Kubaj freebsd_committer freebsd_triage 2019-11-08 15:57:22 UTC
Created attachment 208976 [details]
patch

Add --disable-strict-error-checking to CONFIGURE_ARGS for everyone. It adds -Werror, which is against ports tree policy and causes:
Icmp6.cc: In member function 'virtual void Icmp6::SendEcho(Ip::Address&, int, const char*, int)':
Icmp6.cc:165:72: error: converting a packed 'icmp6_hdr' pointer (alignment 1) to a 'short unsigned int' pointer (alignment 2) may result in an unaligned pointer value [-Werror=address-of-packed-member]
  165 |     icmp->icmp6_cksum = CheckSum((unsigned short *) icmp, icmp6_pktsize);
      |                                                                        ^
In file included from Icmp6.h:20,
                 from Icmp6.cc:18:
/usr/include/netinet/icmp6.h:72:8: note: defined here
   72 | struct icmp6_hdr {
      |        ^~~~~~~~~
At global scope:
cc1plus: error: unrecognized command line option '-Wno-deprecated-register' [-Werror]
cc1plus: all warnings being treated as errors

Additionally, add GSSAPI_NONE to default options when built with GCC. The reason is that it only builds with https://reviews.freebsd.org/D20289 applied and this patch is uncommitted because Mk/Uses/gssapi.mk fails to review it.
Comment 1 Pavel Timofeev 2019-11-12 14:38:43 UTC
Let me test it.
I'll get back soon.
Comment 2 Pavel Timofeev 2019-11-12 14:48:38 UTC
Please, note this
> CFLAGS+=	-Wno-error=deprecated-declarations
was added several weeks ago to fix build with libc++ 9
https://svnweb.freebsd.org/ports?view=revision&revision=514623
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2019-11-12 14:59:57 UTC
(In reply to timp87 from comment #2)
--disable-strict-error-checking will remove -Werror altogether, so there shouldn't be -Werror-related errors anymore.
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-12-05 18:28:46 UTC
A commit references this bug:

Author: pkubaj
Date: Thu Dec  5 18:27:46 UTC 2019
New revision: 519101
URL: https://svnweb.freebsd.org/changeset/ports/519101

Log:
  www/squid: fix build on GCC architectures

  Add --disable-strict-error-checking to CONFIGURE_ARGS for everyone. It adds -Werror, which is against ports tree policy and causes:
  Icmp6.cc: In member function 'virtual void Icmp6::SendEcho(Ip::Address&, int, const char*, int)':
  Icmp6.cc:165:72: error: converting a packed 'icmp6_hdr' pointer (alignment 1) to a 'short unsigned int' pointer (alignment 2) may result in an unaligned pointer value [-Werror=address-of-packed-member]
    165 |     icmp->icmp6_cksum = CheckSum((unsigned short *) icmp, icmp6_pktsize);
        |                                                                        ^
  In file included from Icmp6.h:20,
                   from Icmp6.cc:18:
  /usr/include/netinet/icmp6.h:72:8: note: defined here
     72 | struct icmp6_hdr {
        |        ^~~~~~~~~
  At global scope:
  cc1plus: error: unrecognized command line option '-Wno-deprecated-register' [-Werror]
  cc1plus: all warnings being treated as errors

  PR:		241804
  Approved by:	timp87@gmail.com (maintainer), mentors (implicit approval)

Changes:
  head/www/squid/Makefile