Summary: | Compiler error Visual Studion 2017 CE | ||
---|---|---|---|
Product: | MuPDF | Reporter: | Hafedh TRIMECHE <hafedh.trimeche> |
Component: | mupdf | Assignee: | MuPDF bugs <mupdf-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hafedh.trimeche, s.r.alavizadeh, tor.andersson |
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Windows 10 | ||
Customer: | Word Size: | --- |
Description
Hafedh TRIMECHE
2018-05-07 15:32:43 UTC
It is a large and sometimes problematic file. However, Visual Studio 2005 compiles the file just fine on my test system which only has 2GB of memory. Could you check a few things for me? 1) Is optimization turned off for the libresources project? 2) Try removing the "generated/resources/fonts/han/SourceHanSerif.ttc.c" file, and in "scripts/fontdump.nmake" change the build line for that file to add a "-s" command line flag. The -s flag generates a source file that uses a syntax which is faster to compile and uses less memory, but does not work on VS 2005. hexdump.exe -s generated\resources\fonts\han\SourceHanSerif.ttc.c resources\fonts\han\SourceHanSerif.ttc I has the same issue using MSVC2015x86. (In reply to Tor Andersson from comment #1) > It is a large and sometimes problematic file. However, Visual Studio 2005 > compiles the file just fine on my test system which only has 2GB of memory. > > Could you check a few things for me? > > 1) Is optimization turned off for the libresources project? How to check this? > 2) Try removing the "generated/resources/fonts/han/SourceHanSerif.ttc.c" > file, > and in "scripts/fontdump.nmake" change the build line for that file to add a > "-s" command line flag. The -s flag generates a source file that uses a > syntax which is faster to compile and uses less memory, but does not work on > VS 2005. > > hexdump.exe -s generated\resources\fonts\han\SourceHanSerif.ttc.c > resources\fonts\han\SourceHanSerif.ttc After applying this patch it is stopped with another error: ..\..\generated\resources\fonts\han\SourceHanSerif-Regular.ttc.c(3451): fatal error C1091: compiler limit: string exceeds 65535 bytes in length [C:\projects\mupdf-win32-release\mupdf\platform\win32\libresources.vcxproj] We have rejigged the build for Visual Studio to use bin2coff to directly generate object files for our binary data blobs. This should fix the issues with compiler limitations. Fixed in commit a71f6edd591038828e9552d758e2a5378e399f41 Author: Tor Andersson <tor.andersson@artifex.com> Date: Thu Jun 7 14:01:37 2018 +0200 Use bin2coff to generate font data blobs object files. This is the windows equivalent of objcopy or ld -r binary. We need different bin2coff font object files for 32 and 64 bit builds, so put the font object files in AdditionalDependencies. Revamp Windows builds to use bin2coff. Fix bin2coff to not use '-' in symbol names. Add a new project file to make bin2coff. Add a .rules file to tell MSVC how to call the built version of bin2coff. Update libresources build to use this rules file. Update noto.c to correctly find the symbols we make. (In reply to Tor Andersson from comment #3) > We have rejigged the build for Visual Studio to use bin2coff to directly > generate object files for our binary data blobs. This should fix the issues > with compiler limitations. > > Fixed in commit a71f6edd591038828e9552d758e2a5378e399f41 > Author: Tor Andersson <tor.andersson@artifex.com> > Date: Thu Jun 7 14:01:37 2018 +0200 > > Use bin2coff to generate font data blobs object files. > > This is the windows equivalent of objcopy or ld -r binary. > > We need different bin2coff font object files for 32 and 64 bit builds, > so put the font object files in AdditionalDependencies. > > Revamp Windows builds to use bin2coff. > > Fix bin2coff to not use '-' in symbol names. > > Add a new project file to make bin2coff. > > Add a .rules file to tell MSVC how to call the built version of bin2coff. > > Update libresources build to use this rules file. > > Update noto.c to correctly find the symbols we make. It seems the issue has been fixed. But there are some compile issues. As above I am using MSVC2015: (msbuild /m mupdf.sln /property:Configuration=Release /p:PlatformTarget=x86 /p:Platform=Win32) 1- Build tries to create 64Bit *.obj files for fonts in "x64\release\libresources" and since that directory dose not exist build fails. (as workaround I make that directory manually.) 2- Build also try to bin2coff the following fonts: - resources\fonts\urw\NimbusSansNarrow-Bold.cff - resources\fonts\urw\NimbusSansNarrow-Oblique.cff - resources\fonts\urw\NimbusSansNarrow-Regular.cff - resources\fonts\urw\NimbusSansNarrow-BdOblique.cff But they are not there. (as workaround I copied and renamed NimbusSans fonts.) 3- Finally, there is some link issues, see: - https://beepaste.io/paste/view/4VHWUE |