Bug 209097 - security/hpenc: Fix build with libc++ 3.8.0
Summary: security/hpenc: Fix build with libc++ 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vsevolod Stakhov
Depends on:
Blocks: 208158
  Show dependency treegraph
Reported: 2016-04-27 12:41 UTC by Dimitry Andric
Modified: 2016-04-29 15:42 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (vsevolod)

Don't declare max_align_t if libc++'s stddef.h already did it (1.01 KB, patch)
2016-04-27 12:41 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

  - Fix build with the recent libc++

  PR:		209097
  Submitted by:	dim

Comment 2 Vsevolod Stakhov freebsd_committer 2016-04-29 15:42:51 UTC
Committe, thank you!