This is an archive of the discontinued LLVM Phabricator instance.

[clang] [Driver] [NetBSD] Add -D_REENTRANT when using sanitizers
ClosedPublic

Authored by mgorny on Dec 13 2018, 7:04 AM.

Details

Summary

NetBSD intends to support only reentrant interfaces in interceptors.
When -lpthread is used without _REENTRANT defined, things are
not guaranteed to work.

This is especially important for <stdio.h> and sanitization of
interfaces around FILE. Some APIs have alternative modes depending
on the _REENTRANT definition, and NetBSD intends to support sanitization
of the _REENTRANT ones.

Diff Detail

Event Timeline

mgorny created this revision.Dec 13 2018, 7:04 AM

Please normalize the description to resemble a typical commit message.

krytarowski added inline comments.Dec 16 2018, 12:10 AM
lib/Driver/ToolChains/NetBSD.cpp
465

There should be some way to express any sanitizer (-fsanitize) and we want _REENTRANT for all of them.

mgorny updated this revision to Diff 178701.Dec 18 2018, 9:10 AM
mgorny edited the summary of this revision. (Show Details)
mgorny marked 2 inline comments as done.
mgorny added inline comments.
lib/Driver/ToolChains/NetBSD.cpp
465

I've added it in dependent commit.

krytarowski accepted this revision.Dec 19 2018, 2:47 AM
This revision is now accepted and ready to land.Dec 19 2018, 2:47 AM
This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.