Solution to unrecognized command line option "-frame-pointer" during compilation (Chen yunwen)
This error is reported because the current environment variable is incompatible. The program being compiled does not support the compilation optimization option-frame-pointer,
This compilation item is run in the environment variable cxxflags.
$ Echo cxxflags
Check whether this parameter is included by default. If the compilation encounters an error in the unrecognized command line, run the following command:
$ Cxxflags = ""
In this case, clear the cxxflags and re-run
./Configure
Command to generate Environment Variables
Run again
$ Echo cxxflags
Check whether the changes have been made.
And then re-compile./make.
Below are some additional-frame-pointer compilation options:
The GCC manual says this:
Don't keep the frame pointer in a register for functions that don't need one. this avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in your functions. it also makes debugging impossible on some machines.
On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn' t exist. the machine-description macro "frame_pointer_required" controls whether
A target machine supports this flag.
Here, we introduce the concept of "frame Pointer". What is "stack frame pointer (SFP?
We know that backtrace uses the information in the stack to traverse the function call relationship layer by layer. The stack information here is SFP.
Generally, each function contains a stack boundary pointer, that is, there will be a stack bottom and stack top pointer. In x86, if the stack develops from top to bottom, the bottom of the stack is a large address, and the top of the stack is a small address, the register ESP is usually the top pointer of the stack, the EBP is the pointer at the bottom of the stack. The space between EBP and ESP is the stack frame of this function.
By default, GCC adds some stack setting code at the beginning of each function, and restores the code when the function exits. SFP is set at this time. Let's take a look at the assembly code at this time.