Skip to content

Commit 7555aff

Browse files
committed
Define _GNU_SOURCE when importing glibc.
Some functions and types are hidden behind feature flags. _GNU_SOURCE exposes the most symbols and methods in glibc and musl.
1 parent f1f91a0 commit 7555aff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,12 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
533533
});
534534
}
535535
} else {
536+
invocationArgStrs.insert(invocationArgStrs.end(), {
537+
// Most of the good portable functions used in the Glibc module are hidden
538+
// behind this.
539+
"-D_GNU_SOURCE",
540+
});
541+
536542
// The module map used for Glibc depends on the target we're compiling for,
537543
// and is not included in the resource directory with the other implicit
538544
// module maps. It's at {freebsd|linux}/{arch}/glibc.modulemap.

0 commit comments

Comments
 (0)