diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -48,7 +48,7 @@ namespace opts { -cl::opt NoHugePages("no-huge-pages", +cl::opt NoHugePages("no-huge-pages", cl::init(true), cl::desc("use regular size pages for code alignment"), cl::Hidden, cl::cat(BoltCategory)); diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -1777,7 +1777,10 @@ opts::UseOldText = false; } - if (!opts::AlignText.getNumOccurrences()) + if (opts::Hugify || opts::HotText) + BC->PageAlign = BinaryContext::HugePageSize; + + if (opts::Hugify || opts::UseOldText) opts::AlignText = BC->PageAlign; if (opts::AlignText < opts::AlignFunctions) diff --git a/bolt/lib/Utils/CommandLineOpts.cpp b/bolt/lib/Utils/CommandLineOpts.cpp --- a/bolt/lib/Utils/CommandLineOpts.cpp +++ b/bolt/lib/Utils/CommandLineOpts.cpp @@ -42,7 +42,7 @@ cl::opt AlignText("align-text", cl::desc("alignment of .text section"), cl::Hidden, - cl::cat(BoltCategory)); + cl::init(64), cl::cat(BoltCategory)); cl::opt AlignFunctions( "align-functions",