[cfe-dev] clang++ workaround for gcc's -mlarge-data-threshold flag?

Haoran Xu via cfe-dev cfe-dev at lists.llvm.org
Sun Sep 6 22:32:02 PDT 2020


Hi friendly clang developers,

I recently hit an issue on finding clang's equivalent flags for gcc's
'-mlarge-data-threshold' flag.

In g++, when specifying -mcmodel=medium, it would still place small-sized
data symbols in the first 2GB of RAM, and only data symbols larger than
'large-data-threshold' are put into higher RAM addresses.

It seems like clang++ supports '-mcmodel=medium' as well. However, it
unconditionally assumes everything could be in higher RAM addresses,
resulting in slightly less efficient instructions for small symbols, which
could just live in the first 2GB.

While this is of course a minor issue, I'm wondering if there is any
workaround for this issue? Any kind of workaround is welcomed -- just wanna
know if there's a way to somehow annotate a data symbol so it could live in
the first 2GB.

Thanks for your time!

(sorry if this message is posted twice, my first post might have bounced
since I was not a member of the list)

Best,
Haoran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200906/2a8637e6/attachment.html>


More information about the cfe-dev mailing list