Skip to content

Commit

Permalink
Revert "Fix cross-build support for Ubuntu 16.04"
Browse files Browse the repository at this point in the history
This reverts commit d6327ae.

Before version 2.25, glibc's unistd.h would define the POSIX subset of
getopt.h by defining __need_getopt, including getopt.h (which would
disable the header guard) and then undefining it so later including
getopt.h explicitly would define the extensions. However, we wrap
getopt, and so the wrapper's #pragma once breaks that. Thus getopt.h was
included before the real unistd.h to ensure we get all the extensions.

However, with clang 12 that causes problems where we get a function
mismatch (since getopt can throw exceptions). If we include it after
unistd.h, it will get the full definitions since glibc no longer does
the subsetting thing. This will result in matching definitions and fix
clang 12.

Reviewed by: imp, jrtc27 (OK'd on irc)
Pull Request: freebsd/freebsd-src#668
  • Loading branch information
jlduran authored and bsdjhb committed Mar 30, 2023
2 parents 3937522 + 320e7e0 commit 973098d
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 973098d

Please sign in to comment.