-
-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dmd-cxx] Add root/system.h header for wrapping system includes #8910
Conversation
Thanks for your pull request, @ibuclaw! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "dmd-cxx + dmd#8910" |
d854b0b
to
92cdb95
Compare
All malloc and friends are all marked as |
92cdb95
to
eaf1036
Compare
ec1869a
to
371fae3
Compare
Rebased. |
03865b9
to
a05e5be
Compare
392e8b0
to
371fae3
Compare
@jacob-carlborg - I'll just split the latter two, they don't touch any part of the shareable front-end anyway. Everything else ok? |
371fae3
to
a181bb8
Compare
Looks good, nothing else that I can see. |
This introduces a new header that pulls in system includes for use only in the DMD front-end part of the compiler, fixing up uses of problematic functions that are prevalent throughout the code. Commits merged from dmd. Fix build of the D frontend on the Hurd and KFreeBSD. Initial patch from Matthias Klose. dlang/dmd#8893 Don't care about D/C++ compatibility in C++ port. Fixes build error in https://gcc.gnu.org/PR87788 dlang/dmd#8895 Allow compiling front-end headers with strict warnings. dlang/dmd#8909 Add root/system.h header for wrapping system includes. Fixes https://gcc.gnu.org/PR87865 dlang/dmd#8910 Move checkedint to dmd/root. dlang/dmd#8912 Use rmem instead of libc for malloc() and strdup(). dlang/dmd#8913 Use align(8) for alignment of UnionExp, fixing several BUS errors due to alignment issues on SPARC. dlang/dmd#8914 Don't pass NULL pointer as format parameter to errorSupplemental. dlang/dmd#8916 gcc/d/ChangeLog: 2018-11-05 Iain Buclaw <ibuclaw@gdcproject.org> PR d/87865 * d-system.h: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265780 138bc75d-0d04-0410-961f-82ee72b054a4
Portability of the front-end is not well covered for older targets.
For instance, while Solaris 11 can build just fine, Solaris 10 fails with:
This is because assert is not marked as noreturn in
<assert.h>
.GCC itself provides a couple of headers that wrap around vagaries of the host system to provide a consistent interface for maximum portability.
This patch then moves most front-end system includes into a central place, allowing gdc to override and provide its own copy of this header that includes the gcc headers, or provide gcc-specific portability fixes to the C++ sources.
I need to first check this against gdc to make sure it actually fits well.