Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure CI Windows: Upgrade bundled libcurl to v7.74.0 #3638

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

kinke
Copy link
Member

@kinke kinke commented Jan 7, 2021

Build steps:

  • Build zlib v1.2.11 using contrib\vstudio\vc14\zlibvc.sln (static release lib incl. asm, which needs to be built separately, e.g., cd contrib\masmx64 && bld_ml64.bat - I've added /safeseh in contrib\masmx86\bld_ml32.bat).
    MSCRT was set to /MT, and /GS- /Zl used for MinGW-based libs compatibility.
    Includes ({zconf,zlib}.h) and lib (zlibstat.{lib,pdb}) copied to C:\LDC\curl-7.74.0\deps[_x86].
  • Patch winbuild\MakefileBuild.vc:
    • Extend CFLAGS by /DDONT_USE_RECV_BEFORE_SEND_WORKAROUND.
    • Extend CFLAGS_LIBCURL_STATIC by /GS- /Zl (for MinGW-based libs compatibility...).
  • Build DLL + import lib + .exp file:
    nmake /f Makefile.vc mode=dll VC=16 WITH_DEVEL=C:\LDC\curl-7.74.0\deps[_x86] WITH_ZLIB=static GEN_PDB=no DEBUG=no MACHINE=x{64,86} RTLIBCFG=static
  • Build static lib:
    nmake /f Makefile.vc mode=static VC=16 WITH_DEVEL=C:\LDC\curl-7.74.0\deps[_x86] WITH_ZLIB=static GEN_PDB=no DEBUG=no MACHINE=x{64,86} RTLIBCFG=static
  • Strip lib prefix from libcurl*.{lib,exp} filenames.

Build steps:

- Build zlib v1.2.11 using contrib\vstudio\vc14\zlibvc.sln (static
  release lib incl. asm, which needs to be built separately, e.g.,
  `cd contrib\masmx64 && bld_ml64.bat` - I've added `/safeseh` in
  contrib\masmx86\bld_ml32.bat).
  MSCRT was set to /MT, and `/GS- /Zl` used for MinGW-based libs
  compatibility.
  Includes ({zconf,zlib}.h) and lib (zlibstat.{lib,pdb}) copied to
  C:\LDC\curl-7.74.0\deps[_x86].
- Patch winbuild\MakefileBuild.vc:
  - Extend CFLAGS by `/DDONT_USE_RECV_BEFORE_SEND_WORKAROUND`.
  - Extend CFLAGS_LIBCURL_STATIC by `/GS- /Zl` (for MinGW-based libs compatibility...).
- Build DLL + import lib + .exp file:
  nmake /f Makefile.vc mode=dll VC=16 WITH_DEVEL=C:\LDC\curl-7.74.0\deps[_x86] WITH_ZLIB=static GEN_PDB=no DEBUG=no MACHINE=x{64,86} RTLIBCFG=static
- Build static lib:
  nmake /f Makefile.vc mode=static VC=16 WITH_DEVEL=C:\LDC\curl-7.74.0\deps[_x86] WITH_ZLIB=static GEN_PDB=no DEBUG=no MACHINE=x{64,86} RTLIBCFG=static
- Strip `lib` prefix from `libcurl*.{lib,exp}` filenames.
@kinke
Copy link
Member Author

kinke commented Jan 8, 2021

Primary motivation: #3472

The current VirusTotal results seem promising: x64 (0/70) and x86 (1/70 - flagged by Bkav)

This time, I've also rebuilt the static zlib library (using VS 2019 v16.8.3), adding /safeseh to the 32-bit ml.exe invocations and thus producing a newly SafeSEH-compatible 32-bit libcurl.dll.

@kinke kinke merged commit b0b83cc into ldc-developers:master Jan 8, 2021
@kinke kinke deleted the curl branch January 8, 2021 00:58
kinke added a commit to kinke/ldc that referenced this pull request Feb 1, 2021
…3638)

Build steps:

- Build zlib v1.2.11 using contrib\vstudio\vc14\zlibvc.sln (static
  release lib incl. asm, which needs to be built separately, e.g.,
  `cd contrib\masmx64 && bld_ml64.bat` - I've added `/safeseh` in
  contrib\masmx86\bld_ml32.bat).
  MSCRT was set to /MT, and `/GS- /Zl` used for MinGW-based libs
  compatibility.
  Includes ({zconf,zlib}.h) and lib (zlibstat.{lib,pdb}) copied to
  C:\LDC\curl-7.74.0\deps[_x86].
- Patch winbuild\MakefileBuild.vc:
  - Extend CFLAGS by `/DDONT_USE_RECV_BEFORE_SEND_WORKAROUND`.
  - Extend CFLAGS_LIBCURL_STATIC by `/GS- /Zl` (for MinGW-based libs compatibility...).
- Build DLL + import lib + .exp file:
  nmake /f Makefile.vc mode=dll VC=16 WITH_DEVEL=C:\LDC\curl-7.74.0\deps[_x86] WITH_ZLIB=static GEN_PDB=no DEBUG=no MACHINE=x{64,86} RTLIBCFG=static
- Build static lib:
  nmake /f Makefile.vc mode=static VC=16 WITH_DEVEL=C:\LDC\curl-7.74.0\deps[_x86] WITH_ZLIB=static GEN_PDB=no DEBUG=no MACHINE=x{64,86} RTLIBCFG=static
- Strip `lib` prefix from `libcurl*.{lib,exp}` filenames.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant