This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Pass -march=i686 when targeting i686 (PR24222)
ClosedPublic

Authored by hans on Jul 29 2015, 6:19 PM.

Details

Summary

Clang will not define i686, even when the target triple is i686,
without -march=i686.

With this patch, the compiler-rt build will successfully detect that
Clang can target i686.

The open_memstream.cc test is a little funny. Before my patch, it
was invoked with "-m32 -m64". To make it work after my -march
change, I had to add '-march='''.

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 30976.Jul 29 2015, 6:19 PM
hans retitled this revision from to [CMake] Pass -march=i686 when targeting i686 (PR24222).
hans updated this object.
hans added a reviewer: samsonov.
hans added subscribers: llvm-commits, hansw.
samsonov accepted this revision.Jul 29 2015, 6:25 PM
samsonov edited edge metadata.

LGTM. Thank you!

cmake/config-ix.cmake
183 ↗(On Diff #30976)

Please mention PR24222 in a comment here.

test/sanitizer_common/TestCases/Linux/open_memstream.cc
2 ↗(On Diff #30976)

Would -march=x86_64 work here?

This revision is now accepted and ready to land.Jul 29 2015, 6:25 PM
hans added inline comments.Jul 29 2015, 6:31 PM
cmake/config-ix.cmake
183 ↗(On Diff #30976)

Will do.

test/sanitizer_common/TestCases/Linux/open_memstream.cc
2 ↗(On Diff #30976)

Yes, but it has to be spelled -march=x86-64. Would you prefer that?

samsonov added inline comments.Jul 29 2015, 6:38 PM
test/sanitizer_common/TestCases/Linux/open_memstream.cc
2 ↗(On Diff #30976)

Yes please.

This revision was automatically updated to reflect the committed changes.