问题
I have two static libraries named libx.a
and liby.a
.
libx.a
is compiled with gcc -g
; while liby.a
is compiled with gcc -O3
.
I want to link them two into a single executable.
Is it viable?
Is it harmful?
回答1:
Yes, it is viable, it isn't harmful as long as the optimizations don't change the ABI (of function calls, or of floating point arithmetic/representation, etc.). Although even in those cases, I believe all necessary information is already compiled in or the linker resolves the issues.
来源:https://stackoverflow.com/questions/40609727/is-it-viable-to-mix-two-static-libraries-with-different-optimization-levels