Re: Question on multiple compiler environment



Mark Westwood wrote:

(snip)

But what I really want is a way of determining, from the binary, what
compiler flags were used in its creation. I suspect that the only way
of doing this is to get to grips with the autotools and, as one earlier
poster suggested, that looks HARD.

Most C compilers set preprocessor symbols for things like the OS, compiler, compiler version, and maybe a few more. I don't know of any
that set flags, but you could add them with -D in the Makefile or other
compilation method. That should work if you use the C preprocessor on
Fortran code.

Otherwise, compilers that write debugging data to the object file,
such as the -g option on GNU compilers, might also write compilation
flags. It would be system dependent, though.

-- glen

.



Relevant Pages

  • Re: amd64 bitops fix for -Os
    ... > kernel build. ... because its inline asm assumes at least one iteration ... the generated code is such that the flags ... although in a perfect world the compiler would be ...
    (Linux-Kernel)
  • Re: [PATCH 3/3] Enforce "unsigned long flags;" when spinlocking
    ... something different from "unsigned long flags;". ... This is a pretty ugly-looking patch. ... I want build system, compiler, headers etc to do everything against ... sparse spits warning ...
    (Linux-Kernel)
  • Re: Kernel ARCH i586 i686 - need clarification
    ... The more interesting answer will be found in the source for the kernel ... The compiler flags are interesting. ... T o m M i t c h e l l spam unwanted email. ...
    (Fedora)
  • Re: Simulating the button click event programatically ....
    ... they don't affect the expression's meaning to the compiler. ... cannot both care and not care to know the answer. ... instructions. ... Then various CPU flags are set according to the result, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Open Source EC++ Implementation?
    ... compiler anyway, so optimisation will be very similar. ... My idea is if I use these two flags, then the size of generated code ... But exception *propagation* can require overhead in the generated code - a function that calls another function must be able to pass exceptions back up the chain, even if it does not use exceptions itself. ... Thus you have one less problem to worry about there (assuming you use avrgcc - I don't know how things stand with something like IAR's AVR C++ compiler). ...
    (comp.arch.embedded)