preprocessor macro to identify binutils version?
nick clifton
nickc@redhat.com
Wed Aug 14 11:10:00 GMT 2013
Hi Burlen,
> This is my first binutils foray. I'm making use of libbfd to provide
> detailed stack trace in an app if it crashes. In testing I've found
> systems[*] with older binutils where bfd_find_nearest_line segv's. I'd
> like to configure my app to disable the stack trace feature on systems
> with the older binutils. Is there a preprocessor macro that can be used
> to idnetify the binutils release? if not what's the best way to
> determine the binutils version?
The short answer is "no". :-(
You could try examining the __GNUC__, __GNUC_MINOR__ and
__GNUC_PATCHLEVEL__ preprocessor macros, on the assumption that older
binutils are matched with older versions of gcc.
You could add a configure time option to the app to disable the stack
trace and arrange for the configure scripts to automatically enable it
for known "old" platforms.
Cheers
Nick
More information about the Binutils
mailing list