summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2024-12-19 15:47:50 -0800
committerAndrew Clayton <a.clayton@nginx.com>2025-01-10 16:33:06 +0000
commit92c0d3488c059e375708664d6bc618245ffdd948 (patch)
treedd575b9e8eac1ba4296fd7bf0e6a3259500de838 /auto
parent1175e4048918acadd7a6f629537ec92c1919732d (diff)
downloadunit-92c0d3488c059e375708664d6bc618245ffdd948.tar.gz
unit-92c0d3488c059e375708664d6bc618245ffdd948.tar.bz2
auto/make, otel: fix linking on macOS and Ubuntu
The static library is supposed to be specified prior to its dependencies. Also, no need to put an otel static library inside libnxt static library, as we explicitely link unit binary with otel static library anyway. This fixes the following build problems: - macOS: Finished `release` profile [optimized] target(s) in 58.07s AR build/lib/libnxt.a LD build/sbin/unitd ld: archive member 'libotel.a' not a mach-o file in '/private/tmp/unit-20241219-8965-yb46xp/build/lib/libnxt.a' clang: error: linker command failed with exit code 1 (use -v to see invocation) - Ubuntu 22 (./configure --otel): LD build/sbin/unitd cc -Wl,-E -o build/sbin/unitd -pipe -fPIC -fvisibility=hidden -fno-strict-overflow -funsigned-char -std=gnu11 -O -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fno-strict-aliasing -Wmissing-prototypes -Werror -g \ build/src/nxt_main.o build/lib/libnxt.a \ -lm -lrt -lpthread \ \ -lpcre2-8 -lssl -lcrypto src/otel/target/release/libotel.a /usr/bin/ld: src/otel/target/release/libotel.a(reqwest-97d1376dfb77d784.reqwest.cb371ce8e1e3945e-cgu.04.rcgu.o): in function `core::ptr::drop_in_place<alloc::vec::Vec<reqwest::tls::Certificate>>': reqwest.cb371ce8e1e3945e-cgu.04:(.text._ZN4core3ptr69drop_in_place$LT$alloc..vec..Vec$LT$reqwest..tls..Certificate$GT$$GT$17h9b62679cc7161be5E+0x30): undefined reference to `X509_free' Fixes: 9d3dcb800 ("otel: add build tooling to include otel code") [ Tweaked subject prefix. s/NXT_OTEL_LIB_LOC/NXT_OTEL_LIB_STATIC/ - Andrew ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'auto')
-rw-r--r--auto/make10
1 files changed, 6 insertions, 4 deletions
diff --git a/auto/make b/auto/make
index 3ffac2fc..81994e6e 100644
--- a/auto/make
+++ b/auto/make
@@ -157,11 +157,12 @@ libnxt: $NXT_BUILD_DIR/lib/$NXT_LIB_SHARED $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC
$NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_STATIC)
\$(PP_LD) \$@
\$(v)\$(NXT_SHARED_LOCAL_LINK) -o \$@ \$(NXT_LIB_OBJS) \\
- $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS \$(NXT_OTEL_LIB_STATIC)
+ \$(NXT_OTEL_LIB_STATIC) \\
+ $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
-$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_STATIC)
+$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS)
\$(PP_AR) \$@
- \$(v)$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_STATIC)
+ \$(v)$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS)
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS) \\
$NXT_BUILD_DIR/share/pkgconfig/unit.pc \\
@@ -379,7 +380,8 @@ $NXT_BUILD_DIR/sbin/$NXT_DAEMON: $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\
\$(PP_LD) \$@
\$(v)\$(NXT_EXEC_LINK) -o \$@ \$(CFLAGS) \\
\$(NXT_OBJS) $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\
- $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS \$(NXT_OTEL_LIB_STATIC)
+ \$(NXT_OTEL_LIB_STATIC) \\
+ $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
END