llvm.org GIT mirror llvm / b0f6759
Add support for the OpenBSD for Bitrig. Patch by David Hill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161344 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
11 changed file(s) with 30 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
204204 *:OpenBSD:*:*)
205205 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206206 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207 exit ;;
208 *:Bitrig:*:*)
209 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
210 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
207211 exit ;;
208212 *:ekkoBSD:*:*)
209213 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
15591559 # These systems don't actually have a C library (as such)
15601560 test "X$arg" = "X-lc" && continue
15611561 ;;
1562 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1562 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
15631563 # Do not include libc due to us having libc/libc_r.
15641564 test "X$arg" = "X-lc" && continue
15651565 ;;
15791579 esac
15801580 elif test "X$arg" = "X-lc_r"; then
15811581 case $host in
1582 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1582 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | -*-*-bitrig*)
15831583 # Do not include libc_r directly, use -pthread flag.
15841584 continue
15851585 ;;
34633463 *-*-netbsd*)
34643464 # Don't link with libc until the a.out ld.so is fixed.
34653465 ;;
3466 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3466 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
34673467 # Do not include libc due to us having libc/libc_r.
34683468 ;;
34693469 *-*-sco3.2v5* | *-*-sco5v6*)
175175
176176 if test -n "$RANLIB"; then
177177 case $host_os in
178 openbsd*)
178 openbsd* | bitrig*)
179179 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
180180 ;;
181181 *)
728728 lt_cv_sys_max_cmd_len=8192;
729729 ;;
730730
731 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
731 netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | bitrig*)
732732 # This has been around since 386BSD, at least. Likely further.
733733 if test -x /sbin/sysctl; then
734734 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
16301630 shlibpath_overrides_runpath=yes
16311631 ;;
16321632
1633 openbsd*)
1633 openbsd* | bitrig*)
16341634 version_type=sunos
16351635 sys_lib_dlsearch_path_spec="/usr/lib"
16361636 need_lib_prefix=no
33813381 # C++ shared libraries are fairly broken
33823382 _LT_AC_TAGVAR(ld_shlibs, $1)=no
33833383 ;;
3384 openbsd*)
3384 openbsd* | bitrig*)
33853385 _LT_AC_TAGVAR(hardcode_direct, $1)=yes
33863386 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
33873387 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
60026002 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
60036003 ;;
60046004
6005 openbsd*)
6005 openbsd* | bitrig*)
60066006 _LT_AC_TAGVAR(hardcode_direct, $1)=yes
60076007 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
60086008 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
89468946 shlibpath_overrides_runpath=yes
89478947 ;;
89488948
8949 openbsd*)
8949 openbsd* | bitrig*)
89508950 version_type=sunos
89518951 sys_lib_dlsearch_path_spec="/usr/lib"
89528952 need_lib_prefix=no
9797 Minix,
9898 RTEMS,
9999 NativeClient,
100 CNK // BG/P Compute-Node Kernel
100 CNK, // BG/P Compute-Node Kernel
101 Bitrig
101102 };
102103 enum EnvironmentType {
103104 UnknownEnvironment,
5858 errorcode = pthread_mutexattr_settype(&attr, kind);
5959 assert(errorcode == 0);
6060
61 #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
61 #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
62 !defined(__DragonFly__) && !defined(__Bitrig__)
6263 // Make it a process local mutex
6364 errorcode = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
6465 assert(errorcode == 0);
123123 case RTEMS: return "rtems";
124124 case NativeClient: return "nacl";
125125 case CNK: return "cnk";
126 case Bitrig: return "bitrig";
126127 }
127128
128129 llvm_unreachable("Invalid OSType");
292293 .StartsWith("rtems", Triple::RTEMS)
293294 .StartsWith("nacl", Triple::NativeClient)
294295 .StartsWith("cnk", Triple::CNK)
296 .StartsWith("bitrig", Triple::Bitrig)
295297 .Default(Triple::UnknownOS);
296298 }
297299
259259 return Path(pathname);
260260 }
261261
262 #if defined(__FreeBSD__) || defined (__NetBSD__) || \
262 #if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
263263 defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__)
264264 static int
265265 test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
328328 if (realpath(exe_path, link_path))
329329 return Path(link_path);
330330 }
331 #elif defined(__FreeBSD__) || defined (__NetBSD__) || \
331 #elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
332332 defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__)
333333 char exe_path[PATH_MAX];
334334
1919 #ifdef HAVE_SYS_RESOURCE_H
2020 #include
2121 #endif
22 // DragonFly BSD has deprecated for instead,
23 // Unix.h includes this for us already.
24 #if defined(HAVE_MALLOC_H) && !defined(__DragonFly__)
22 // DragonFlyBSD, OpenBSD, and Bitrig have deprecated for
23 // instead. Unix.h includes this for us already.
24 #if defined(HAVE_MALLOC_H) && !defined(__DragonFly__) && \
25 !defined(__OpenBSD__) && !defined(__Bitrig__)
2526 #include
2627 #endif
2728 #ifdef HAVE_MALLOC_MALLOC_H
9090 // Exceptions handling
9191 ExceptionsType = ExceptionHandling::DwarfCFI;
9292
93 // OpenBSD has buggy support for .quad in 32-bit mode, just split into two
94 // .words.
95 if (T.getOS() == Triple::OpenBSD && T.getArch() == Triple::x86)
93 // OpenBSD and Bitrig have buggy support for .quad in 32-bit mode, just split
94 // into two .words.
95 if ((T.getOS() == Triple::OpenBSD || T.getOS() == Triple::Bitrig) &&
96 T.getArch() == Triple::x86)
9697 Data64bitsDirective = 0;
9798 }
9899
6262 endif
6363 endif
6464
65 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU))
65 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU Bitrig))
6666 # Include everything from the .a's into the shared library.
6767 LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
6868 -Wl,--no-whole-archive