]> granicus.if.org Git - clang/commitdiff
Merging r292119:
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 19 Jan 2017 00:10:50 +0000 (00:10 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 19 Jan 2017 00:10:50 +0000 (00:10 +0000)
------------------------------------------------------------------------
r292119 | joerg | 2017-01-16 15:07:24 +0100 (Mo, 16. Jan 2017) | 3 Zeilen

Ensure that clang -pthread creates the right macro. -D_POSIX_THREADS
seems to have been a C&P error from old GCC specs for OpenBSD.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292451 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/Driver/netbsd.c

index 89e3f3ebbe3f7186fa55cbd2c95e3e9aa6761796..1a95ff26816e78ea690420520c783086414a2597 100644 (file)
@@ -512,7 +512,7 @@ protected:
     Builder.defineMacro("__unix__");
     Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
-      Builder.defineMacro("_POSIX_THREADS");
+      Builder.defineMacro("_REENTRANT");
 
     switch (Triple.getArch()) {
     default:
index 5558a80b98600deb02c225f4c5bc9be07e3dbe41..06b5eadfca857bc040f41570d4f76ac4e6c4dfe5 100644 (file)
 // RUN: %clang -no-canonical-prefixes -target powerpc64--netbsd -static \
 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
 // RUN: | FileCheck -check-prefix=S-POWERPC64 %s
+// RUN: %clang -target x86_64--netbsd -pthread -dM -E %s \
+// RUN: | FileCheck -check-prefix=PTHREAD %s
 
 // STATIC: ld{{.*}}" "--eh-frame-hdr"
 // STATIC-NOT: "-pie"
 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// PTHREAD-NOT: _POSIX_THREADS
+// PTHREAD:     _REENTRANT
+// PTHREAD-NOT: _POSIX_THREADS