Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.1] disable CFL Alias Analysis by default; fixes known cases of indeterministic build output #309

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/03_command-reference/cdt-cc.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ compiler options:
-finline-hint-functions - Inline functions which are (explicitly or implicitly) marked inline
-fmerge-all-constants - Allow merging of constants
-fnative - Compile and link for x86-64
-fno-cfl-aa - Disable CFL Alias Analysis
-fcfl-aa - Enable CFL Alias Analysis
-fno-elide-constructors - Disable C++ copy constructor elision
-fno-lto - Disable LTO
-fno-post-pass - Don't run post processing pass
Expand Down
2 changes: 1 addition & 1 deletion docs/03_command-reference/cdt-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ compiler options:
-finline-hint-functions - Inline functions which are (explicitly or implicitly) marked inline
-fmerge-all-constants - Allow merging of constants
-fnative - Compile and link for x86-64
-fno-cfl-aa - Disable CFL Alias Analysis
-cfl-aa - Enable CFL Alias Analysis
-fno-elide-constructors - Disable C++ copy constructor elision
-fno-lto - Disable LTO
-fno-post-pass - Don't run post processing pass
Expand Down
2 changes: 1 addition & 1 deletion docs/03_command-reference/cdt-ld.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ld options:
-L=<string> - Add directory to library search path
-fasm - Assemble file for x86-64
-fnative - Compile and link for x86-64
-fno-cfl-aa - Disable CFL Alias Analysis
-fcfl-aa - Enable CFL Alias Analysis
-fno-lto - Disable LTO
-fno-post-pass - Don't run post processing pass
-fno-stack-first - Don't set the stack first in memory
Expand Down
4 changes: 2 additions & 2 deletions docs/man/cdt-cc.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ execution in Antelope block chain virtual machines.

Compile and link for x86-64

**`--fno-cfl-aa`**
**`--fcfl-aa`**

Disable CFL Alias Analysis
Enable CFL Alias Analysis

**`--fno-elide-constructors`**

Expand Down
4 changes: 2 additions & 2 deletions docs/man/cdt-cpp.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ execution in Antelope block chain virtual machines.

Compile and link for x86-64

**`--fno-cfl-aa`**
**`--fcfl-aa`**

Disable CFL Alias Analysis
Enable CFL Alias Analysis

**`--fno-elide-constructors`**

Expand Down
4 changes: 2 additions & 2 deletions docs/man/cdt-ld.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ execution in Antelope block chain virtual machines.

Compile and link for x86-64

**`--fno-cfl-aa`**
**`--fcfl-aa`**

Disable CFL Alias Analysis
Enable CFL Alias Analysis

**`--fno-lto`**

Expand Down
1 change: 0 additions & 1 deletion tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include( CDTMacros )

macro(add_cdt_unit_test TEST_NAME)
add_native_executable(${TEST_NAME} ${TEST_NAME}.cpp)
target_compile_options(${TEST_NAME} PRIVATE -fno-cfl-aa)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(${TEST_NAME} PRIVATE -O2)
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand Down
8 changes: 4 additions & 4 deletions tools/include/compiler_options.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ static cl::opt<bool> fno_lto_opt(
"fno-lto",
cl::desc("Disable LTO"),
cl::cat(LD_CAT));
static cl::opt<bool> fno_cfl_aa_opt(
"fno-cfl-aa",
cl::desc("Disable CFL Alias Analysis"),
static cl::opt<bool> fcfl_aa_opt(
"fcfl-aa",
cl::desc("Enable CFL Alias Analysis"),
cl::cat(LD_CAT));
static cl::opt<bool> fno_stack_first_opt(
"fno-stack-first",
Expand Down Expand Up @@ -617,7 +617,7 @@ static Options CreateOptions(bool add_defaults=true) {
else
pp_dir = eosio::cdt::whereami::where();

if (!fno_cfl_aa_opt) {
if (fcfl_aa_opt) {
copts.emplace_back("-mllvm");
copts.emplace_back("-use-cfl-aa-in-codegen=both");
agopts.emplace_back("-mllvm");
Expand Down