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

Binskim reporting /Qspectre switch not enabled for libxml2-2.11.1 static library even after switch is added #907

Open
nachogule opened this issue May 23, 2023 · 3 comments

Comments

@nachogule
Copy link

I am running binskim 1.9.5 for my application that statically link to libxml2-2.11.1(https://download.gnome.org/sources/libxml2/2.11/) and complaining about /Qspectre switch not enabled.

To fix this I added /Qspectre switch in below two files in "CFLAGS" variable as below,

libxml2-2.11.1\win32\Makefile

libxml2-2.11.1\win32\Makefile.msvc

CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 /Qspectre $(CRUNTIME)

I am running below command sequence for building libxml2-2.11.1 on Windows,

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" -vcvars_ver=14.2 -vcvars_spectre_libs=spectre

cscript configure.js iconv=no static=yes prefix=.\build\release cruntime=/MT debug=no schematron=no incdir=.\include libdir=.\lib\release\static sodir=.\lib\release\shared

nmake -f Makefile.msvc

I can see /Qspectre switch is present in compilation options when I compile libxml2-2.11.1 library on Windows,

cl.exe /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 /Qspectre /MT /I.. /I..\include /I.\include /D "_REENTRANT" /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /D "NDEBUG" /O2 /Foint.msvc\ /c ..\buf.c ..\c14n.c ..\catalog.c ..\chvalid.c ..\debugXML.c ..\dict.c ..\encoding.c ..\entities.c ..\error.c ..\globals.c ..\hash.c ..\HTMLparser.c ..\HTMLtree.c ..\legacy.c ..\list.c ..\nanoftp.c ..\nanohttp.c ..\parser.c ..\parserInternals.c ..\pattern.c ..\relaxng.c ..\SAX2.c ..\SAX.c ..\schematron.c ..\threads.c ..\tree.c ..\uri.c ..\valid.c ..\xinclude.c ..\xlink.c ..\xmlIO.c ..\xmlmemory.c ..\xmlreader.c ..\xmlregexp.c ..\xmlmodule.c ..\xmlsave.c ..\xmlschemas.c ..\xmlschemastypes.c ..\xmlunicode.c ..\xmlwriter.c ..\xpath.c ..\xpointer.c ..\xmlstring.c

But still after analyzing application binary with binskim I get following warning,

"The following modules were compiled with a toolset that supports /Qspectre but the switch was not enabled on the command-line:\r\nlibxml2_a.lib,c,19.29.30148.0 (buf.obj,catalog.obj,chvalid.obj,debugXML.obj,dict.obj,encoding.obj,entities.obj,error.obj,globals.obj,hash.obj,HTMLparser.obj,HTMLtree.obj,list.obj,nanoftp.obj,nanohttp.obj,parser.obj,parserInternals.obj,pattern.obj,relaxng.obj,SAX.obj,SAX2.obj,threads.obj,tree.obj,uri.obj,valid.obj,xinclude.obj,xmlIO.obj,xmlmemory.obj,xmlreader.obj,xmlregexp.obj,xmlsave.obj,xmlschemas.obj,xmlschemastypes.obj,xmlstring.obj,xmlunicode.obj,xpath.obj,xpointer.obj)\r\n\r\n"

Please help here to understand what is missing here and why /Qspectre switch is not effective for libxml2-2.11.1

shaopeng-gh added a commit that referenced this issue May 23, 2023
…accessible` if can not connect to the http symbol servers provided by `--sympath`. [#907](#907)
@shaopeng-gh
Copy link
Collaborator

Want to clear the confusion, below is not related fix, it just happened that the pr was created about the same time and id conflict:

shaopeng-gh added a commit that referenced this issue 2 days ago

* NEW: BinSkim will now log warning `OneOrMoreSymbolServersProvidedIn…

@asvadive
Copy link

hi @nachogule do you have any updates on this issue? I am seeing something similar

@nachogule
Copy link
Author

nachogule commented Apr 30, 2024 via email

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

No branches or pull requests

3 participants