Skip to content

Commit ac1c28e

Browse files
committed
Stick to clang inside llvm when jit-rebuild and some minor build fixes
Now it's nesessary to add clang 3.7 source into llvm-3.7.1cppbe source: cd <llvm_source>/tools git clone http://llvm.org/git/clang cd clang git checkout release_37 And then build and install llvm as usual.
1 parent a722526 commit ac1c28e

File tree

3 files changed

+16
-41
lines changed

3 files changed

+16
-41
lines changed

configure

+5-31
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,6 @@ with_wal_segsize
823823
with_CC
824824
enable_llvm_jit
825825
with_llvm_config
826-
with_clang
827826
enable_jit_rebuild
828827
enable_depend
829828
enable_cassert
@@ -1520,7 +1519,6 @@ Optional Packages:
15201519
set WAL segment size in MB [16]
15211520
--with-CC=CMD set compiler (deprecated)
15221521
--with-llvm-config=PATH how to run llvm-config
1523-
--with-clang=PATH how to run clang
15241522
--with-tcl build Tcl modules (PL/Tcl)
15251523
--with-tclconfig=DIR tclConfig.sh is in DIR
15261524
--with-perl build Perl modules (PL/Perl)
@@ -5277,27 +5275,6 @@ fi
52775275

52785276

52795277

5280-
# Check whether --with-clang was given.
5281-
if test "${with_clang+set}" = set; then :
5282-
withval=$with_clang;
5283-
case $withval in
5284-
yes)
5285-
as_fn_error $? "argument required for --with-clang option" "$LINENO" 5
5286-
;;
5287-
no)
5288-
as_fn_error $? "argument required for --with-clang option" "$LINENO" 5
5289-
;;
5290-
*)
5291-
5292-
;;
5293-
esac
5294-
5295-
fi
5296-
5297-
5298-
5299-
5300-
53015278
# Check whether --enable-jit-rebuild was given.
53025279
if test "${enable_jit_rebuild+set}" = set; then :
53035280
enableval=$enable_jit_rebuild;
@@ -15347,16 +15324,13 @@ $as_echo "$LLVM_VERSION bad" >&6; }
1534715324
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_VERSION ok" >&5
1534815325
$as_echo "$LLVM_VERSION ok" >&6; }
1534915326

15350-
clang="clang-3.7"
15351-
if test "x$with_clang" != "x"; then
15352-
clang=$with_clang
15353-
fi
15354-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang 3.7" >&5
15355-
$as_echo_n "checking for clang 3.7... " >&6; }
15356-
if $clang --version | grep "version 3.7" ; then :
15327+
clang=`$llvm_config --bindir`/clang;
15328+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang version 3.7.1cppbe" >&5
15329+
$as_echo_n "checking for clang version 3.7.1cppbe... " >&6; }
15330+
if $clang --version | grep "version 3.7.1cppbe" ; then :
1535715331

1535815332
else
15359-
as_fn_error $? "clang 3.7 required, unable to run using \"$clang\"" "$LINENO" 5
15333+
as_fn_error $? "clang 3.7.1cppbe required, unable to run using \"$clang\", pls build it inside LLVM" "$LINENO" 5
1536015334
fi
1536115335

1536215336
fi

configure.in

+5-9
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ PGAC_ARG_BOOL(enable, llvm-jit, yes, [turn off LLVM JIT],
557557
AC_SUBST(enable_llvm_jit)
558558

559559
PGAC_ARG_REQ(with, llvm-config, [PATH], [how to run llvm-config])
560-
PGAC_ARG_REQ(with, clang, [PATH], [how to run clang])
561560

562561
PGAC_ARG_BOOL(enable, jit-rebuild, no, [rebuild bitcode files and LLVM C++ API files])
563562
AC_SUBST(enable_jit_rebuild)
@@ -2057,7 +2056,7 @@ if test "$enable_llvm_jit" = yes ; then
20572056
LLVM_VERSION_MAJOR=`echo $LLVM_VERSION | grep -E '^[[0-9.]]+' | awk -F. '{print $1}'`
20582057
LLVM_VERSION_MINOR=`echo $LLVM_VERSION | grep -E '^[[0-9.]]+' | awk -F. '{print $2}'`
20592058
LLVM_VERSION_PATCH=`echo $LLVM_VERSION | grep -E '^[[0-9.]]+' | awk -F. '{print $3}'`
2060-
if (test "x$LLVM_VERSION_MAJOR" != "x3") || ((test "x$LLVM_VERSION_MINOR" != "x7")); then
2059+
if (test "x$LLVM_VERSION_MAJOR" != "x3") || (test "x$LLVM_VERSION_MINOR" != "x7"); then
20612060
AC_MSG_RESULT([$LLVM_VERSION bad])
20622061
AC_MSG_ERROR([LLVM version 3.7(.1) required])
20632062
fi
@@ -2071,13 +2070,10 @@ if test "$enable_llvm_jit" = yes ; then
20712070
fi
20722071
AC_MSG_RESULT([$LLVM_VERSION ok])
20732072

2074-
clang="clang-3.7"
2075-
if test "x$with_clang" != "x"; then
2076-
clang=$with_clang
2077-
fi
2078-
AC_MSG_CHECKING([for clang 3.7])
2079-
AS_IF([$clang --version | grep "version 3.7" ], [],
2080-
[AC_MSG_ERROR([clang 3.7 required, unable to run using "$clang"])])
2073+
clang=`$llvm_config --bindir`/clang;
2074+
AC_MSG_CHECKING([for clang version 3.7.1cppbe])
2075+
AS_IF([$clang --version | grep "version 3.7.1cppbe" ], [],
2076+
[AC_MSG_ERROR([clang 3.7.1cppbe required, unable to run using "$clang", pls build it inside LLVM])])
20812077
AC_SUBST(clang)
20822078
fi
20832079

src/backend/executor/llvm_backend/Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ subdir = src/backend/executor/llvm_backend
1212
top_builddir = ../../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15+
ifeq ($(enable_debug), yes)
16+
CXXFLAGS := $(shell $(llvm_config) --cxxflags)
17+
else
1518
CXXFLAGS := $(shell $(llvm_config) --cxxflags) -g0
19+
endif
20+
1621
LLVM_BACKEND_FILE_LIMIT := 50
1722
OBJS := llvm_backend_wrapper.o llvm_backend.a
1823

@@ -36,7 +41,7 @@ ifeq ($(enable_jit_rebuild), yes)
3641
LLC := $(BINDIR)/llc
3742

3843
OPT_OPTIONS := -O3
39-
CLANG_OPTS := $(CPPFLAGS) $(CFLAGS) -g0 \
44+
CLANG_OPTS := $(CPPFLAGS) $(CFLAGS) -O2 -g0 \
4045
-Wno-invalid-command-line-argument \
4146
-Wno-unused-command-line-argument \
4247
-Wno-ignored-attributes \

0 commit comments

Comments
 (0)