This is an archive of the discontinued LLVM Phabricator instance.

[mips] Define macros related to -mabicalls in the preprocessor
AbandonedPublic

Authored by sdardis on Jan 23 2017, 6:14 AM.

Details

Reviewers
slthakur
Summary

Historically, NetBSD, FreeBSD and OpenBSD have defined the macro ABICALLS in
the preprocessor when -mabicalls is in effect.

Mainline GCC later defined __mips_abicalls when -mabicalls is in effect.

This patch teaches the preprocessor to define these macros when appropriate.

This resolves PR/31694.

Thanks to Sean Bruno for highlighting this issue!

Event Timeline

sdardis created this revision.Jan 23 2017, 6:14 AM
sdardis edited the summary of this revision. (Show Details)Jan 23 2017, 6:17 AM
emaste added inline comments.Jan 23 2017, 6:31 AM
lib/Basic/Targets.cpp
7653

If GCC always defines this one with abicalls (including on the BSDs) I think we should do the same.

sdardis abandoned this revision.Jan 23 2017, 8:37 AM

I've reposted this to: https://reviews.llvm.org/D29032

lib/Basic/Targets.cpp
7653

It's an oddity, but FreeBSD's gcc/config/mips/mips.h doesn't define __mips_abicalls :

https://svn.freebsd.org/base/head/contrib/gcc/config/mips/mips.h

The definition of TARGET_CPU_CPP_BUILTINS doesn't include __mips_abicalls , even on 6.3.0 from the FreeBSD ports collection.

Contrast with : https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/mips/mips.h?view=markup#l595

and TARGET_CPU_CPP_BUILTINS does define __mips_abicalls.