Commit 9d9d09de authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Add a -rpath entry for the RTS library, so that it can find libffi

This fixes dynamic library resolution when --enable-new-dtags is used
(#7062).

When --enable-new-dtags is used when linking an executable, a RUNPATH as
well as RPATH is set. The linker then ignores RPATH, and RUNPATH is only
used for directly (not transitively) needed libraries. As the program
doesn't directly need libffi, it isn't found.
parent fbff64a4
......@@ -196,6 +196,10 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/b
else
ifneq "$(UseSystemLibFFI)" "YES"
LIBFFI_LIBS = -Lrts/dist/build -lffi
ifeq "$$(TargetOS_CPP)" "linux"
LIBFFI_LIBS += -optl-Wl,-rpath -optl-Wl,'$$$$ORIGIN'
endif
else
# flags will be taken care of in rts/libs.depend
LIBFFI_LIBS =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment