Skip to content

Commit cf6c6eb

Browse files
committed
net-snmp: link client_intf.so against our custom-built OpenSSL
The Python extension (client_intf.so) was linking against system libcrypto.so.1.1. Two-part fix: 1. Add @openssl to deps and pass --with-openssl=$$EXT_BUILD_DEPS/openssl so net-snmp's configure uses our OpenSSL for the main library build. 2. Pass LDFLAGS="-L$$EXT_BUILD_DEPS/openssl/lib" when invoking setup.py in the postfix_script. The setup.py reads library names from net-snmp-config --libs but only net-snmp's own build dir ends up in library_dirs — OpenSSL's lib dir is silently dropped. The LDFLAGS env var ensures the linker finds our libcrypto.so.3 first. CMK-33658 Change-Id: Id56c3ea5ba037c246390b65a36c5db6bdc6df296 (cherry picked from commit 4899d32) (cherry picked from commit de9fc3c) (cherry picked from commit ded4cd9)
1 parent 741ad50 commit cf6c6eb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

omd/packages/net-snmp/BUILD.net-snmp.bazel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ configure_make(
2626
"--with-defaults",
2727
"--disable-scripts",
2828
'--with-mibdirs="\\\\$$\\$$HOME/local/share/snmp/mibs:\\\\$$\\$$HOME/share/snmp/mibs:/usr/share/snmp/mibs"',
29+
"--with-openssl=$EXT_BUILD_DEPS/openssl",
2930
],
3031
copts = [
3132
"-I$BUILD_TMPDIR/include",
@@ -86,7 +87,9 @@ configure_make(
8687
tar xf ${PYTHON_MODULES_TAR} -C $(dirname ${PYTHON_MODULES_TAR});
8788
mkdir -p lib/python
8889
cd python && \
89-
CFLAGS="-Wno-incompatible-pointer-types" ${EXT_BUILD_DEPS}/python/bin/python3 setup.py install \
90+
CFLAGS="-Wno-incompatible-pointer-types" \
91+
LDFLAGS="-L${EXT_BUILD_DEPS}/openssl/lib" \
92+
${EXT_BUILD_DEPS}/python/bin/python3 setup.py install \
9093
--basedir=.. \
9194
--root=${INSTALLDIR} \
9295
--prefix='' \
@@ -108,7 +111,10 @@ configure_make(
108111
"-C man DESTDIR='/' install",
109112
"-C mibs DESTDIR='/' mibsinstall",
110113
],
111-
deps = ["@python"],
114+
deps = [
115+
"@openssl",
116+
"@python",
117+
],
112118
)
113119

114120
genrule(

0 commit comments

Comments
 (0)