navid/veins / commit

b5cb4a0403bd

Navid M <navidmomtahen@gmail.com> · 2026-11-27

parents: 35663f0f2ddf

Browse files at this commit · Download source

fw: amend build native tool
--- a/veins/build-native.sh+++ b/veins/build-native.sh@@ -38,11 +38,44 @@  # Link the OpenSSL static libraries into the native object so that the final # link does not depend on library ordering.+#+# Debian/Ubuntu build libcrypto.a with the JITTER entropy source enabled, so+# the archive contains undefined jent_* references. Spectre emits link flags+# before the native object, which means a plain `link "-ljitterentropy"` in the+# source is searched too early (and is dropped under --as-needed). Embed the+# jitter archive into the relocatable object instead, where ordering no longer+# matters. ssl_a=$("$cc" -print-file-name=libssl.a) crypto_a=$("$cc" -print-file-name=libcrypto.a)+jit_a=$("$cc" -print-file-name=libjitterentropy.a)+if [ ! -f "$jit_a" ]; then+    for cand in /usr/lib/*/libjitterentropy.a /usr/lib/libjitterentropy.a \+                /usr/local/lib/libjitterentropy.a \+                /usr/local/lib/*/libjitterentropy.a; do+        if [ -f "$cand" ]; then+            jit_a=$cand+            break+        fi+    done+fi if [ -f "$ssl_a" ] && [ -f "$crypto_a" ]; then-    "$cc" -r "$out/openssl_c.o" -Wl,--whole-archive "$ssl_a" "$crypto_a" \-        -Wl,--no-whole-archive -o "$out/openssl_embed.o"+    if [ -f "$jit_a" ]; then+        "$cc" -r "$out/openssl_c.o" -Wl,--whole-archive \+            "$ssl_a" "$crypto_a" "$jit_a" -Wl,--no-whole-archive \+            -o "$out/openssl_embed.o"+    else+        # Pull only the OpenSSL members that the wrapper actually needs. This+        # often avoids the optional jitter seed source entirely; if it does+        # not, report the dependency instead of failing later at the final+        # link with an opaque symbol error.+        "$cc" -r "$out/openssl_c.o" -Wl,--start-group \+            "$ssl_a" "$crypto_a" -Wl,--end-group -o "$out/openssl_embed.o"+        if command -v nm >/dev/null 2>&1 &&+            nm -u "$out/openssl_embed.o" 2>/dev/null | grep -q 'jent_'; then+            echo "build-native.sh: libcrypto.a needs libjitterentropy; install libjitterentropy3-dev (Debian/Ubuntu) or libjitterentropy-devel (Fedora)" >&2+            exit 1+        fi+    fi     objects="$objects $out/openssl_embed.o" else     echo "build-native.sh: OpenSSL static libraries not found; TLS will fail to link" >&2