This is the mail archive of the
mailing list for the binutils project.
Re: preprocessor macro to identify binutils version?
- From: nick clifton <nickc at redhat dot com>
- To: Burlen Loring <bloring at lbl dot gov>, binutils at sourceware dot org
- Date: Wed, 14 Aug 2013 12:08:08 +0100
- Subject: Re: preprocessor macro to identify binutils version?
- References: <51FBFF22 dot 6050107 at lbl dot gov>
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.