Enable build for other architecture without patching
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cmake, cpp
- Domain
- build-system, compilers
Research direction
Start by reading cmake/init-compilation-flags.cmake and compiler/compiler-settings.cpp to trace where the sandybridge flags are introduced and how compiler settings are assembled. Verify the build configuration and resulting compiler command for an x86_64 target; done means the generated binary uses configured or user-supplied architecture flags without requiring source patches.
Written by the indexing model from the issue text.
Description
Problem: kphp2cpp configured only with -march sandybridge, but application binary can be executed in KVM.
Solution: kphp2cpp must compile resulting binary with same flags as compiled or configured by cmake flags, or must don't set flags for using user-defined compiler flags.
I found two places:
cmake/init-compilation-flags.cmake
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- add_compile_options(-march=sandybridge -fno-common)
+ add_compile_options(-march=core2 -mpclmul -msse2 -fno-common)
add_link_options(-fno-common)
At here option must be configured by command line arguments.
compiler/compiler-settings.cpp
--- a/compiler/compiler-settings.cpp
+++ b/compiler/compiler-settings.cpp
@@ -280,7 +280,7 @@ void CompilerSettings::init() {
ss << " -Wall -fwrapv -Wno-parentheses -Wno-trigraphs";
ss << " -fno-strict-aliasing -fno-omit-frame-pointer";
#ifdef __x86_64__
- ss << " -march=sandybridge";
#endif
if (!no_pch.get()) {
at here option must be removed or reused from cmake options.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 116
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 11
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VKCOM/kphp
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Khan Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
.github/CODEOWNERS Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·