Browse Source

Add code to define DISABLE_CPU_FEATURES_INIT, if mingw GDB executable does not contain it

git-svn-id: trunk@28940 -
pierre 10 years ago
parent
commit
6c8a00224f
1 changed files with 13 additions and 0 deletions
  1. 13 0
      packages/gdbint/gen-gdblib-inc.sh

+ 13 - 0
packages/gdbint/gen-gdblib-inc.sh

@@ -380,6 +380,15 @@ END {
 chmod u+x ./copy-libs.sh
 # For later
 
+# Check if mingw executable contains
+# __cpu_features_init function
+has_cpu_features_init=`objdump -t gdb.exe | grep cpu_features_init `
+if [ "X$has_cpu_features_init" == "X" ] ; then
+  mingw_no_cpu_features_init=1
+else
+  mingw_no_cpu_features_init=0
+fi
+
 echo Creating ./gdblib.inc file
 # Generate gdblib.inc file
 cat comp-cmd.log |${AWK} -v gdbcvs=${gdbcvs} \
@@ -387,6 +396,7 @@ cat comp-cmd.log |${AWK} -v gdbcvs=${gdbcvs} \
   -v gdbversion=${gdbversion} -v forcestatic=${forcestatic} \
   -v force64bitcoreaddr=${force64bitcoreaddr} \
   -v has_get_stdin=${has_get_stdin} \
+  -v mingw_no_cpu_features_init=${mingw_no_cpu_features_init} \
   -v add_libgdb=${add_libgdb} '
 BEGIN {
   use_mingw=0;
@@ -467,6 +477,9 @@ END {
   print "{$undef NotImplemented}"
   if ( use_mingw == 1 ) {
     print "{$define USE_MINGW_GDB}"
+    if ( mingw_no_cpu_features_init == 1 ) {
+      print "{$define DISABLE_CPU_FEATURES_INIT}"
+    }
   }
   if ( has_get_stdin == 1 ) {
     print "{$define LIBGDB_HAS_GET_STDIN}"