diff options
Diffstat (limited to 'src/linker.cpp')
| -rw-r--r-- | src/linker.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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 "); |