[Cmake-commits] CMake branch, master, updated. v3.8.0-994-g34a083a

Kitware Robot kwrobot at kitware.com
Fri Apr 28 09:15:04 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  34a083a1951306aa9d0c0a5f14ac17706f475546 (commit)
       via  afb21342ead475a12636f29f7cd77cbe38d05ed1 (commit)
      from  02d11868827417e88cbbee795703421dfdb342f6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34a083a1951306aa9d0c0a5f14ac17706f475546
commit 34a083a1951306aa9d0c0a5f14ac17706f475546
Merge: 02d1186 afb2134
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 28 13:12:12 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 28 09:12:22 2017 -0400

    Merge topic 'bindexplib-consts'
    
    afb21342 bindexplib: fix constants symbols export
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !763


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=afb21342ead475a12636f29f7cd77cbe38d05ed1
commit afb21342ead475a12636f29f7cd77cbe38d05ed1
Author:     Mikhail Paulyshka <me at mixaill.tk>
AuthorDate: Wed Apr 26 00:37:37 2017 +0300
Commit:     Mikhail Paulyshka <me at mixaill.tk>
CommitDate: Wed Apr 26 22:23:33 2017 +0300

    bindexplib: fix constants symbols export

diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 6026a57..691e3ae 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -235,35 +235,29 @@ public:
               symbol.erase(posAt);
             }
           }
-          // For i386 builds we don't need to remove _
+          // For i386 builds we need to remove _
           if (this->IsI386 && symbol[0] == '_') {
             symbol.erase(0, 1);
           }
 
-          /*
-          Check whether it is "Scalar deleting destructor" and
-          "Vector deleting destructor"
-          */
+          // Check whether it is "Scalar deleting destructor" and "Vector
+          // deleting destructor"
+          // if scalarPrefix and vectorPrefix are not found then print the
+          // symbol
           const char* scalarPrefix = "??_G";
           const char* vectorPrefix = "??_E";
-          // original code had a check for
-          // symbol.find("real@") == std::string::npos)
-          // but if this disallows memmber functions with the name real
-          // if scalarPrefix and vectorPrefix are not found then print
-          // the symbol
           if (symbol.compare(0, 4, scalarPrefix) &&
               symbol.compare(0, 4, vectorPrefix)) {
             SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
                          .Characteristics;
-            if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) {
-              // Read only (i.e. constants) must be excluded
-              this->DataSymbols.insert(symbol);
-            } else {
-              if (pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ) ||
-                  (SectChar & IMAGE_SCN_MEM_EXECUTE)) {
-                this->Symbols.insert(symbol);
-              } else {
-                // printf(" strange symbol: %s \n",symbol.c_str());
+
+            if (SectChar & IMAGE_SCN_MEM_EXECUTE) {
+              this->Symbols.insert(symbol);
+            } else if (SectChar & IMAGE_SCN_MEM_READ) {
+              // skip __real@ and __xmm@
+              if (symbol.find("_real") == std::string::npos &&
+                  symbol.find("_xmm") == std::string::npos) {
+                this->DataSymbols.insert(symbol);
               }
             }
           }
diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c
index 4b1318b..e70fbb5 100644
--- a/Tests/RunCMake/AutoExportDll/foo.c
+++ b/Tests/RunCMake/AutoExportDll/foo.c
@@ -13,3 +13,5 @@ int bar()
 {
   return 5;
 }
+
+const char testconst[] = "testconst";
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index 51060e8..eb9c0ff 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -13,6 +13,14 @@ int WINAPI foo();
 int bar();
 int objlib();
 void justnop();
+
+// test const export
+#ifdef _WIN32
+// data symbols must be explicitly imported
+__declspec(dllimport) extern const char testconst[];
+#else
+extern const char testconst[];
+#endif
 }
 
 // test c++ functions
@@ -43,6 +51,8 @@ int main()
   bar();
   objlib();
   printf("\n");
+  printf("%s", testconst);
+  printf("\n");
 #ifdef HAS_JUSTNOP
   justnop();
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Source/bindexplib.cxx                |   32 +++++++++++++-------------------
 Tests/RunCMake/AutoExportDll/foo.c   |    2 ++
 Tests/RunCMake/AutoExportDll/say.cxx |   10 ++++++++++
 3 files changed, 25 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list