[Openmp-commits] [openmp] r321362 - [OMPT] Fix failing test cases for gcc on Ubuntu

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Fri Dec 22 08:40:32 PST 2017


Author: jprotze
Date: Fri Dec 22 08:40:32 2017
New Revision: 321362

URL: http://llvm.org/viewvc/llvm-project?rev=321362&view=rev
Log:
[OMPT] Fix failing test cases for gcc on Ubuntu

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, since there is no visible need for
the library. So we need to tell the linker, that the tool should be linked
anyway.

Differential Revision: https://reviews.llvm.org/D41499

Modified:
    openmp/trunk/runtime/test/ompt/callback.h
    openmp/trunk/runtime/test/ompt/loadtool/tool_available.c

Modified: openmp/trunk/runtime/test/ompt/callback.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/callback.h?rev=321362&r1=321361&r2=321362&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/callback.h (original)
+++ openmp/trunk/runtime/test/ompt/callback.h Fri Dec 22 08:40:32 2017
@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #include <stdio.h>
 #include <inttypes.h>
 #include <omp.h>

Modified: openmp/trunk/runtime/test/ompt/loadtool/tool_available.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/loadtool/tool_available.c?rev=321362&r1=321361&r2=321362&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/loadtool/tool_available.c (original)
+++ openmp/trunk/runtime/test/ompt/loadtool/tool_available.c Fri Dec 22 08:40:32 2017
@@ -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
 




More information about the Openmp-commits mailing list