Comments (8)
If this may help: https://blog.conan.io/2022/10/13/Different-flavors-Clang-compiler-Windows.html
NOTE:
Currently, we only include the x64dll.asm
and x64masm.asm
if MSVC
is defined. That is not the case if the compiler is Msys2 Clang
.
When exactly are these 2 files expected to be included in the source list?
from cryptopp.
I can't duplicate this. When I build with g++
in the default environment everything is Ok. The library compiles, links and executes its self tests Ok.
When using the default compiler in the CLANG64 environment, it is g++
and everything is Ok. The library compiles, links and executes its self tests Ok.
When I attempt to build with CLANG64 using CXX=clang64++
, I get a file not found (the compiler) and the build fails. What compiler name are you using besides g++
?
from cryptopp.
Just the default g++ name is what I’m using.
Ok, thanks.
In CLANG64 this points to clang++.
I'm seeing different results for the CLANG64 environment:
$ command -v g++
/usr/bin/g++
$ ls -Al $(command -v g++)
-rwxr-xr-x 4 Jeffrey Walton None 1637882 Sep 14 04:43 /usr/bin/g++
$ g++ --version
g++ (GCC) 13.2.0
Do you have the clang64 compiler toolchain installed?
I don't know. Do you know what its called or the package name?
I tried running make
with CXX=clang64++
, but it fails with a "file not found".
I run pacman -Syu
when I open a MSYS2 prompt to update all packages. Maybe you need the latest packages, too?
from cryptopp.
In MSYS2 you can install the toolchain
So this is what I have installed:
$ pacman -Q | grep -E 'clang|gcc|g\+\+'
clang 11.0.0-5
gcc 13.2.0-2
gcc-libs 13.2.0-2
mingw-w64-x86_64-gcc 13.2.0-2
mingw-w64-x86_64-gcc-ada 13.2.0-2
mingw-w64-x86_64-gcc-fortran 13.2.0-2
mingw-w64-x86_64-gcc-libgfortran 13.2.0-2
mingw-w64-x86_64-gcc-libs 13.2.0-2
mingw-w64-x86_64-gcc-objc 13.2.0-2
mingw-w64-x86_64-libgccjit 13.2.0-2
If its missing a package, then please tell me what it is.
I am guessing you are in the CLANG64 environment
Yes. I do a Start -> MSYS2 -> CLANG64 in this case, since we are talking about Clang64.
but using the toolchain installed from a different environment
Yeah, so I don't know about this. Naively, it seems like the environments should keep themselves separated from one another. Otherwise, what's the point of providing different environments?
from cryptopp.
The clang64 environment packages should all start with ‘mingw-w64-clang-x86_64’, e.g. ‘mingw-w64-clang-x86_64-clang’.
Ok, thanks. It looks like I can install yet another Clang on this machine:
$ pacman -S mingw-w64-clang-x86_64-clang
resolving dependencies...
looking for conflicting packages...
Packages (19) mingw-w64-clang-x86_64-compiler-rt-17.0.1-1
mingw-w64-clang-x86_64-crt-git-11.0.0.r198.g93ca95b32-1
mingw-w64-clang-x86_64-expat-2.5.0-1 mingw-w64-clang-x86_64-gettext-0.21.1-2
mingw-w64-clang-x86_64-headers-git-11.0.0.r198.g93ca95b32-1
mingw-w64-clang-x86_64-libc++-17.0.1-1 mingw-w64-clang-x86_64-libffi-3.4.4-1
mingw-w64-clang-x86_64-libiconv-1.17-3 mingw-w64-clang-x86_64-libunwind-17.0.1-1
mingw-w64-clang-x86_64-libwinpthread-git-11.0.0.r198.g93ca95b32-1
mingw-w64-clang-x86_64-libxml2-2.11.5-1 mingw-w64-clang-x86_64-lld-17.0.1-1
mingw-w64-clang-x86_64-llvm-17.0.1-1 mingw-w64-clang-x86_64-llvm-libs-17.0.1-1
mingw-w64-clang-x86_64-winpthreads-git-11.0.0.r198.g93ca95b32-1
mingw-w64-clang-x86_64-xz-5.4.4-1 mingw-w64-clang-x86_64-zlib-1.3-1
mingw-w64-clang-x86_64-zstd-1.5.5-1 mingw-w64-clang-x86_64-clang-17.0.1-1
Total Download Size: 156.35 MiB
Total Installed Size: 1103.49 MiB
:: Proceed with installation? [Y/n] Y
Do you know what the compiler name is? I'm still getting a "command not found":
$ mingw-w64-clang-x86_64-clang++ --version
-bash: mingw-w64-clang-x86_64-clang++: command not found
from cryptopp.
Also if it helps, I'm not sure if the inclusion of CPUID64 and XGETBV64 in this environment is intentional or not, but I don't see the file they come from x64dll.asm referenced at all in the GNUmakefile.
Clang is supposed to get into the code path located at https://github.com/weidai11/cryptopp/blob/master/cpu.cpp#L434. It is not supposed to get into the code path for CPUID64 and XGETBV64.
But we've been dealing with Clang's crap for years. It pretends to be other compilers, and then it causes all sorts of problems, like this.
from cryptopp.
Wouldn't it be just because of this? https://github.com/weidai11/cryptopp/blob/master/config_cpu.h#L206
So that is supposed to be for the version of Clang that Microsoft distributes as part of their Build Tools and Visual Studio and their SDKs. It is not supposed to be for MSYS/MinGW/Cygwin.
I think the problem starts further back, sometime around https://github.com/weidai11/cryptopp/blob/master/config_ver.h#L55.
Maybe we need another Clang differentiator, like CRYPTOPP_MSYS_CLANG_VERSION
. This way, we can partition Clang on the Microsoft flavors and the MSYS flavors.
from cryptopp.
@Steveice10,
Give Commit 19f0e3aa1e63 a try. It tested good for me under MSYS2's CLANG64 environment.
I'm afraid to close this issue because I know how much trouble Clang is...
from cryptopp.
Related Issues (20)
- A security issue in the `ModularSquareRoot` function leads to a DOS attack HOT 6
- Compile warnings in VS 2022 17.8.0 - stdext::make_checked_array_iterator stdext::make_unchecked_array_iterator beeing deprecated HOT 1
- Memory leak problem!! HOT 2
- Crypto++ needs to support a fixed target HOT 2
- Poly1305 null pointer passed as argument 1 HOT 1
- Django cipher texts not matching Crypto++ cipher texts.
- destructor delete problem with own dialog program with MFC (Unicode/Use MFC in a Shared DLL) VS2015
- Memory leak in signature verification HOT 3
- repo too large, git clone often failed due to rpm connection timeout
- Compilation fails using MSYS2 CLANGARM64 toolchain
- Leak the Secret Key of Elgamal Encryption in Cryptopp via Rowhammer HOT 1
- ld.lld: error: duplicate symbol: CryptoPP::CallNewHandler()
- Add support for Elliptic Curves of Genus n (Hyperelliptic Curves)
- Infinite execution behavior in main branch
- Integer class errors
- ECP::ScalarMultiply() may seemingly miscompute for small scalars when using Ubuntu 20.04.6 LTS on 64-bit Intel CPUs HOT 6
- [x25519] donna function `curve25519_mult` generated different shared key HOT 1
- PGP signing key has expired
- Compilation issue with clang on X86
- Assertion failed: integer.cpp(3049):Integer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryptopp.