mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
Add --enable-llvmc-dynamic configure option.
Controls whether libCompilerDriver should be loaded dynamically. By default this is needed only on Win32, to make dynamic plugins work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
895f32c212
commit
2373c99433
@ -297,3 +297,9 @@ endif
|
|||||||
|
|
||||||
# Location of the plugin header file for gold.
|
# Location of the plugin header file for gold.
|
||||||
BINUTILS_INCDIR := @BINUTILS_INCDIR@
|
BINUTILS_INCDIR := @BINUTILS_INCDIR@
|
||||||
|
|
||||||
|
# When ENABLE_LLVMC_DYNAMIC is enabled, LLVMC will link libCompilerDriver
|
||||||
|
# dynamically. This is needed to make dynamic plugins work on some targets
|
||||||
|
# (Windows).
|
||||||
|
ENABLE_LLVMC_DYNAMIC = 0
|
||||||
|
#@ENABLE_LLVMC_DYNAMIC@
|
||||||
|
@ -200,17 +200,20 @@ ifdef LLVMC_PLUGIN
|
|||||||
LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
|
LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
|
||||||
CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
|
CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
|
||||||
REQUIRES_EH := 1
|
REQUIRES_EH := 1
|
||||||
LD.Flags += -lCompilerDriver
|
|
||||||
|
ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
|
||||||
|
LD.Flags += -lCompilerDriver
|
||||||
|
endif
|
||||||
|
|
||||||
# Build a dynamic library if the user runs `make` directly from the plugin
|
# Build a dynamic library if the user runs `make` directly from the plugin
|
||||||
# directory.
|
# directory.
|
||||||
ifndef LLVMC_BUILTIN_PLUGIN
|
ifndef LLVMC_BUILTIN_PLUGIN
|
||||||
LOADABLE_MODULE = 1
|
LOADABLE_MODULE = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# TableGen stuff...
|
# TableGen stuff...
|
||||||
ifneq ($(BUILT_SOURCES),)
|
ifneq ($(BUILT_SOURCES),)
|
||||||
LLVMC_BUILD_AUTOGENERATED_INC=1
|
LLVMC_BUILD_AUTOGENERATED_INC=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif # LLVMC_PLUGIN
|
endif # LLVMC_PLUGIN
|
||||||
@ -218,8 +221,15 @@ endif # LLVMC_PLUGIN
|
|||||||
ifdef LLVMC_BASED_DRIVER
|
ifdef LLVMC_BASED_DRIVER
|
||||||
|
|
||||||
TOOLNAME = $(LLVMC_BASED_DRIVER)
|
TOOLNAME = $(LLVMC_BASED_DRIVER)
|
||||||
|
|
||||||
REQUIRES_EH := 1
|
REQUIRES_EH := 1
|
||||||
LD.Flags += -lCompilerDriver
|
|
||||||
|
ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
|
||||||
|
LD.Flags += -lCompilerDriver
|
||||||
|
else
|
||||||
|
LLVMLIBS = CompilerDriver.a
|
||||||
|
LINK_COMPONENTS = support system
|
||||||
|
endif
|
||||||
|
|
||||||
# Preprocessor magic that generates references to static variables in built-in
|
# Preprocessor magic that generates references to static variables in built-in
|
||||||
# plugins.
|
# plugins.
|
||||||
@ -502,8 +512,7 @@ ifeq ($(OS),Darwin)
|
|||||||
else
|
else
|
||||||
ifeq ($(OS),Cygwin)
|
ifeq ($(OS),Cygwin)
|
||||||
SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
|
SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
|
||||||
-Wl,--enable-auto-import -Wl,--enable-auto-image-base \
|
-Wl,--enable-auto-import -Wl,--enable-auto-image-base
|
||||||
-Wl,--enable-runtime-pseudo-relocs
|
|
||||||
else
|
else
|
||||||
SharedLinkOptions=-shared
|
SharedLinkOptions=-shared
|
||||||
endif
|
endif
|
||||||
|
@ -593,6 +593,24 @@ case "$enableval" in
|
|||||||
*) AC_MSG_ERROR([Invalid setting for --enable-libffi. Use "yes" or "no"]) ;;
|
*) AC_MSG_ERROR([Invalid setting for --enable-libffi. Use "yes" or "no"]) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
dnl Only Windows needs dynamic libCompilerDriver to support plugins.
|
||||||
|
if test "$llvm_cv_os_type" = "Win32" ; then
|
||||||
|
llvmc_dynamic="yes"
|
||||||
|
else
|
||||||
|
llvmc_dynamic="no"
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl --enable-llvmc-dynamic : should LLVMC link libCompilerDriver dynamically?
|
||||||
|
AC_ARG_ENABLE(llvmc-dynamic,AS_HELP_STRING(
|
||||||
|
--enable-llvmc-dynamic,
|
||||||
|
[Link LLVMC dynamically (default is NO, unless on Win32)]),,
|
||||||
|
enableval=$llvmc_dynamic)
|
||||||
|
if test ${enableval} = "no"; then
|
||||||
|
AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[]])
|
||||||
|
else
|
||||||
|
AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[ENABLE_LLVMC_DYNAMIC=1]])
|
||||||
|
fi
|
||||||
|
|
||||||
dnl===-----------------------------------------------------------------------===
|
dnl===-----------------------------------------------------------------------===
|
||||||
dnl===
|
dnl===
|
||||||
dnl=== SECTION 4: Check for programs we need and that they are the right version
|
dnl=== SECTION 4: Check for programs we need and that they are the right version
|
||||||
|
@ -12,18 +12,26 @@ LEVEL = ../..
|
|||||||
# We don't want this library to appear in `llvm-config --libs` output, so its
|
# We don't want this library to appear in `llvm-config --libs` output, so its
|
||||||
# name doesn't start with "LLVM".
|
# name doesn't start with "LLVM".
|
||||||
|
|
||||||
LIBRARYNAME = libCompilerDriver
|
ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
|
||||||
LLVMLIBS = LLVMSupport.a LLVMSystem.a
|
LIBRARYNAME = libCompilerDriver
|
||||||
LOADABLE_MODULE := 1
|
LLVMLIBS = LLVMSupport.a LLVMSystem.a
|
||||||
|
LOADABLE_MODULE := 1
|
||||||
|
else
|
||||||
|
LIBRARYNAME = CompilerDriver
|
||||||
|
LINK_COMPONENTS = support system
|
||||||
|
endif
|
||||||
|
|
||||||
REQUIRES_EH := 1
|
REQUIRES_EH := 1
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.common
|
include $(LEVEL)/Makefile.common
|
||||||
|
|
||||||
|
# Copy libCompilerDriver to the bin dir so that llvmc can find it.
|
||||||
|
ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
|
||||||
|
|
||||||
FullLibName = $(LIBRARYNAME)$(SHLIBEXT)
|
FullLibName = $(LIBRARYNAME)$(SHLIBEXT)
|
||||||
|
|
||||||
all-local:: $(ToolDir)/$(FullLibName)
|
all-local:: $(ToolDir)/$(FullLibName)
|
||||||
|
|
||||||
# Copy the library to the bin dir so that llvmc can find it.
|
|
||||||
$(ToolDir)/$(FullLibName): $(LibDir)/$(FullLibName) $(ToolDir)/.dir
|
$(ToolDir)/$(FullLibName): $(LibDir)/$(FullLibName) $(ToolDir)/.dir
|
||||||
$(Echo) Copying $(BuildMode) Shared Library $(FullLibName) to $@
|
$(Echo) Copying $(BuildMode) Shared Library $(FullLibName) to $@
|
||||||
-$(Verb) $(CP) $< $@
|
-$(Verb) $(CP) $< $@
|
||||||
@ -32,3 +40,4 @@ clean-local::
|
|||||||
$(Echo) Removing $(BuildMode) Shared Library $(FullLibName) \
|
$(Echo) Removing $(BuildMode) Shared Library $(FullLibName) \
|
||||||
from $(ToolDir)
|
from $(ToolDir)
|
||||||
-$(Verb) $(RM) -f $(ToolDir)/$(FullLibName)
|
-$(Verb) $(RM) -f $(ToolDir)/$(FullLibName)
|
||||||
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user