Unrecognized command line option "-frame-pointer" SOLUTION

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.