From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/gcc~13/cross-profiling.html | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 devdocs/gcc~13/cross-profiling.html (limited to 'devdocs/gcc~13/cross-profiling.html') diff --git a/devdocs/gcc~13/cross-profiling.html b/devdocs/gcc~13/cross-profiling.html new file mode 100644 index 00000000..65b432f6 --- /dev/null +++ b/devdocs/gcc~13/cross-profiling.html @@ -0,0 +1,9 @@ +

10.5 Data File Relocation to Support Cross-Profiling

Running the program will cause profile output to be generated. For each source file compiled with -fprofile-arcs, an accompanying .gcda file will be placed in the object file directory. That implicitly requires running the program on the same system as it was built or having the same absolute directory structure on the target system. The program will try to create the needed directory structure, if it is not already present.

To support cross-profiling, a program compiled with -fprofile-arcs can relocate the data files based on two environment variables:

For example, if the object file /user/build/foo.o was built with -fprofile-arcs, the final executable will try to create the data file /user/build/foo.gcda when running on the target system. This will fail if the corresponding directory does not exist and it is unable to create it. This can be overcome by, for example, setting the environment as ‘GCOV_PREFIX=/target/run’ and ‘GCOV_PREFIX_STRIP=1’. Such a setting will name the data file /target/run/build/foo.gcda.

You must move the data files to the expected directory tree in order to use them for profile directed optimizations (-fprofile-use), or to use the gcov tool.

+

+ © Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
+ https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Cross-profiling.html +

+
-- cgit v1.2.3