Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

bitrig support #31

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ HOST_OS=@HOST_OS@
# Target operating system for which LLVM will compile for.
TARGET_OS=@TARGET_OS@

ifeq ($(TARGET_OS),Bitrig)
PROJ_docsdir := $(PROJ_prefix)/share/docs/llvm
PROJ_mandir := $(PROJ_prefix)/man
endif

# Host hardware architecture
HOST_ARCH=@HOST_ARCH@
# Target hardware architecture
Expand Down
2 changes: 1 addition & 1 deletion autoconf/config.sub
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -bitrig*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
Expand Down
22 changes: 21 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3966,6 +3966,11 @@ else
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="DragonFly"
llvm_cv_platform_type="Unix" ;;
*-*-bitrig*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="DragonFly"
llvm_cv_platform_type="Unix" ;;
*-*-hpux*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
Expand Down Expand Up @@ -4052,6 +4057,8 @@ else
llvm_cv_target_os_type="NetBSD" ;;
*-*-dragonfly*)
llvm_cv_target_os_type="DragonFly" ;;
*-*-bitrig*)
llvm_cv_target_os_type="Bitrig" ;;
*-*-hpux*)
llvm_cv_target_os_type="HP-UX" ;;
*-*-interix*)
Expand Down Expand Up @@ -9204,13 +9211,22 @@ fi

if test "$LLVM_ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then

if test "$llvm_cv_os_type" = "Bitrig" ; then
{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -pthread" >&5
echo $ECHO_N "checking for pthread_mutex_init in -pthread... $ECHO_C" >&6; }
else
{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; }
fi
if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
if test "$llvm_cv_os_type" = "Bitrig" ; then
LIBS="-pthread $LIBS"
else
LIBS="-lpthread $LIBS"
fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
Expand Down Expand Up @@ -9286,7 +9302,11 @@ if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
#define HAVE_LIBPTHREAD 1
_ACEOF

if test "$llvm_cv_os_type" = "Bitrig" ; then
LIBS="-pthread $LIBS"
else
LIBS="-lpthread $LIBS"
fi

fi

Expand Down
1 change: 1 addition & 0 deletions lib/Target/X86/X86Subtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ class X86Subtarget final : public X86GenSubtargetInfo {
bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
bool isTargetDragonFly() const { return TargetTriple.isOSDragonFly(); }
bool isTargetSolaris() const { return TargetTriple.isOSSolaris(); }
bool isTargetBitrig() const { return TargetTriple.isOSBitrig(); }

bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
Expand Down
12 changes: 9 additions & 3 deletions tools/llvm-config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc)

# Compute the substitution values for various items.
get_property(LLVM_SYSTEM_LIBS_LIST TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
foreach(l ${LLVM_SYSTEM_LIBS_LIST})
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
endforeach()
if (${CMAKE_SYSTEM_NAME} MATCHES "Bitrig")
foreach(l ${LLVM_SYSTEM_LIBS_LIST})
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-${l}")
endforeach()
else()
foreach(l ${LLVM_SYSTEM_LIBS_LIST})
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
endforeach()
endif()
string(REPLACE ";" " " SYSTEM_LIBS "${SYSTEM_LIBS}")

# Use configure_file to create BuildVariables.inc.
Expand Down