This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH V2 1/2] testsuite: Support detection of Intel compilers via test_compiler_version.

On 15/04/2016 16:59, Yao Qi wrote:
Bernhard Heckel <> 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

--- a/gdb/testsuite/lib/
+++ b/gdb/testsuite/lib/
@@ -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__} -]
+#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" -]
Do we really need the change to  Since we query the info of
compilers for different languages through c compiler, we don't need the
change unless we need to know the compiler info in some c++
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,
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]