Fix Makefile to link against OpenSSL on PGXS#1
Open
sumanmichael wants to merge 1 commit into
Open
Conversation
PGXS only applies SHLIB_LINK to MODULE_big builds; with MODULES the flag is silently ignored, so -lssl -lcrypto never reached the link line and the build failed with undefined OpenSSL symbols. Switch from MODULES to MODULE_big (+ OBJS) so SHLIB_LINK is honored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SHLIB_LINKtoMODULE_bigbuilds. withMODULES, the variable is silently ignored, so-lssl -lcryptonever reached the link line and the build failed with undefined OpenSSL symbols (EVP_EncryptInit_ex,EVP_aes_256_gcm,RAND_bytes, etc.).MODULES = plpgsql_wraptoMODULE_big = plpgsql_wrap+OBJS = plpgsql_wrap.osoSHLIB_LINK += $(OSSL_LIBS)actually takes effect.Before this fix,
pkg-config --cflags opensslworked (compile succeeded) butpkg-config --libs opensslwas discarded at link time.Test plan
make clean && make WRAP_KEY_HEX=$(openssl rand -hex 32)succeeds and producesplpgsql_wrap.dylib.-L<openssl-prefix>/lib -lssl -lcryptois present.sudo make install && make installcheckpasses the regression suite.