Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit640a4ba

Browse files
committed
Postpone LLVM-related uses of AC_CHECK_DECLS.
Calling AC_CHECK_DECLS before we've finished setting up the compiler'sCFLAGS seems like a pretty risky proposition, especially now that thefirst use of that macro will result in a test to see whether the compilergives warning or error for undeclared built-in functions. That answercould very easily get changed later than where PGAC_LLVM_SUPPORT iscalled; furthermore, it's hardly unlikely that flags such as -D_GNU_SOURCEcould change visibility of declarations. Hence, be a little less cavalierabout where to do LLVM-related tests. This results in v11 and HEAD doingthe warning-or-error check at the same place in the script as olderbranches are doing it, which seems like a good thing.Per further thought about commits0b59b0e and16fbac3.
1 parent6e5f8d4 commit640a4ba

File tree

3 files changed

+230
-211
lines changed

3 files changed

+230
-211
lines changed

‎config/llvm.m4

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# config/llvm.m4
22

33
# PGAC_LLVM_SUPPORT
4-
# ---------------
4+
# -----------------
55
#
66
# Look for the LLVM installation, check that it's new enough, set the
77
# corresponding LLVM_{CFLAGS,CXXFLAGS,BINPATH} and LDFLAGS
8-
# variables. Alsoverifies that CLANG is available, to transform C
8+
# variables. Alsoverify that CLANG is available, to transform C
99
# into bitcode.
1010
#
1111
AC_DEFUN([PGAC_LLVM_SUPPORT],
@@ -91,14 +91,6 @@ AC_DEFUN([PGAC_LLVM_SUPPORT],
9191
9292
LLVM_BINPATH=`$LLVM_CONFIG --bindir`
9393
94-
# Check which functionality is present
95-
SAVE_CPPFLAGS="$CPPFLAGS"
96-
CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
97-
AC_CHECK_DECLS([LLVMOrcGetSymbolAddressIn],[],[],[[#include <llvm-c/OrcBindings.h>]])
98-
AC_CHECK_DECLS([LLVMGetHostCPUName, LLVMGetHostCPUFeatures],[],[],[[#include <llvm-c/TargetMachine.h>]])
99-
AC_CHECK_DECLS([LLVMCreateGDBRegistrationListener, LLVMCreatePerfJITEventListener],[],[],[[#include <llvm-c/ExecutionEngine.h>]])
100-
CPPFLAGS="$SAVE_CPPFLAGS"
101-
10294
# LLVM_CONFIG, CLANG are already output via AC_ARG_VAR
10395
AC_SUBST(LLVM_LIBS)
10496
AC_SUBST(LLVM_CPPFLAGS)
@@ -107,3 +99,22 @@ AC_DEFUN([PGAC_LLVM_SUPPORT],
10799
AC_SUBST(LLVM_BINPATH)
108100
109101
])# PGAC_LLVM_SUPPORT
102+
103+
104+
# PGAC_CHECK_LLVM_FUNCTIONS
105+
# -------------------------
106+
#
107+
# Check presence of some optional LLVM functions.
108+
# (This shouldn't happen until we're ready to run AC_CHECK_DECLS tests;
109+
# because PGAC_LLVM_SUPPORT runs very early, it's not an appropriate place.)
110+
#
111+
AC_DEFUN([PGAC_CHECK_LLVM_FUNCTIONS],
112+
[
113+
# Check which functionality is present
114+
SAVE_CPPFLAGS="$CPPFLAGS"
115+
CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
116+
AC_CHECK_DECLS([LLVMOrcGetSymbolAddressIn],[],[],[[#include <llvm-c/OrcBindings.h>]])
117+
AC_CHECK_DECLS([LLVMGetHostCPUName, LLVMGetHostCPUFeatures],[],[],[[#include <llvm-c/TargetMachine.h>]])
118+
AC_CHECK_DECLS([LLVMCreateGDBRegistrationListener, LLVMCreatePerfJITEventListener],[],[],[[#include <llvm-c/ExecutionEngine.h>]])
119+
CPPFLAGS="$SAVE_CPPFLAGS"
120+
])# PGAC_CHECK_LLVM_FUNCTIONS

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp