diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-04-14 20:59:44 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-04-14 23:15:25 +0100 |
commit | 200b4fd964d51e9e061e3425234c5271db3a89b1 (patch) | |
tree | 6b6b53cd1b1468f6a2e5dbb8dbd4964eef6e0897 /win32 | |
parent | 9345802d17d1ff4d7e3651d8701e054f85a5b10a (diff) | |
download | perl-200b4fd964d51e9e061e3425234c5271db3a89b1.tar.gz |
Set Off_t et al correctly for USE_LARGE_FILES builds on Windows
The canned config files used to build miniperl.exe (with some updates
applied by Makefile / makefile.mk) have the non-USE_LARGE_FILES settings
for Off_t, LSEEKSIZE and Off_t_size, resulting in an uninitialized memory
read in win32_fseek() in miniperl.exe, which recently started causing
exetype.pl to write a 4GB wperl.exe during the build of a 64-bit perl.
Change Makefile / makefile.mk to use the correct settings for the build of
miniperl.exe. This fixes perl #121471.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 12 | ||||
-rw-r--r-- | win32/makefile.mk | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/win32/Makefile b/win32/Makefile index a0a3b4e502..20c3d1711a 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -888,6 +888,9 @@ config.w32 : $(CFGSH_TMPL) @echo.>>$@ @echo #ifndef _config_h_footer_>>$@ @echo #define _config_h_footer_>>$@ + @echo #undef Off_t>>$@ + @echo #undef LSEEKSIZE>>$@ + @echo #undef Off_t_size>>$@ @echo #undef PTRSIZE>>$@ @echo #undef SSize_t>>$@ @echo #undef HAS_ATOLL>>$@ @@ -906,6 +909,15 @@ config.w32 : $(CFGSH_TMPL) @echo #undef UVXf>>$@ @echo #undef USE_64_BIT_INT>>$@ @echo #undef Size_t_size>>$@ +!IF "$(USE_LARGE_FILES)"=="define" + @echo #define Off_t __int64>>$@ + @echo #define LSEEKSIZE ^8>>$@ + @echo #define Off_t_size ^8>>$@ +!ELSE + @echo #define Off_t long>>$@ + @echo #define LSEEKSIZE ^4>>$@ + @echo #define Off_t_size ^4>>$@ +!ENDIF !IF "$(WIN64)"=="define" @echo #define PTRSIZE ^8>>$@ @echo #define SSize_t __int64>>$@ diff --git a/win32/makefile.mk b/win32/makefile.mk index c11a7a99f3..a28cddf9d2 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1016,6 +1016,9 @@ config.w32 : $(CFGSH_TMPL) @echo.>>$@ @echo #ifndef _config_h_footer_>>$@ @echo #define _config_h_footer_>>$@ + @echo #undef Off_t>>$@ + @echo #undef LSEEKSIZE>>$@ + @echo #undef Off_t_size>>$@ @echo #undef PTRSIZE>>$@ @echo #undef SSize_t>>$@ @echo #undef HAS_ATOLL>>$@ @@ -1034,6 +1037,15 @@ config.w32 : $(CFGSH_TMPL) @echo #undef UVXf>>$@ @echo #undef USE_64_BIT_INT>>$@ @echo #undef Size_t_size>>$@ +.IF "$(USE_LARGE_FILES)"=="define" + @echo #define Off_t $(INT64)>>$@ + @echo #define LSEEKSIZE ^8>>$@ + @echo #define Off_t_size ^8>>$@ +.ELSE + @echo #define Off_t long>>$@ + @echo #define LSEEKSIZE ^4>>$@ + @echo #define Off_t_size ^4>>$@ +.ENDIF .IF "$(WIN64)"=="define" @echo #define PTRSIZE ^8>>$@ @echo #define SSize_t $(INT64)>>$@ |