Skip to content

Commit

Permalink
Debug LC_RPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
szpajder committed Oct 19, 2024
1 parent 7e8423b commit 7a7884e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Test run
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then echo dumpvdl2 libraries:; otool -L /usr/local/bin/dumpvdl2; echo libacars install_name:; otool -D /usr/local/lib/libacars-2.dylib; fi
if [[ "$RUNNER_OS" == "macOS" ]]; then echo dumpvdl2 libraries:; otool -L /usr/local/bin/dumpvdl2; echo libacars install_name:; otool -D /usr/local/lib/libacars-2.dylib; echo dumpvdl2 LC_RPATHs: otool -l /usr/local/bin/dumpvdl2 | grep LC_RPATH -A2; fi
DYLD_PRINT_SEARCHING=1 DYLD_PRINT_LIBRARIES=1 /usr/local/bin/dumpvdl2 ${VDL2_TEST1}
res=$(/usr/local/bin/dumpvdl2 ${VDL2_TEST1} | egrep -c "${VDL2_TEST1_EXPECT}")
if [[ "x$res" = "x" ]]; then false; fi
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# strdup
add_definitions(-D_XOPEN_SOURCE=600)

# strsep on MacOS
if(APPLE)
# strsep on MacOS
add_definitions(-D_DARWIN_C_SOURCE)
# libacars gets installed to /usr/local/lib by default,
# however dyld doesn't search this dir by default.
# We need to set the RPATH in the installed binary to the full path of the library.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

# silence warnings about obsolete _BSD_SOURCE in asn_system.h
Expand Down

0 comments on commit 7a7884e

Please sign in to comment.