[Openmp-commits] [PATCH] D41499: [OMPT] Fix failing test cases for gcc on Ubuntu

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Dec 21 10:01:35 PST 2017


protze.joachim created this revision.
protze.joachim added reviewers: Hahnfeld, jlpeyton.

The compiler warns that _BSD_SOURCE is deprecated and _DEFAULT_SOURCE should be used instead. We keep _BSD_SOURCE for older compilers, that don't know about _DEFAULT_SOURCE.

The linker drops the tool when linking. So we need to tell the linker, that the tool should be linked anyway.


https://reviews.llvm.org/D41499

Files:
  runtime/test/ompt/callback.h
  runtime/test/ompt/loadtool/tool_available.c


Index: runtime/test/ompt/loadtool/tool_available.c
===================================================================
--- runtime/test/ompt/loadtool/tool_available.c
+++ runtime/test/ompt/loadtool/tool_available.c
@@ -7,9 +7,9 @@
 // RUN: %clang %flags -DTOOL -shared -fPIC %s -o %T/tool.so
 // 2. "introducing a dynamically-linked library that includes the tool’s definition of ompt_start_tool into the application’s address space"
 // 2.1 Link with tool during compilation
-// RUN: %libomp-compile -DCODE %T/tool.so && %libomp-run | FileCheck %s
+// RUN: %libomp-compile -DCODE -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
 // 2.2 Link with tool during compilation, but AFTER the runtime
-// RUN: %libomp-compile -DCODE -lomp %T/tool.so && %libomp-run | FileCheck %s
+// RUN: %libomp-compile -DCODE -lomp -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
 // 2.3 Inject tool via the dynamic loader
 // RUN: %libomp-compile -DCODE && %preload-tool %libomp-run | FileCheck %s
 
Index: runtime/test/ompt/callback.h
===================================================================
--- runtime/test/ompt/callback.h
+++ runtime/test/ompt/callback.h
@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #include <stdio.h>
 #include <inttypes.h>
 #include <omp.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41499.127878.patch
Type: text/x-patch
Size: 1301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20171221/74c2a497/attachment.bin>


More information about the Openmp-commits mailing list