X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Fabi0-conflict%2Ftest_abi0_conflict;h=3a98dc94a6c1e322aadad74a28bd7dd7808438e1;hb=89a8858dc6fdaf6c094d9038db79fbc61469ccef;hp=cc5966eae448ab4c724e8f8c93b5137b322cc010;hpb=ef9cd5c799d6a7dade15a0e1c5e18831d0ac534b;p=lttng-ust.git diff --git a/tests/regression/abi0-conflict/test_abi0_conflict b/tests/regression/abi0-conflict/test_abi0_conflict index cc5966ea..3a98dc94 100755 --- a/tests/regression/abi0-conflict/test_abi0_conflict +++ b/tests/regression/abi0-conflict/test_abi0_conflict @@ -1,4 +1,7 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2023 EfficiOS, Inc +# # SPDX-License-Identifier: LGPL-2.1-only if [ "x${UST_TESTS_SRCDIR:-}" != "x" ]; then @@ -26,11 +29,21 @@ STD_ERROR="/dev/null" NUM_TESTS=22 +# Set this variable to disable tests that rely on a library using a symbol from +# the global offset table even if it provides its own copy, which is the +# default behavior on Linux. This happens when using the '-Bsymbolic-functions' +# linker flag. +UST_TESTS_LD_SYMBOLIC_FUNC=${UST_TESTS_LD_SYMBOLIC_FUNC:-} + # On FreeBSD, symbol resolution when dlopening a shared object will always # favor symbols local to this shared object and thus our canary function will # never be called which breaks our abi conflict detection when abi1 is loaded # first. if [ "$UST_OS_TYPE" = "freebsd" ]; then + UST_TESTS_LD_SYMBOLIC_FUNC=1 +fi + +if [ "$UST_TESTS_LD_SYMBOLIC_FUNC" != "" ]; then NUM_TESTS=$((NUM_TESTS - 4)) fi @@ -92,7 +105,7 @@ ok $? "dlopen: no-ust app with abi1 and abi1 succeeds" LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi0_abi1 >"$STD_OUTPUT" 2>"$STD_ERROR" isnt $? 0 "dlopen: no-ust app with abi0 and abi1 fails" -if [ "$UST_OS_TYPE" != "freebsd" ]; then +if [ "$UST_TESTS_LD_SYMBOLIC_FUNC" = "" ]; then LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi1_abi0 >"$STD_OUTPUT" 2>"$STD_ERROR" isnt $? 0 "dlopen: no-ust app with abi1 and abi0 fails" fi @@ -102,7 +115,7 @@ fi LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_ust_dlopen" abi1 >"$STD_OUTPUT" 2>"$STD_ERROR" ok $? "dlopen: ust app works" -if [ "$UST_OS_TYPE" != "freebsd" ]; then +if [ "$UST_TESTS_LD_SYMBOLIC_FUNC" = "" ]; then LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_ust_dlopen" abi0 >"$STD_OUTPUT" 2>"$STD_ERROR" isnt $? 0 "dlopen: ust app with abi0 fails"