<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Cannot build with -DLIBOMP_OMP_VERSION=40"
   href="https://llvm.org/bugs/show_bug.cgi?id=30728">30728</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Cannot build with -DLIBOMP_OMP_VERSION=40
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Runtime Library
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pawel.osmialowski@foss.arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When building with -DLIBOMP_OMP_VERSION=40 compiler complains that
th_steal_lock and proxy fields are not defined.

A short workaround patch can make this code buildable with
-DLIBOMP_OMP_VERSION=40:

diff --git a/runtime/src/kmp.h b/runtime/src/kmp.h
index eff3c93..18d72a3 100644
--- a/runtime/src/kmp.h
+++ b/runtime/src/kmp.h
@@ -1738,16 +1738,16 @@ typedef struct kmp_disp {

     dispatch_private_info_t *th_disp_buffer;
     kmp_int32                th_disp_index;
-#if OMP_45_ENABLED
+// #if OMP_45_ENABLED
     kmp_int32                th_doacross_buf_idx; // thread's doacross buffer
index
     volatile kmp_uint32     *th_doacross_flags;   // pointer to shared array
of flags
     union { // we can use union here because doacross cannot be used in
nonmonotonic loops
         kmp_int64           *th_doacross_info;    // info on loop bounds
         kmp_lock_t          *th_steal_lock;       // lock used for chunk
stealing (8-byte variable)
diff --git a/runtime/src/kmp_tasking.c b/runtime/src/kmp_tasking.c
index 0c806c2..089620b 100644
--- a/runtime/src/kmp_tasking.c
+++ b/runtime/src/kmp_tasking.c
@@ -578,7 +578,11 @@ __kmp_free_task_and_ancestors( kmp_int32 gtid,
kmp_taskdata_t * taskdata, kmp_in
 {
     // Proxy tasks must always be allowed to free their parents
     // because they can be run in background even in serial mode.
+#if OMP_45_ENABLED
     kmp_int32 task_serial = taskdata->td_flags.task_serial &&
!taskdata->td_flags.proxy;
+#else
+    kmp_int32 task_serial = taskdata->td_flags.task_serial;
+#endif
     KMP_DEBUG_ASSERT( taskdata -> td_flags.tasktype == TASK_EXPLICIT );

     kmp_int32 children = KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata ->
td_allocated_child_tasks) ) - 1;

     };
-#else
-    void* dummy_padding[2]; // make it 64 bytes on Intel(R) 64
-#endif
+// #else
+//    void* dummy_padding[2]; // make it 64 bytes on Intel(R) 64
+// #endif
 #if KMP_USE_INTERNODE_ALIGNMENT
     char more_padding[INTERNODE_CACHE_LINE];
 #endif</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>