public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Arjen Markus <arjen.markus895@gmail.com>
To: Kay Diederichs <kay.diederichs@uni-konstanz.de>
Cc: Andre Vehreschild <vehre@gmx.de>, Fortran List <fortran@gcc.gnu.org>
Subject: Re: is there a way to find out gfortran version and/or options from a given binary?
Date: Wed, 1 Jun 2022 13:46:29 +0200	[thread overview]
Message-ID: <CAMCbSMpgZ2vFXoNJ0HZUNsyBfe_MqNgErMKj7oqHz2fEMOoSbQ@mail.gmail.com> (raw)
In-Reply-To: <CAMCbSMpBngB8EenWN+PVt0k6ijMV6td=nKMJ+YOQjWySOgkwPA@mail.gmail.com>

Are you sure that -g is the trigger? It may very well be that you need to
make sure that the optimiser does not eliminate the variable that holds the
identification. That is why I write the first character of these strings,
to make sure that the variables are retained. That could be achieved in all
manner of ways to fool the optimiser. Note that with -O2 and the program I
posted I still get the strings.

Regards,

Arjen

Op wo 1 jun. 2022 om 13:36 schreef Arjen Markus <arjen.markus895@gmail.com>:

> Hm, I ran it without any options - would that be equivalent to -g then? A
> rather awkward workaround might be to compile one source file containing
> this code with -g, but that is pushing things to the limit.
>
> Regards,
>
> Arjen
>
> Op wo 1 jun. 2022 om 12:16 schreef Kay Diederichs <
> kay.diederichs@uni-konstanz.de>:
>
>> I tried your suggestion below, but it does not store the options unless
>> the -g option is used.
>>
>> If -g is used, the executable _always_ has version and option info (no
>> extra code invoking compiler_version() and compiler_options() is
>> needed). Just use strings <binary> | grep GNU .
>> If -g is not used, no option info is in the executable.
>>
>> Best wishes,
>> Kay
>>
>> On 01.06.22 12:00, Arjen Markus wrote:
>> > staticv.f90 --
>> > !     Static information about the compiler? Not via parameters
>> > !
>> > program staticv
>> >      use iso_fortran_env
>> >
>> >      implicit none
>> >      character(len=200) :: c, d
>> >
>> >      c = compiler_version()
>> >      d = compiler_options()
>> >      write(*,*) c(1:1), d(1:)1
>> > end program staticv
>> >
>>
>> --
>> Kay Diederichs                http://strucbio.biologie.uni-konstanz.de
>> email: Kay.Diederichs@uni-konstanz.de             Tel +49 7531 88 4049
>> Fachbereich Biologie, Universität Konstanz, Box M647, D-78457 Konstanz
>>
>> This e-mail is digitally signed. If your e-mail client does not have the
>> necessary capabilities, just ignore the attached signature "smime.p7s".
>>
>

  reply	other threads:[~2022-06-01 11:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01  8:42 Kay Diederichs
2022-06-01  9:30 ` Arjen Markus
2022-06-01  9:41   ` Kay Diederichs
2022-06-01  9:50     ` Andre Vehreschild
2022-06-01  9:53       ` Arjen Markus
2022-06-01 10:00         ` Arjen Markus
2022-06-01 10:16           ` Kay Diederichs
2022-06-01 11:36             ` Arjen Markus
2022-06-01 11:46               ` Arjen Markus [this message]
2022-06-01 12:04                 ` Kay Diederichs
2022-06-01 12:19                   ` Arjen Markus
2022-06-02 19:06             ` Janne Blomqvist
2022-06-02 19:33               ` Kay Diederichs
2022-06-03  5:22                 ` Janne Blomqvist
2022-06-03  6:47                   ` Arjen Markus
     [not found]                     ` <14d31069-82ab-5a7a-2f35-15411da30141@uni-konstanz.de>
2022-06-03  7:30                       ` Arjen Markus
2022-06-03  8:16                         ` Janne Blomqvist
2022-06-03 10:12                           ` Kay Diederichs
2022-06-03 10:12                             ` Kay Diederichs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMCbSMpgZ2vFXoNJ0HZUNsyBfe_MqNgErMKj7oqHz2fEMOoSbQ@mail.gmail.com \
    --to=arjen.markus895@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=kay.diederichs@uni-konstanz.de \
    --cc=vehre@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).