Forcing a compile with -fPIC creates a load of spurious warning information. For some reason, it regurgitates the frist couple lines of every file:
$ make CXXFLAGS="-DNDEBUG -g2 -O2 -fPIC -march=native -Wall -Wextra -Wno-type-limits -Wno-unknown-pragmas -pipe"
WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h
g++ -DNDEBUG -g2 -O2 -fPIC -march=native -Wall -Wextra -Wno-type-limits -Wno-unknown-pragmas -pipe -c 3way.cpp
3way.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
// 3way.cpp - modifed by Wei Dai from Joan Daemen's 3way.c
^
g++ -DNDEBUG -g2 -O2 -fPIC -march=native -Wall -Wextra -Wno-type-limits -Wno-unknown-pragmas -pipe -c adler32.cpp
adler32.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
// adler32.cpp - written and placed in the public domain by Wei Dai
^
We have to force fPIC because we are experiencing a crash when automatic PIC is used (i.e., if we omit -fPIC, PIC is still used but we get the crash).
-fPICis supposed to have no effect in WIN32 builds; thus, it seems rather mysterious thatwill mitigate your crash. If you can identify why this may be so, when it really should not be, then that may merit discussion upstream, on GCC's BugZilla; (using
-fPICin WIN32 appears to induce a side effect, which it is not supposed to).In view of the supposed nil-effect of
-fPICon WIN32, I am inclined to support the GCC maintainer's stance that the warning is warranted; (to borrow an allegory from audio electronics,-fPICis noise at the input stage which is amplified, to become the warning at the output stage). Nonetheless, if you disagree, feel free to "raise your own standard" on the same GCC BugZilla. From a MinGW perspective, this will likely become a "won't fix" issue.