Rework makefiles to eliminate the use of dlltool in Windows builds.
The clang dlltool is not compatible with the binutils dlltool. However both the clang and binutils linkers support reading the .def file and creating the import library directly, so we no longer need to perform the link in two stages.
This commit is contained in:
parent
10770c9129
commit
8e2d543304
13
Makefile.in
13
Makefile.in
|
|
@ -75,7 +75,6 @@ BUILDCC = @CC_FOR_BUILD@
|
||||||
BUILDEXT = @BUILD_EXEEXT@
|
BUILDEXT = @BUILD_EXEEXT@
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CXX = @CXX@
|
CXX = @CXX@
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
|
@ -214,15 +213,11 @@ config.status: $(srcdir)/configure
|
||||||
./config.status
|
./config.status
|
||||||
|
|
||||||
ifeq (@WIN32@,yes)
|
ifeq (@WIN32@,yes)
|
||||||
# Under Windows (mingw) I need to make the ivl.exe in two steps.
|
# Under Windows we need to create an import library to allow the target code
|
||||||
# The first step makes an ivl.exe that dlltool can use to make an
|
# generators to access the items exported by ivl.exe. The .def file controls
|
||||||
# export and import library, and the last link makes a, ivl.exe
|
# what is visible in the import library.
|
||||||
# that really exports the things that the import library imports.
|
|
||||||
ivl@EXEEXT@: $O $(srcdir)/ivl.def
|
ivl@EXEEXT@: $O $(srcdir)/ivl.def
|
||||||
$(CXX) -o ivl@EXEEXT@ $O $(dllib) @EXTRALIBS@
|
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ -Wl,--out-implib=libivl.a $(srcdir)/ivl.def $O $(dllib) @EXTRALIBS@
|
||||||
$(DLLTOOL) --dllname ivl@EXEEXT@ --def $(srcdir)/ivl.def \
|
|
||||||
--output-lib libivl.a --output-exp ivl.exp
|
|
||||||
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ ivl.exp $O $(dllib) @EXTRALIBS@
|
|
||||||
else
|
else
|
||||||
ivl@EXEEXT@: $O
|
ivl@EXEEXT@: $O
|
||||||
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ $O $(dllib)
|
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ $O $(dllib)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ AC_PROG_CXX
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AC_CHECK_TOOL(LD, ld, false)
|
AC_CHECK_TOOL(LD, ld, false)
|
||||||
AC_CHECK_TOOL(AR, ar, false)
|
AC_CHECK_TOOL(AR, ar, false)
|
||||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
|
||||||
AC_CHECK_TOOL(STRIP, strip, true)
|
AC_CHECK_TOOL(STRIP, strip, true)
|
||||||
AC_CHECK_TOOL(WINDRES,windres,false)
|
AC_CHECK_TOOL(WINDRES,windres,false)
|
||||||
AC_CHECK_PROGS(XGPERF,gperf,none)
|
AC_CHECK_PROGS(XGPERF,gperf,none)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@
|
||||||
BUILDCC = @CC_FOR_BUILD@
|
BUILDCC = @CC_FOR_BUILD@
|
||||||
BUILDEXT = @BUILD_EXEEXT@
|
BUILDEXT = @BUILD_EXEEXT@
|
||||||
CXX = @CXX@
|
CXX = @CXX@
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
|
@ -149,19 +148,9 @@ else
|
||||||
ifeq (@WIN32@,yes)
|
ifeq (@WIN32@,yes)
|
||||||
# To support cocotb, we export the VPI functions directly. This allows
|
# To support cocotb, we export the VPI functions directly. This allows
|
||||||
# cocotb to build VPI modules without using our vpi_user.h and libvpi.a.
|
# cocotb to build VPI modules without using our vpi_user.h and libvpi.a.
|
||||||
# This requires making the vvp.exe in two steps. The first step makes
|
# The .def file controls what is exported.
|
||||||
# a vvp.exe that dlltool can use to make an export library, and the
|
|
||||||
# second step makes a vvp.exe that really exports those things.
|
|
||||||
#
|
|
||||||
# To get this to work correctly we must use the suffixed version of the
|
|
||||||
# executable to build the export library, but leave the final vvp.exe
|
|
||||||
# without a suffix.
|
|
||||||
vvp@EXEEXT@: main.o $O $(srcdir)/vvp.def
|
vvp@EXEEXT@: main.o $O $(srcdir)/vvp.def
|
||||||
$(CXX) -o vvp$(suffix)@EXEEXT@ $(LDFLAGS) main.o $O $(dllib) $(LIBS)
|
$(CXX) $(LDFLAGS) -o vvp@EXEEXT@ $(LDFLAGS) $(srcdir)/vvp.def main.o $O $(dllib) $(LIBS)
|
||||||
$(DLLTOOL) --dllname vvp$(suffix)@EXEEXT@ --def $(srcdir)/vvp.def \
|
|
||||||
--output-exp vvp.exp
|
|
||||||
rm -f vvp$(suffix)@EXEEXT@
|
|
||||||
$(CXX) $(LDFLAGS) -o vvp@EXEEXT@ vvp.exp $(LDFLAGS) main.o $O $(dllib) $(LIBS)
|
|
||||||
else
|
else
|
||||||
vvp@EXEEXT@: $O main.o
|
vvp@EXEEXT@: $O main.o
|
||||||
$(CXX) $(LDFLAGS) -o vvp@EXEEXT@ main.o $O $(LIBS) $(dllib)
|
$(CXX) $(LDFLAGS) -o vvp@EXEEXT@ main.o $O $(LIBS) $(dllib)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue