Bug 209097

Summary: security/hpenc: Fix build with libc++ 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Vsevolod Stakhov <vsevolod>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (vsevolod)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 208158    
Attachments:
Description Flags
Don't declare max_align_t if libc++'s stddef.h already did it none

Description Dimitry Andric freebsd_committer 2016-04-27 12:41:46 UTC
Created attachment 169757 [details]
Don't declare max_align_t if libc++'s stddef.h already did it

During the exp-run in bug 208158, it was found that security/hpenc gives errors with libc++ 3.8.0 [1]:

In file included from aead.cc:29:
In file included from ./aead.h:29:
./common.h:37:3: error: typedef redefinition with different types ('struct max_align_t' vs 'long double')
} max_align_t;
  ^
/usr/include/c++/v1/stddef.h:57:21: note: previous definition is here
typedef long double max_align_t;
                    ^

If __CLANG_MAX_ALIGN_T_DEFINED is not defined, libc++'s new stddef.h also declares max_align_t, and this conflicts with the max_align_t declaration in common.h.  There is already an "Ugly, ugly hack" part in common.h, which unfortunately must now be made even uglier, as in the attached patch.  This adds a !defined(_LIBCPP_STDDEF_H) to detect whether libc++'s stddef.h was included.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/hpenc-2.0_1.log
Comment 1 commit-hook freebsd_committer 2016-04-29 15:42:17 UTC
A commit references this bug:

Author: vsevolod
Date: Fri Apr 29 15:41:40 UTC 2016
New revision: 414279
URL: https://svnweb.freebsd.org/changeset/ports/414279

Log:
  - Fix build with the recent libc++

  PR:		209097
  Submitted by:	dim

Changes:
  head/security/hpenc/Makefile
  head/security/hpenc/files/
  head/security/hpenc/files/patch-src_common.h
Comment 2 Vsevolod Stakhov freebsd_committer 2016-04-29 15:42:51 UTC
Committe, thank you!