lto Questions
1
Solved
5
Solved
I have the most recent cmake build and trying all build configurations (Debug, MinSizeRel, RelWithDebugInfo, Release, General) I see nowhere (text search) in generated makefiles the string -lto, so...
1
Why GCC does not do function dead code elimination with LTO when compiling the object file with -O0?
Example:
notmain.c
int __attribute__ ((noinline)) notmain(int i) {
return i + 1;
}
int notmain2(int i) {
return i + 2;
}
main.c
int notmain(int);
int main(int argc, char **argv) {
return notm...
2
Solved
Say I have a function
void do_something() {
//....
#ifdef FEATURE_X
feature_x();
#endif
//....
}
I can compile and run this with no problems; if I want the feature I can pass -D FEATURE_X a...
1
Solved
I am seeing LTO optimize some global objects out from a TU if there are no functions in that TU that are being explicitly from another TU.
The following excerpt attempts to describe the key classes...
2
In my project I have a lot of enumerations that need to have additional attributes associated with the enumeration members and auxiliary static methods associated with the enumeration type.
As muc...
Entertaining asked 30/12, 2012 at 12:8
1
Solved
1
Solved
Normally, one can get GCC's optimized assembler output from a source file using the -S flag in GCC and Clang, as in the following example.
gcc -O3 -S -c -o foo.s foo.c
But suppose I compile all ...
2
Solved
I'm trying to use link-time optimizations with the -flto flag of GCC (6.1.1).
While it works fine with my code, it doesn't link with a static linked library I'm also building and linking with my p...
4
Solved
1
I'm compiling some binaries on Mac, but the compiled size has become huge with more recent compiler (up to ~20MB from ~5MB before). I think it's related to LTO (link time optimization) that was not...
Dastard asked 27/1, 2021 at 18:3
1
Solved
I'm trying to cram a lot of code into a reasonably small ARM microcontroller. I've done a massive amount of work on size optimisation already, and I'm down to the point where I need double arithmet...
1
Solved
Clang allows to use a thin lto to speed up compilation time while still keeping most of the advantages of using lto with the option -flto=thin. Does gcc have an equivalent of clang's thin lto?
2
I've the following project in CMake 3.14.0, that builds a project for Visual Studio 2017 64 bit generator (minimum version is 3.10.0 because other developer can have previous versions of CMake, but...
Momentary asked 6/6, 2019 at 7:49
3
Solved
I would like to compile a shared library using both symbol versioning and link-time optimization (LTO). However, as soon as I turn on LTO, some of the exported symbols vanish. Here is a minimal exa...
2
Solved
When I try to build static libraries with -flto, I get undefined reference errors:
library.cpp:
#include <iostream>
void foo() {
std::cout << "Test!" << std::endl;
}
main.cp...
3
Solved
I have project, running on an ARM Cortex-M4 processor, where I'm trying to include the gcc link-time optimization (LTO) feature.
Currently my compilation and linking flags are:
CFLAGS = -ggdb -ff...
Wolsey asked 22/11, 2016 at 13:40
1
Solved
2
Solved
Introduction
I finished a small Rust project (about 300 lines of code) with the following dependencies:
rumqtt
signal
log
env_logger
Problem
When using cargo build --release without further c...
Outbalance asked 12/9, 2018 at 8:43
3
Solved
An LTO build of a rather large shared library (many template instantiations) takes rather long (>10min). Now I know a few things about the library, and could specify some kind of "blacklist" in the...
0
Code:
#include <iostream>
#include <string>
#include <fstream>
int main(int argc, char *argv[]) {
std::string filename = "dummyfile";
std::ifstream infile(filename);
std::str...
Indefatigable asked 29/1, 2018 at 16:21
3
Solved
2
Solved
I'm wandering which is the right way to compile static library on Linux with GCC in such way that when link time optimizations (LTO) be applied to the executable the library to be consumable and po...
1
Solved
I'm doing a gcc compile with -Wlto-type-mismatch and -Werror set (for the good of the rest of the project). I have an extern struct with a flexible array that is provoking an lto-type-mismatch warn...
1
What are the caveats and gotchas needed to keep in mind when writing code or build scripts for compilation with LTO?
The motivation behind this question is to understand better why some projects d...
Sheridansherie asked 14/2, 2017 at 15:33
1 Next >
© 2022 - 2024 — McMap. All rights reserved.