This is an archive of the discontinued LLVM Phabricator instance.

Fix the MIPS baremetal build
ClosedPublic

Authored by arichardson on Nov 30 2017, 9:58 AM.

Details

Summary

Currently sys/cachectl.h is used unconditionally on MIPS although it is
only available on Linux and will fail the build when targetting baremetal

Diff Detail

Repository
rL LLVM

Event Timeline

arichardson created this revision.Nov 30 2017, 9:58 AM
petarj accepted this revision.Nov 30 2017, 10:27 AM
This revision is now accepted and ready to land.Nov 30 2017, 10:27 AM
This revision was automatically updated to reflect the committed changes.

Please correct this commit. This header is also present on NetBSD/MIPS.

Please correct this commit. This header is also present on NetBSD/MIPS.

We can add

|| defined(__NetBSD__)

What about FreeBSD, is it the same?

I checked Linux, FreeBSD and MacOS and only found it one Linux so I assumed it was Linux specific (especially since the commit that introduced it (r228767) only mentions Linux.
Should I just add || defined(__NetBSD__) or are there any other systems that might have it?

Please correct this commit. This header is also present on NetBSD/MIPS.

We can add

|| defined(__NetBSD__)

What about FreeBSD, is it the same?

It's also unclear for me what is 'bare metal' about. FreeBSD should have the same header.

It looks like current NetBSD has it as <mips/cachectl.h>, my mistake.

Please correct this commit. This header is also present on NetBSD/MIPS.

We can add

|| defined(__NetBSD__)

What about FreeBSD, is it the same?

It's also unclear for me what is 'bare metal' about. FreeBSD should have the same header.

I grepped the FreeBSD source tree for cachectl and the only matches are LLVM and compiler-rt.
By baremetal I mean no operating system and only newlib running on MIPS qemu.

The original change (r228767) was tested on Linux only (including Android). I have never tested this part of the code on any *BSD system.

OK, so we can reschedule it for later. Excuse me for noise. It looks like compiler-rt wasn't built (in a while) on NetBSD/evbmips (release engineering machines test x86_64, i386, ppc, sparc, sparc64, arm). Once it will be done, we will address it.