From 0aa971207ba14f791b1cae3652e67e674710cf8e Mon Sep 17 00:00:00 2001 From: Laytan Date: Wed, 4 Sep 2024 22:38:19 +0200 Subject: add -no-rpath --- src/linker.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/linker.cpp') diff --git a/src/linker.cpp b/src/linker.cpp index 25b9cfdc3..cdda87697 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -641,9 +641,11 @@ gb_internal i32 linker_stage(LinkerData *gen) { } } - // Set the rpath to the $ORIGIN (the path of the executable), - // so that dynamic libraries are looked for at that path. - gb_string_appendc(link_settings, "-Wl,-rpath,\\$ORIGIN "); + if (!build_context.no_rpath) { + // Set the rpath to the $ORIGIN (the path of the executable), + // so that dynamic libraries are looked for at that path. + gb_string_appendc(link_settings, "-Wl,-rpath,\\$ORIGIN "); + } if (!build_context.no_crt) { platform_lib_str = gb_string_appendc(platform_lib_str, "-lm "); -- cgit v1.2.3