summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/tools
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-02-28 09:42:41 +0000
committerAlp Toker <alp@nuanti.com>2014-02-28 09:42:41 +0000
commit763b93965c9d9da29193cab393cc45eefdcc35d4 (patch)
tree30314f813e308900e858d48ea5c1a3506bd4d008 /openmp/runtime/tools
parent6c6af852f924c51b91274b9b52184096bef4677e (diff)
downloadbcm5719-llvm-763b93965c9d9da29193cab393cc45eefdcc35d4.tar.gz
bcm5719-llvm-763b93965c9d9da29193cab393cc45eefdcc35d4.zip
Add support for FreeBSD
Port the OpenMP runtime to FreeBSD along with associated build system changes. Also begin to generalize affinity capabilities so they aren't tied explicitly to Windows and Linux. The port builds with stock clang and gmake and has no additional runtime dependencies. All but a handful of the validation suite tests are now passing on FreeBSD 10 x86_64. llvm-svn: 202478
Diffstat (limited to 'openmp/runtime/tools')
-rw-r--r--openmp/runtime/tools/common.inc3
-rw-r--r--openmp/runtime/tools/freebsd.inc13
-rw-r--r--openmp/runtime/tools/lib/Platform.pm3
-rw-r--r--openmp/runtime/tools/lib/Uname.pm8
4 files changed, 24 insertions, 3 deletions
diff --git a/openmp/runtime/tools/common.inc b/openmp/runtime/tools/common.inc
index 8eceb98e9b0..db13251672d 100644
--- a/openmp/runtime/tools/common.inc
+++ b/openmp/runtime/tools/common.inc
@@ -26,6 +26,9 @@ ifndef omp_os
ifeq ($(OS), Linux)
export omp_os=linux
endif
+ ifeq ($(OS), FreeBSD)
+ export omp_os=freebsd
+ endif
ifeq ($(OS), Darwin)
export omp_os=macos
endif
diff --git a/openmp/runtime/tools/freebsd.inc b/openmp/runtime/tools/freebsd.inc
new file mode 100644
index 00000000000..add7fe9d46d
--- /dev/null
+++ b/openmp/runtime/tools/freebsd.inc
@@ -0,0 +1,13 @@
+#
+#//===----------------------------------------------------------------------===//
+#//
+#// The LLVM Compiler Infrastructure
+#//
+#// This file is dual licensed under the MIT and the University of Illinois Open
+#// Source Licenses. See LICENSE.txt for details.
+#//
+#//===----------------------------------------------------------------------===//
+#
+
+include tools/linux.inc
+
diff --git a/openmp/runtime/tools/lib/Platform.pm b/openmp/runtime/tools/lib/Platform.pm
index d723174a29e..5b399f73866 100644
--- a/openmp/runtime/tools/lib/Platform.pm
+++ b/openmp/runtime/tools/lib/Platform.pm
@@ -170,6 +170,9 @@ sub target_options() {
if ( 0 ) {
} elsif ( $operating_system eq "GNU/Linux" ) {
$_host_os = "lin";
+ } elsif ( $operating_system eq "FreeBSD" ) {
+ # Host OS resembles Linux.
+ $_host_os = "lin";
} elsif ( $operating_system eq "Darwin" ) {
$_host_os = "mac";
} elsif ( $operating_system eq "MS Windows" ) {
diff --git a/openmp/runtime/tools/lib/Uname.pm b/openmp/runtime/tools/lib/Uname.pm
index 4eb6991f273..e212501e6db 100644
--- a/openmp/runtime/tools/lib/Uname.pm
+++ b/openmp/runtime/tools/lib/Uname.pm
@@ -139,11 +139,11 @@ $values{ processor } = $values{ machine };
# hardware_platform.
if ( 0 ) {
-} elsif ( $^O eq "linux" ) {
+} elsif ( $^O eq "linux" or $^O eq "freebsd" ) {
if ( 0 ) {
} elsif ( $values{ machine } =~ m{\Ai[3456]86\z} ) {
$values{ hardware_platform } = "i386";
- } elsif ( $values{ machine } =~ m{\Ax86_64\z} ) {
+ } elsif ( $values{ machine } =~ m{\A(x86_64|amd64)\z} ) {
$values{ hardware_platform } = "x86_64";
} elsif ( $values{ machine } =~ m{\Aarmv7\D*\z} ) {
$values{ hardware_platform } = "arm";
@@ -370,8 +370,10 @@ if ( 0 ) {
# $values{ operating_system_update } = $os_name[ 1 ];
} elsif ( $values{ kernel_name } =~ m{\ACYGWIN_NT-} ) {
$values{ operating_system } = "MS Windows";
+} elsif ( $values{ kernel_name } =~ m{\AFreeBSD} ) {
+ $values{ operating_system } = "FreeBSD";
} else {
- die "Unsuppoprted kernel_name (\"$values{ kernel_name }\") returned by POSIX::uname(); stopped";
+ die "Unsupported kernel_name (\"$values{ kernel_name }\") returned by POSIX::uname(); stopped";
}; # if
# host_name and domain_name
OpenPOWER on IntegriCloud