Skip to content

[pull] master from openssl:master #663

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

Merged
merged 4 commits into from
Jun 20, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
--exclude "${PWD}/fuzz/*"
--exclude "/usr/include/*"
--ignore-errors mismatch
--branch-coverage
-o ./lcov.info
- name: Coveralls upload
uses: coverallsapp/github-action@v2.3.2
Expand Down
3 changes: 2 additions & 1 deletion Configurations/10-main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ my %targets = (
CXX => "g++",
CFLAGS => picker(default => "-Wall",
debug => "-O0 -g",
release => "-O3"),
release => "-O3",
pgo => "-O3 -fprofile-use -Wno-coverage-mismatch"),
CXXFLAGS => picker(default => "-Wall",
debug => "-O0 -g",
release => "-O3"),
Expand Down
3 changes: 3 additions & 0 deletions Configurations/unix-Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@ debuginfo: $(SHLIBS)
$(OBJCOPY) --strip-debug --add-gnu-debuglink=$$i.debug $$i; \
done;

cov-report: $(SHLIBS)
@set -e; gcovr -r . --txt-metric=branch --html --html-details -o openssl-metrics.html

##@ Documentation
build_generated_pods: $(GENERATED_PODS)
build_docs: build_man_docs build_html_docs ## Create documentation
Expand Down
4 changes: 4 additions & 0 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,10 @@ while (@argvcopy)
{
$config{build_type} = "release";
}
elsif (/^--pgo$/)
{
$config{build_type} = "pgo";
}
elsif (/^386$/)
{ $config{processor}=386; }
elsif (/^rsaref$/)
Expand Down
26 changes: 26 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ Build OpenSSL with debugging symbols and zero optimization level.

Build OpenSSL without debugging symbols. This is the default.

--coverage

Build OpenSSL with gcov profiling information included

--pgo

Build OpenSSL optimized using gcov data obtained from --coverage build

Directories
-----------

Expand Down Expand Up @@ -2033,6 +2041,24 @@ around the problem by forcing the build procedure to use the following script:
instead of the real clang. In which case it doesn't matter what clang version
is used, as it is the version of the GNU assembler that will be checked.

Notes on profile guided optimization
------------------------------------

Some compilers support the concept of profile guided optimization. This feature
allows a user to build openssl and use profiling data gathered while running an
application such that it can then be rebuilt in a way that is optimized specifically
for that application, increasing performance. Currently this feature is built into
the openssl build system for x86_64 only.

1) Configure openssl with the --coverage option. This will configure the compiler to
record profiling data for the libcrypto and libssl libraries
2) Run the application(s) which you wish to optimize for, ensuring that they use
the libraries compiled in step (1) (note this may entail the use of LD_LIBRARY_PATH)
3) Clean the openssl build with make clean. Note that the profile data (the .gcda and .gcno
files are retained through the clean operation). This is intentional.
4) Configure openssl again, but this time select the --pgo build type. This will use the
profiled data to optimize code layout for the application in question.

---

<!-- Links -->
Expand Down