[med-svn] [Git][med-team/castxml][master] 4 commits: d/p:0004: add patch series for llvm7 support, Closes: #912561

Gert Wollny gitlab at salsa.debian.org
Sat Dec 1 15:57:57 GMT 2018


Gert Wollny pushed to branch master at Debian Med / castxml


Commits:
f2a2d175 by Gert Wollny at 2018-12-01T15:36:54Z
d/p:0004: add patch series for llvm7 support, Closes: #912561

- - - - -
ca7b2d01 by Gert Wollny at 2018-12-01T15:37:56Z
d/p/0002: Update patch

- - - - -
d42393ae by Gert Wollny at 2018-12-01T15:39:17Z
Update d/changelog

- - - - -
96a4587f by Gert Wollny at 2018-12-01T15:40:09Z
d/changelog: Update for release

- - - - -


4 changed files:

- debian/changelog
- debian/patches/0002-dont-install-license-file.patch
- + debian/patches/0004-llvm7.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+castxml (0.1+git20180702-2) unstable; urgency=medium
+
+  * Update changelog for upload [ci skip]
+  * d/control: cme fix dpkg   
+     -  add/correct VCS urls   
+     - update standards version to 4.1.5 (no changes neede)
+  * d/p:0004: add patch series for llvm7 support, Closes: #912561
+  * d/p/0002: Update patch
+
+ -- Gert Wollny <gewo at debian.org>  Sat, 01 Dec 2018 16:38:12 +0100
+
 castxml (0.1+git20180702-1) unstable; urgency=medium
 
   * New upstream version 0.1+git20180702 Closes: #902811


=====================================
debian/patches/0002-dont-install-license-file.patch
=====================================
@@ -1,7 +1,7 @@
 Description: don't install license file
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -118,7 +118,6 @@
+@@ -188,7 +188,6 @@
  install(DIRECTORY share/castxml/ DESTINATION "${CastXML_INSTALL_DATA_DIR}")
  
  install(FILES


=====================================
debian/patches/0004-llvm7.patch
=====================================
@@ -0,0 +1,399 @@
+diff --git a/README.rst b/README.rst
+index dc25912..42990e8 100644
+--- a/README.rst
++++ b/README.rst
+@@ -46,7 +46,9 @@ To build CastXML from source, first obtain the prerequisites:
+ * `LLVM/Clang`_ compiler SDK install tree built using the C++ compiler.
+   This version of CastXML has been tested with LLVM/Clang
+ 
+-  - SVN revision ``319768`` (trunk)
++  - SVN revision ``346978`` (trunk)
++  - Release ``7.0``
++  - Release ``6.0``
+   - Release ``5.0``
+   - Release ``4.0``
+   - Release ``3.9``
+diff --git a/share/castxml/detect_vs.c b/share/castxml/detect_vs.c
+index eca94bc..baa0f79 100644
+--- a/share/castxml/detect_vs.c
++++ b/share/castxml/detect_vs.c
+@@ -20,6 +20,9 @@
+ #define TO_DEFINE(x) "#define " #x " " TO_STRING(x)
+ 
+ #pragma message("")
++#ifdef __ATOM__
++# pragma message(TO_DEFINE(__ATOM__))
++#endif
+ #ifdef __AVX__
+ # pragma message(TO_DEFINE(__AVX__))
+ #endif
+@@ -32,6 +35,9 @@
+ #ifdef _CHAR_UNSIGNED
+ # pragma message(TO_DEFINE(_CHAR_UNSIGNED))
+ #endif
++#ifdef _CONTROL_FLOW_GUARD
++# pragma message(TO_DEFINE(_CONTROL_FLOW_GUARD))
++#endif
+ #ifdef _CPPRTTI
+ # pragma message(TO_DEFINE(_CPPRTTI))
+ #endif
+@@ -47,6 +53,12 @@
+ #ifdef _INTEGRAL_MAX_BITS
+ # pragma message(TO_DEFINE(_INTEGRAL_MAX_BITS))
+ #endif
++#ifdef _ISO_VOLATILE
++# pragma message(TO_DEFINE(_ISO_VOLATILE))
++#endif
++#ifdef _KERNEL_MODE
++# pragma message(TO_DEFINE(_KERNEL_MODE))
++#endif
+ #ifdef _MANAGED
+ # pragma message(TO_DEFINE(_MANAGED))
+ #endif
+@@ -77,6 +89,12 @@
+ #ifdef _M_ARM
+ # pragma message(TO_DEFINE(_M_ARM))
+ #endif
++#ifdef _M_ARM64
++# pragma message(TO_DEFINE(_M_ARM64))
++#endif
++#ifdef _M_ARM_ARMV7VE
++# pragma message(TO_DEFINE(_M_ARM_ARMV7VE))
++#endif
+ #ifdef _M_ARM_FP
+ # pragma message(TO_DEFINE(_M_ARM_FP))
+ #endif
+@@ -89,6 +107,18 @@
+ #ifdef _M_CEE_SAFE
+ # pragma message(TO_DEFINE(_M_CEE_SAFE))
+ #endif
++#ifdef _M_FP_EXCEPT
++# pragma message(TO_DEFINE(_M_FP_EXCEPT))
++#endif
++#ifdef _M_FP_FAST
++# pragma message(TO_DEFINE(_M_FP_FAST))
++#endif
++#ifdef _M_FP_PRECISE
++# pragma message(TO_DEFINE(_M_FP_PRECISE))
++#endif
++#ifdef _M_FP_STRICT
++# pragma message(TO_DEFINE(_M_FP_STRICT))
++#endif
+ #ifdef _M_IA64
+ # pragma message(TO_DEFINE(_M_IA64))
+ #endif
+@@ -116,6 +146,9 @@
+ #ifdef _OPENMP
+ # pragma message(TO_DEFINE(_OPENMP))
+ #endif
++#ifdef _PREFAST_
++# pragma message(TO_DEFINE(_PREFAST_))
++#endif
+ #ifdef _VC_NODEFAULTLIB
+ # pragma message(TO_DEFINE(_VC_NODEFAULTLIB))
+ #endif
+@@ -128,6 +161,9 @@
+ #ifdef _WIN64
+ # pragma message(TO_DEFINE(_WIN64))
+ #endif
++#ifdef _WINRT_DLL
++# pragma message(TO_DEFINE(_WINRT_DLL))
++#endif
+ #ifdef _Wp64
+ # pragma message(TO_DEFINE(_Wp64))
+ #endif
+@@ -137,3 +173,9 @@
+ #ifdef __MSVC_RUNTIME_CHECKS
+ # pragma message(TO_DEFINE(__MSVC_RUNTIME_CHECKS))
+ #endif
++#ifdef __STDC__
++# pragma message(TO_DEFINE(__STDC__))
++#endif
++#ifdef __STDC_HOSTED__
++# pragma message(TO_DEFINE(__STDC_HOSTED__))
++#endif
+diff --git a/share/castxml/detect_vs.cpp b/share/castxml/detect_vs.cpp
+index 2b24955..2c81137 100644
+--- a/share/castxml/detect_vs.cpp
++++ b/share/castxml/detect_vs.cpp
+@@ -20,6 +20,9 @@
+ #define TO_DEFINE(x) "#define " #x " " TO_STRING(x)
+ 
+ #pragma message("")
++#ifdef __ATOM__
++# pragma message(TO_DEFINE(__ATOM__))
++#endif
+ #ifdef __AVX__
+ # pragma message(TO_DEFINE(__AVX__))
+ #endif
+@@ -32,6 +35,9 @@
+ #ifdef _CHAR_UNSIGNED
+ # pragma message(TO_DEFINE(_CHAR_UNSIGNED))
+ #endif
++#ifdef _CONTROL_FLOW_GUARD
++# pragma message(TO_DEFINE(_CONTROL_FLOW_GUARD))
++#endif
+ #ifdef _CPPRTTI
+ # pragma message(TO_DEFINE(_CPPRTTI))
+ #endif
+@@ -47,6 +53,12 @@
+ #ifdef _INTEGRAL_MAX_BITS
+ # pragma message(TO_DEFINE(_INTEGRAL_MAX_BITS))
+ #endif
++#ifdef _ISO_VOLATILE
++# pragma message(TO_DEFINE(_ISO_VOLATILE))
++#endif
++#ifdef _KERNEL_MODE
++# pragma message(TO_DEFINE(_KERNEL_MODE))
++#endif
+ #ifdef _MANAGED
+ # pragma message(TO_DEFINE(_MANAGED))
+ #endif
+@@ -80,6 +92,12 @@
+ #ifdef _M_ARM
+ # pragma message(TO_DEFINE(_M_ARM))
+ #endif
++#ifdef _M_ARM64
++# pragma message(TO_DEFINE(_M_ARM64))
++#endif
++#ifdef _M_ARM_ARMV7VE
++# pragma message(TO_DEFINE(_M_ARM_ARMV7VE))
++#endif
+ #ifdef _M_ARM_FP
+ # pragma message(TO_DEFINE(_M_ARM_FP))
+ #endif
+@@ -92,6 +110,18 @@
+ #ifdef _M_CEE_SAFE
+ # pragma message(TO_DEFINE(_M_CEE_SAFE))
+ #endif
++#ifdef _M_FP_EXCEPT
++# pragma message(TO_DEFINE(_M_FP_EXCEPT))
++#endif
++#ifdef _M_FP_FAST
++# pragma message(TO_DEFINE(_M_FP_FAST))
++#endif
++#ifdef _M_FP_PRECISE
++# pragma message(TO_DEFINE(_M_FP_PRECISE))
++#endif
++#ifdef _M_FP_STRICT
++# pragma message(TO_DEFINE(_M_FP_STRICT))
++#endif
+ #ifdef _M_IA64
+ # pragma message(TO_DEFINE(_M_IA64))
+ #endif
+@@ -119,6 +149,9 @@
+ #ifdef _OPENMP
+ # pragma message(TO_DEFINE(_OPENMP))
+ #endif
++#ifdef _PREFAST_
++# pragma message(TO_DEFINE(_PREFAST_))
++#endif
+ #ifdef _VC_NODEFAULTLIB
+ # pragma message(TO_DEFINE(_VC_NODEFAULTLIB))
+ #endif
+@@ -131,6 +164,9 @@
+ #ifdef _WIN64
+ # pragma message(TO_DEFINE(_WIN64))
+ #endif
++#ifdef _WINRT_DLL
++# pragma message(TO_DEFINE(_WINRT_DLL))
++#endif
+ #ifdef _Wp64
+ # pragma message(TO_DEFINE(_Wp64))
+ #endif
+@@ -140,6 +176,15 @@
+ #ifdef __MSVC_RUNTIME_CHECKS
+ # pragma message(TO_DEFINE(__MSVC_RUNTIME_CHECKS))
+ #endif
++#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
++# pragma message(TO_DEFINE(__STDCPP_DEFAULT_NEW_ALIGNMENT__))
++#endif
++#ifdef __STDCPP_STRICT_POINTER_SAFETY__
++# pragma message(TO_DEFINE(__STDCPP_STRICT_POINTER_SAFETY__))
++#endif
++#ifdef __STDCPP_THREADS__
++# pragma message(TO_DEFINE(__STDCPP_THREADS__))
++#endif
+ #ifdef __cplusplus
+ # pragma message(TO_DEFINE(__cplusplus))
+ #endif
+diff --git a/src/RunClang.cxx b/src/RunClang.cxx
+index 2bbcfcc..edf18a5 100644
+--- a/src/RunClang.cxx
++++ b/src/RunClang.cxx
+@@ -459,6 +459,15 @@ static clang::FrontendAction* CreateFrontendAction(clang::CompilerInstance* CI,
+   }
+ }
+ 
++static bool isObjC(clang::CompilerInstance* CI)
++{
++#if LLVM_VERSION_MAJOR >= 8
++  return CI->getLangOpts().ObjC;
++#else
++  return CI->getLangOpts().ObjC1 || CI->getLangOpts().ObjC2;
++#endif
++}
++
+ static bool runClangCI(clang::CompilerInstance* CI, Options const& opts)
+ {
+   // Create a diagnostics engine for this compiler instance.
+@@ -472,7 +481,7 @@ static bool runClangCI(clang::CompilerInstance* CI, Options const& opts)
+ 
+   if (opts.GccXml) {
+ #define MSG(x) "error: '--castxml-gccxml' does not work with " x "\n"
+-    if (CI->getLangOpts().ObjC1 || CI->getLangOpts().ObjC2) {
++    if (isObjC(CI)) {
+       std::cerr << MSG("Objective C");
+       return false;
+     }
+@@ -481,7 +490,7 @@ static bool runClangCI(clang::CompilerInstance* CI, Options const& opts)
+ 
+   if (opts.CastXml) {
+ #define MSG(x) "error: '--castxml-output=<v>' does not work with " x "\n"
+-    if (CI->getLangOpts().ObjC1 || CI->getLangOpts().ObjC2) {
++    if (isObjC(CI)) {
+       std::cerr << MSG("Objective C");
+       return false;
+     }
+diff --git a/src/Utils.cxx b/src/Utils.cxx
+index 1794671..a7b5245 100644
+--- a/src/Utils.cxx
++++ b/src/Utils.cxx
+@@ -147,12 +147,20 @@ bool runCommand(int argc, const char* const* argv, int& ret, std::string& out,
+   redirects[2] = &errFile;
+ #endif
+ 
++#if LLVM_VERSION_MAJOR >= 7
++  llvm::SmallVector<llvm::StringRef, 64> cmd(argv, argv + argc);
++  llvm::ArrayRef<llvm::StringRef> args = cmd;
++  llvm::Optional<llvm::ArrayRef<llvm::StringRef>> env = llvm::None;
++#else
+   std::vector<const char*> cmd(argv, argv + argc);
+   cmd.push_back(0);
++  const char** args = &*cmd.begin();
++  const char** env = nullptr;
++#endif
+ 
+   // Actually run the command.
+-  ret = llvm::sys::ExecuteAndWait(prog, &*cmd.begin(), nullptr, redirects, 0,
+-                                  0, &msg, nullptr);
++  ret =
++    llvm::sys::ExecuteAndWait(prog, args, env, redirects, 0, 0, &msg, nullptr);
+ 
+   // Load the output from the temporary files.
+   {
+diff --git a/src/castxml.cxx b/src/castxml.cxx
+index 7c39e78..4989857 100644
+--- a/src/castxml.cxx
++++ b/src/castxml.cxx
+@@ -28,6 +28,10 @@
+ #include "llvm/Support/TargetSelect.h"
+ #include "llvm/Support/raw_ostream.h"
+ 
++#if LLVM_VERSION_MAJOR >= 7
++#include "llvm/Support/InitLLVM.h"
++#endif
++
+ #include <iostream>
+ #include <set>
+ #include <sstream>
+@@ -55,22 +59,29 @@ int main(int argc_in, const char** argv_in)
+ {
+   suppressInteractiveErrors();
+ 
+-  llvm::InitializeAllTargets();
+-  llvm::InitializeAllTargetMCs();
+-  llvm::InitializeAllAsmPrinters();
+-  llvm::InitializeAllAsmParsers();
+-
++#if LLVM_VERSION_MAJOR >= 7
++  llvm::InitLLVM initLLVM(argc_in, argv_in);
++  llvm::SmallVector<const char*, 64> argv(argv_in, argv_in + argc_in);
++#else
+   llvm::SmallVector<const char*, 64> argv;
+   llvm::SpecificBumpPtrAllocator<char> argAlloc;
+   if (std::error_code e = llvm::sys::Process::GetArgumentVector(
+         argv, llvm::ArrayRef<const char*>(argv_in, argc_in), argAlloc)) {
+     llvm::errs() << "error: could not get arguments: " << e.message() << "\n";
+     return 1;
+-  } else if (argv.empty()) {
++  }
++#endif
++
++  if (argv.empty()) {
+     llvm::errs() << "error: no argv[0]?!\n";
+     return 1;
+   }
+ 
++  llvm::InitializeAllTargets();
++  llvm::InitializeAllTargetMCs();
++  llvm::InitializeAllAsmPrinters();
++  llvm::InitializeAllAsmParsers();
++
+ #if LLVM_VERSION_MAJOR > 3 ||                                                 \
+   LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
+   llvm::BumpPtrAllocator argSaverAlloc;
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 1ad5ff1..cc72d78 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -394,6 +394,7 @@ castxml_test_cmd(cc-msvc-std-c++98 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc>
+ castxml_test_cmd(cc-msvc-std-c++11 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1600 ")" ${empty_cxx} "-###")
+ castxml_test_cmd(cc-msvc-std-c++14 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 ")" ${empty_cxx} "-###")
+ castxml_test_cmd(cc-msvc-std-c++17 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 -msvc_lang=201703L ")" ${empty_cxx} "-###")
++castxml_test_cmd(cc-msvc-std-c++17-E --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 -msvc_lang=201703L -stdcpp_default_new_alignment=16ll ")" ${empty_cxx} -E -dM)
+ castxml_test_cmd(cc-msvc-std-explicit --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1500 ")" -std=gnu++14 ${empty_cxx} "-###")
+ castxml_test_cmd(cc-msvc-builtin-1800-E --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1800 ")" ${empty_cxx} -E -dM)
+ castxml_test_cmd(cc-msvc-builtin-1900-E --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> -msc=1900 ")" ${empty_cxx} -E -dM)
+diff --git a/test/cc-msvc.c b/test/cc-msvc.c
+index 45feff8..b20121e 100644
+--- a/test/cc-msvc.c
++++ b/test/cc-msvc.c
+@@ -6,14 +6,17 @@ int main(int argc, const char* argv[])
+   int cpp = 0;
+   const char* msc_ver = "1600";
+   const char* msvc_lang = 0;
++  const char* stdcpp_default_new_alignment = 0;
+   int i;
+   for (i = 1; i < argc; ++i) {
+     if (strncmp(argv[i], "--cc-define=", 12) == 0) {
+       fprintf(stdout, "\n#define %s 1", argv[i]+12);
+     } else if (strncmp(argv[i], "-msc=", 5) == 0) {
+       msc_ver = argv[i]+5;
+-    } else if (strncmp(argv[i], "-msvc_lang=", 8) == 0) {
++    } else if (strncmp(argv[i], "-msvc_lang=", 11) == 0) {
+       msvc_lang = argv[i]+11;
++    } else if (strncmp(argv[i], "-stdcpp_default_new_alignment=", 30) == 0) {
++      stdcpp_default_new_alignment = argv[i]+30;
+     } else if (strstr(argv[i], ".cpp")) {
+       cpp = 1;
+     }
+@@ -34,6 +37,11 @@ int main(int argc, const char* argv[])
+       "#define _MSVC_LANG %s\n", msvc_lang
+       );
+   }
++  if(stdcpp_default_new_alignment) {
++    fprintf(stdout,
++      "#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ %s\n",
++      stdcpp_default_new_alignment);
++  }
+   fprintf(stdout,
+     "#define __has_include(x) x\n"
+     "#define __has_include_next(x) x\n"
+diff --git a/test/expect/cmd.cc-msvc-std-c++17-E.stdout.txt b/test/expect/cmd.cc-msvc-std-c++17-E.stdout.txt
+new file mode 100644
+index 0000000..4015351
+--- /dev/null
++++ b/test/expect/cmd.cc-msvc-std-c++17-E.stdout.txt
+@@ -0,0 +1,11 @@
++^#define _MSC_VER 1900
++#define _MSVC_LANG 201703L
++#define _WIN32 1
++#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16ll
++#define __castxml__ [0-9]+
++#define __castxml_clang_major__ [0-9]+
++#define __castxml_clang_minor__ [0-9]+
++#define __castxml_clang_patchlevel__ [0-9]+
++#define __cplusplus 199711L
++#define __is_assignable\(_To,_Fr\) \(sizeof\(__castxml__is_assignable_check<_To,_Fr>\(0\)\) == sizeof\(char\(&\)\[1\]\)\)(
++#define __make_integer_seq __castxml__make_integer_seq)?$


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 0001-fix-version-test-to-allow-text-before-clang.patch
 0002-dont-install-license-file.patch
 0003-fix-dynamic-linking.patch
+0004-llvm7.patch



View it on GitLab: https://salsa.debian.org/med-team/castxml/compare/6157bd677f8866aee67b3a12cca00588275e29a9...96a4587f7544fd72b7cd7f00f993600feced1853

-- 
View it on GitLab: https://salsa.debian.org/med-team/castxml/compare/6157bd677f8866aee67b3a12cca00588275e29a9...96a4587f7544fd72b7cd7f00f993600feced1853
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20181201/eca204d4/attachment-0001.html>


More information about the debian-med-commit mailing list