Skip to content

Commit 09bfb3b

Browse files
committed
auto merge of #10970 : erickt/rust/master, r=alexcrichton
This modifies the `configure` to set `CFG_ENABLE_CLANG=1` if `gcc` is actually `clang`. This is needed because OS X's clang enables warning on unused command line arguments. Our build system suppresses this by default, but when `CFG_ENABLE_CLANGE=0`, we do not. This causes one of the tests to fail. This patch changes rust to directly use clang, which fixes the build failure. Closes #10811
2 parents 386b455 + 460a966 commit 09bfb3b

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

configure

+22-10
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ then
469469
PV_MINOR=${PV_MAJOR_MINOR#* }
470470
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
471471
then
472-
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"
473-
BAD_PANDOC=1
472+
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"
473+
BAD_PANDOC=1
474474
fi
475475
fi
476476

@@ -544,12 +544,24 @@ then
544544
putvar CFG_ENABLE_CLANG
545545
fi
546546

547-
548547
if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
549548
then
550549
err "either clang or gcc is required"
551550
fi
552551

552+
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
553+
# system, so if we find that gcc is clang, we should just use clang directly.
554+
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
555+
then
556+
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
557+
if [ $? -eq 0 ]
558+
then
559+
step_msg "on OS X 10.9, forcing use of clang"
560+
CFG_ENABLE_CLANG=1
561+
putvar CFG_ENABLE_CLANG
562+
fi
563+
fi
564+
553565
if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
554566
then
555567
step_msg "using custom LLVM at $CFG_LLVM_ROOT"
@@ -558,20 +570,20 @@ then
558570
LLVM_VERSION=$($LLVM_CONFIG --version)
559571

560572
case $LLVM_VERSION in
561-
(3.3|3.3svn|3.2|3.2svn)
562-
msg "found ok version of LLVM: $LLVM_VERSION"
563-
;;
564-
(*)
565-
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
566-
;;
573+
(3.3|3.3svn|3.2|3.2svn)
574+
msg "found ok version of LLVM: $LLVM_VERSION"
575+
;;
576+
(*)
577+
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
578+
;;
567579
esac
568580
fi
569581

570582
if [ ! -z "$CFG_ENABLE_CLANG" ]
571583
then
572584
if [ -z "$CFG_CLANG" ]
573585
then
574-
err "clang requested but not found"
586+
err "clang requested but not found"
575587
fi
576588
CFG_CLANG_VERSION=$("$CFG_CLANG" \
577589
--version \

0 commit comments

Comments
 (0)