weidai11 / cryptopp

free C++ class library of cryptographic schemes
https://cryptopp.com
Other
4.66k stars 1.47k forks source link

Warning when compiling universal binary (x86_64 + arm64) on macOS #1277

Open felipefarinon opened 1 month ago

felipefarinon commented 1 month ago

When we compile a universal binary (x86_64 + arm64) on an Intel macOS, a warning message shows, but compilation and validation tests succeed. Is this a deeper problem or just a flag validation problem? Anyway, this compilation should succeed without warnings.

Command:

CXXFLAGS="-DNDEBUG -g2 -O3 -stdlib=libc++ -arch x86_64 -arch arm64" make -j 4

Message:

Using testing flags: -DNDEBUG -g2 -O3 -stdlib=libc++ -arch x86_64 -arch arm64
Running make again to see what failed
error: unknown target CPU 'armv8-a'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4

c++ -DCRYPTOPP_DISABLE_ASM -fPIC -pthread -fno-common -pipe -DNDEBUG -g2 -O3 -stdlib=libc++ -arch x86_64 -arch arm64 -c cryptlib.cpp
...

OS: macOS 12.7.5 CPU: 1.6 GHz Dual-Core Intel Core i5 Compiler: Apple clang version 14.0.0 (clang-1400.0.29.202) Version: master, most recent commit on Apr 25, 2024