public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Heckel, Bernhard" <bernhard.heckel@intel.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org, brobecker@adacore.com
Subject: Re: [PATCH V2 1/2] testsuite: Support detection of Intel compilers via test_compiler_version.
Date: Mon, 18 Apr 2016 06:26:00 -0000	[thread overview]
Message-ID: <57147D6B.9030403@intel.com> (raw)
In-Reply-To: <86k2jylxxu.fsf@gmail.com>

On 15/04/2016 16:59, Yao Qi wrote:
> Bernhard Heckel <bernhard.heckel@intel.com> writes:
>
>> Add Intel specific preprocessor macros to query the version of the compiler.
>>
> Looks you query the version of c/c++ compiler, and use it for fortran.
> Can we assume that fortran compiler's version is the same as the c/c++
> compiler version?  In an extreme case, user can set c compiler to icc,
> and set fortran compiler to gfortran.
>
> Looks we've already had such assumption in ada, that is, we determine
> ada compiler version by the c compiler, so I am OK to do the same for
> fortran.
>
>> --- a/gdb/testsuite/lib/compiler.cc
>> +++ b/gdb/testsuite/lib/compiler.cc
>> @@ -44,3 +44,15 @@ set compiler_info [join {armcc __ARMCC_VERSION} -]
>>   #if defined (__clang__)
>>   set compiler_info [join {clang __clang_major__ __clang_minor__ __clang_patchlevel__} -]
>>   #endif
>> +
>> +#if defined (__ICC)
>> +set icc_major [string range __ICC 0 1]
>> +set icc_minor [format "%d" [string range __ICC 2 [expr {[string length __ICC] -1}]]]
>> +set icc_update __INTEL_COMPILER_UPDATE
>> +set compiler_info [join "icc $icc_major $icc_minor $icc_update" -]
>> +#elif defined (__ICL)
>> +set icc_major [string range __ICL 0 1]
>> +set icc_minor [format "%d" [string range __ICL 2 [expr {[string length __ICL] -1}]]]
>> +set icc_update __INTEL_COMPILER_UPDATE
>> +set compiler_info [join "icc $icc_major $icc_minor $icc_update" -]
>> +#endif
> Do we really need the change to compiler.cc?  Since we query the info of
> compilers for different languages through c compiler, we don't need the
> change compiler.cc unless we need to know the compiler info in some c++
> tests.
get_compiler_info can be used with "c++" as argument. Even if 
test_compiler_info always uses "c"
I would like to have this completed.
>
>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>> index 1ef6a96..75c5e68 100644
>> --- a/gdb/testsuite/lib/gdb.exp
>> +++ b/gdb/testsuite/lib/gdb.exp
>> @@ -3553,6 +3553,9 @@ proc gdb_compile_shlib {sources dest options} {
>>                   lappend obj_options "additional_flags=-fpic"
>>               }
>>           }
>> +        "icc-*" {
>> +                lappend obj_options "additional_flags=-fpic"
>> +        }
> Why do we need this change?  How is it related to this patch series?
ICC was handled in the testsuite like GCC before, including the flags 
for compiling shared libraries.
If not set, compiling gdb.fortran/library-module-lib.f90 will fail.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2016-04-18  6:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 12:46 [PATCH V2 0/2] fortran: Testsuite, fix different type naming across compilers Bernhard Heckel
2016-04-15 12:47 ` [PATCH V2 2/2] " Bernhard Heckel
2016-04-15 14:41   ` Yao Qi
2016-04-18  7:15     ` Heckel, Bernhard
2016-04-15 12:47 ` [PATCH V2 1/2] testsuite: Support detection of Intel compilers via test_compiler_version Bernhard Heckel
2016-04-15 15:00   ` Yao Qi
2016-04-18  6:26     ` Heckel, Bernhard [this message]
2016-04-18  9:29       ` Yao Qi

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=57147D6B.9030403@intel.com \
    --to=bernhard.heckel@intel.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    /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).