This is an archive of the discontinued LLVM Phabricator instance.

[SPECCPU2017] Add CXXPORTABILITY flags for 526.blender_r
ClosedPublic

Authored by ychen on Dec 18 2019, 6:04 PM.

Details

Summary

as suggested by config/Example-aocc-linux-x86.cfg (v1.1) or config/Example-clang-llvm-linux-x86.cfg (v1.0)
Otherwise, it may fail to compile.

Event Timeline

ychen created this revision.Dec 18 2019, 6:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2019, 6:04 PM
Meinersbur requested changes to this revision.Dec 20 2019, 2:01 AM

[serious] Overriding CMAKE_CXX_FLAGS applies the change globally to everything in the test-suite. The file itself shows how it is done correctly right before the line you added.

This revision now requires changes to proceed.Dec 20 2019, 2:01 AM
ychen updated this revision to Diff 234997.EditedDec 20 2019, 6:26 PM

Thanks for the feedback. Obviously, my CMake skills needs to catch up. My
intention was to add the macro definition only for CXX compilation, but
add_definitions, add_compile_options change both C and CXX flags AFAIK at
the time. After some digging, it seems add_compile_options and
add_compile_definitions support cmake-generator-expressions that could be
used to implement this perfectly. However, add_compile_definitions was not
available until CMake v3.12, so I use add_compile_options here.

N.B. The cmake generator expression used here is not supported for Visual
Studio generator which does not need the macro definition. Do we actually care about build this on windows at all?

Thanks for the feedback. Obviously, my CMake skills needs to catch up. My
intention was to add the macro definition only for CXX compilation, but
add_definitions, add_compile_options change both C and CXX flags AFAIK at
the time.

Does defining __BOOL_DEFINED for C as well have any effect? If not, I'd define it for both languages for simplicity.

N.B. The cmake generator expression used here is not supported for Visual
Studio generator which does not need the macro definition. Do we actually care about build this on windows at all?

Many programs in the test-suite are POSIX-specific, e.g. they include unistd.h, sched.h, etc. I some point I gave up maintaining compatibility headers for windows and just compile the test-suite under WSL.

External/SPEC/CFP2017rate/526.blender_r/CMakeLists.txt
17

Did you consider using add_compile_options just for the generator-expression and keep the other as-is? We can do a clean-up once we raise the cmake requirement such that we can use add_compile_definitions.

Meinersbur accepted this revision.Jan 3 2020, 10:29 AM

With or without my suggestion, the change look fine.

This revision is now accepted and ready to land.Jan 3 2020, 10:29 AM
ychen updated this revision to Diff 236131.Jan 3 2020, 2:32 PM

address the comment

ychen marked an inline comment as done.Jan 3 2020, 2:35 PM

Thanks for the feedback. Obviously, my CMake skills needs to catch up. My
intention was to add the macro definition only for CXX compilation, but
add_definitions, add_compile_options change both C and CXX flags AFAIK at
the time.

Does defining __BOOL_DEFINED for C as well have any effect? If not, I'd define it for both languages for simplicity.

Defining __BOOL_DEFINED for C would cause build error.

N.B. The cmake generator expression used here is not supported for Visual
Studio generator which does not need the macro definition. Do we actually care about build this on windows at all?

Many programs in the test-suite are POSIX-specific, e.g. they include unistd.h, sched.h, etc. I some point I gave up maintaining compatibility headers for windows and just compile the test-suite under WSL.

Thanks. Good to know.