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

Can't build in vs2015 after version 2.0.0 #195

Closed
yzhgu opened this issue Feb 28, 2025 · 2 comments
Closed

Can't build in vs2015 after version 2.0.0 #195

yzhgu opened this issue Feb 28, 2025 · 2 comments

Comments

@yzhgu
Copy link

yzhgu commented Feb 28, 2025

I think the cipher scheme AEGIS introduced in version 2.0.0 broke the build in vs2015. For vs2019/2022, it works fine.

1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289644): error C2719: 'a': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289644): error C2719: 'b': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289650): error C2719: 'a': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289650): error C2719: 'b': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289670): error C2719: 'b': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289677): error C2719: 'a': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289677): error C2719: 'b': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289683): error C2719: 'd1': formal parameter with requested alignment of 16 won't be aligned
1>l:\workingdir\tools\3rd\wxsqlite3\src\sqlite3mc_amalgamation.c(289683): error C2719: 'd2': formal parameter with requested alignment of 16 won't be aligned
@utelle
Copy link
Owner

utelle commented Feb 28, 2025

I think the cipher scheme AEGIS introduced in version 2.0.0 broke the build in vs2015. For vs2019/2022, it works fine.

VS2015 is a rather old compiler. If you really need to use VS2015, a workaround would be to disable the AEGIS cipher by defining the precompiler symbol on the command line /DHAVE_CIPHER_AEGIS=0 or in source code

#define HAVE_CIPHER_AEGIS 0

The problem is that VS2015 is very strict regarding alignment. VS2017 and above implicitly take care of passing parameters with alignment correctly.

The AEGIS cipher scheme is actually implemented via the third-party library libaegis, although the code (with some adjustments to allow amalgamation) is included in this project.

Supporting VS2015 would require to change the affected functions to pass the arguments by reference (pointers) instead of by value. This would be a major change, and would make updating to newer libaegis versions much more difficult. If you can convince the libaegis developers to apply this change, I will apply it as well.

utelle added a commit that referenced this issue Feb 28, 2025
MSVC 2015 is very strict regarding data alignment. Passing aligned parameters by value is not supported. Therefore the cipher scheme AEGIS is disabled for now.

The underlying libaegis library passes aligned parameters by value for a number of functions. To support older MSVC compilers it would be necessary to change the parameter passing mechanism for the affected functions from "by value" to "by reference". In case this will done in the upstream libaegis library, the AEGIS cipher scheme will be re-enabled for MSVC 2015 and below.
@utelle
Copy link
Owner

utelle commented Feb 28, 2025

For now, the AEGIS cipher scheme will be automatically disabled, if the source code is compiled with MSVC 2015 or below - see commit 120cf51.

I know that this "solution" is somewhat unsatisfactory, but keep in mind that the MSVC 2015 compiler is about 10 years old. MSVC 2017 and above will work.

@utelle utelle closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2025
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

2 participants