Skip to content

Commit

Permalink
Get rid of obsolete PerlCRT.dll support
Browse files Browse the repository at this point in the history
PerlCRT.dll was a patched version of MSVCRT.dll that fixed/worked
around a few known issues with Microsoft's C runtime library.
These issues have long been fixed by updates to MSVCRT.dll, and
AFAIK nobody has used PerlCRT.dll in almost 10 years now.
  • Loading branch information
jandubois committed Jul 22, 2010
1 parent 02e200f commit 6d8f7c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 55 deletions.
8 changes: 0 additions & 8 deletions pod/perlxstut.pod
Expand Up @@ -198,14 +198,6 @@ been deleted):
You can safely ignore the line about "prototyping behavior" - it is
explained in L<perlxs/"The PROTOTYPES: Keyword">.

If you are on a Win32 system, and the build process fails with linker
errors for functions in the C library, check if your Perl is configured
to use PerlCRT (running B<perl -V:libc> should show you if this is the
case). If Perl is configured to use PerlCRT, you have to make sure
PerlCRT.lib is copied to the same location that msvcrt.lib lives in,
so that the compiler can find it on its own. msvcrt.lib is usually
found in the Visual C compiler's lib directory (e.g. C:/DevStudio/VC/lib).

Perl has its own special way of easily writing test scripts, but for this
example only, we'll create our own test script. Create a file called hello
that looks like this:
Expand Down
28 changes: 3 additions & 25 deletions win32/Makefile
Expand Up @@ -123,17 +123,6 @@ CCTYPE = MSVC60
#
#CFG = Debug

#
# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
# It has patches that fix known bugs in older versions of MSVCRT.DLL.
# This currently requires VC 5.0 with Service Pack 3 or later.
# Get it from CPAN at http://www.cpan.org/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
# Not recommended if you have VC 6.x and you're not running Windows 9x.
#
#USE_PERLCRT = define

#
# uncomment to enable linking with setargv.obj under the Visual C
# compiler. Setting this options enables perl to expand wildcards in
Expand Down Expand Up @@ -308,10 +297,6 @@ USE_PERLIO = undef
USE_LARGE_FILES = undef
!ENDIF

!IF "$(USE_PERLCRT)" == ""
USE_PERLCRT = undef
!ENDIF

!IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
USE_MULTI = define
!ENDIF
Expand Down Expand Up @@ -444,11 +429,7 @@ LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -TP -EHsc

!IF "$(USE_PERLCRT)" != "define"
LIBC = msvcrt.lib
!ELSE
LIBC = PerlCRT.lib
!ENDIF

!IF "$(CFG)" == "Debug"
! IF "$(CCTYPE)" == "MSVC20"
Expand Down Expand Up @@ -490,13 +471,11 @@ OPTIMIZE = $(OPTIMIZE) -fp:precise
DEFINES = $(DEFINES) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
!ENDIF

# Use the MSVCRT read() fix if the PerlCRT was not chosen, but only when using
# VC++ 6.x or earlier. Later versions use MSVCR70.dll, MSVCR71.dll, etc, which
# do not require the fix.
# Use the MSVCRT read() fix only when using VC++ 6.x or earlier. Later
# versions use MSVCR70.dll, MSVCR71.dll, etc, which do not require the
# fix.
!IF "$(CCTYPE)" == "MSVC20" || "$(CCTYPE)" == "MSVC" || "$(CCTYPE)" == "MSVC60"
! IF "$(USE_PERLCRT)" != "define"
BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX
! ENDIF
!ENDIF

LIBBASEFILES = $(CRYPT_LIB) \
Expand All @@ -513,7 +492,6 @@ LIBBASEFILES = $(CRYPT_LIB) \
LIBBASEFILES = $(LIBBASEFILES) bufferoverflowU.lib
!ENDIF

# we add LIBC here, since we may be using PerlCRT.dll
LIBFILES = $(LIBBASEFILES) $(LIBC)

#EXTRACFLAGS = -nologo -GF -W4 -wd4127 -wd4706
Expand Down
25 changes: 3 additions & 22 deletions win32/makefile.mk
Expand Up @@ -139,17 +139,6 @@ CCTYPE *= GCC
#
#CFG *= Debug

#
# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
# It has patches that fix known bugs in older versions of MSVCRT.DLL.
# This currently requires VC 5.0 with Service Pack 3 or later.
# Get it from CPAN at http://www.cpan.org/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
# Not recommended if you have VC 6.x and you're not running Windows 9x.
#
#USE_PERLCRT *= define

#
# uncomment to enable linking with setargv.obj under the Visual C
# compiler. Setting this options enables perl to expand wildcards in
Expand Down Expand Up @@ -334,7 +323,6 @@ USE_ITHREADS *= undef
USE_IMP_SYS *= undef
USE_PERLIO *= undef
USE_LARGE_FILES *= undef
USE_PERLCRT *= undef

.IF "$(USE_IMP_SYS)" == "define"
PERL_MALLOC = undef
Expand Down Expand Up @@ -589,11 +577,7 @@ LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -TP -EHsc

.IF "$(USE_PERLCRT)" != "define"
LIBC = msvcrt.lib
.ELSE
LIBC = PerlCRT.lib
.ENDIF

.IF "$(CFG)" == "Debug"
.IF "$(CCTYPE)" == "MSVC20"
Expand Down Expand Up @@ -635,14 +619,12 @@ OPTIMIZE += -Wp64 -fp:precise
DEFINES += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
.ENDIF

# Use the MSVCRT read() fix if the PerlCRT was not chosen, but only when using
# VC++ 6.x or earlier. Later versions use MSVCR70.dll, MSVCR71.dll, etc, which
# do not require the fix.
# Use the MSVCRT read() fix only when using VC++ 6.x or earlier. Later
# versions use MSVCR70.dll, MSVCR71.dll, etc, which do not require the
# fix.
.IF "$(CCTYPE)" == "MSVC20" || "$(CCTYPE)" == "MSVC" || "$(CCTYPE)" == "MSVC60"
.IF "$(USE_PERLCRT)" != "define"
BUILDOPT += -DPERL_MSVCRT_READFIX
.ENDIF
.ENDIF

LIBBASEFILES = $(CRYPT_LIB) \
oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
Expand All @@ -658,7 +640,6 @@ LIBBASEFILES = $(CRYPT_LIB) \
LIBBASEFILES += bufferoverflowU.lib
.ENDIF

# we add LIBC here, since we may be using PerlCRT.dll
LIBFILES = $(LIBBASEFILES) $(LIBC)

EXTRACFLAGS = -nologo -GF -W3
Expand Down

0 comments on commit 6d8f7c9

Please sign in to comment.