mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
add -no-rpath
This commit is contained in:
@@ -411,6 +411,7 @@ struct BuildContext {
|
|||||||
bool no_dynamic_literals;
|
bool no_dynamic_literals;
|
||||||
bool no_output_files;
|
bool no_output_files;
|
||||||
bool no_crt;
|
bool no_crt;
|
||||||
|
bool no_rpath;
|
||||||
bool no_entry_point;
|
bool no_entry_point;
|
||||||
bool no_thread_local;
|
bool no_thread_local;
|
||||||
bool use_lld;
|
bool use_lld;
|
||||||
|
|||||||
+5
-3
@@ -641,9 +641,11 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the rpath to the $ORIGIN (the path of the executable),
|
if (!build_context.no_rpath) {
|
||||||
// so that dynamic libraries are looked for at that path.
|
// Set the rpath to the $ORIGIN (the path of the executable),
|
||||||
gb_string_appendc(link_settings, "-Wl,-rpath,\\$ORIGIN ");
|
// so that dynamic libraries are looked for at that path.
|
||||||
|
gb_string_appendc(link_settings, "-Wl,-rpath,\\$ORIGIN ");
|
||||||
|
}
|
||||||
|
|
||||||
if (!build_context.no_crt) {
|
if (!build_context.no_crt) {
|
||||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lm ");
|
platform_lib_str = gb_string_appendc(platform_lib_str, "-lm ");
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ enum BuildFlagKind {
|
|||||||
BuildFlag_NoTypeAssert,
|
BuildFlag_NoTypeAssert,
|
||||||
BuildFlag_NoDynamicLiterals,
|
BuildFlag_NoDynamicLiterals,
|
||||||
BuildFlag_NoCRT,
|
BuildFlag_NoCRT,
|
||||||
|
BuildFlag_NoRPath,
|
||||||
BuildFlag_NoEntryPoint,
|
BuildFlag_NoEntryPoint,
|
||||||
BuildFlag_UseLLD,
|
BuildFlag_UseLLD,
|
||||||
BuildFlag_UseSeparateModules,
|
BuildFlag_UseSeparateModules,
|
||||||
@@ -532,6 +533,7 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
|||||||
add_flag(&build_flags, BuildFlag_NoThreadLocal, str_lit("no-thread-local"), BuildFlagParam_None, Command__does_check);
|
add_flag(&build_flags, BuildFlag_NoThreadLocal, str_lit("no-thread-local"), BuildFlagParam_None, Command__does_check);
|
||||||
add_flag(&build_flags, BuildFlag_NoDynamicLiterals, str_lit("no-dynamic-literals"), BuildFlagParam_None, Command__does_check);
|
add_flag(&build_flags, BuildFlag_NoDynamicLiterals, str_lit("no-dynamic-literals"), BuildFlagParam_None, Command__does_check);
|
||||||
add_flag(&build_flags, BuildFlag_NoCRT, str_lit("no-crt"), BuildFlagParam_None, Command__does_build);
|
add_flag(&build_flags, BuildFlag_NoCRT, str_lit("no-crt"), BuildFlagParam_None, Command__does_build);
|
||||||
|
add_flag(&build_flags, BuildFlag_NoRPath, str_lit("no-rpath"), BuildFlagParam_None, Command__does_build);
|
||||||
add_flag(&build_flags, BuildFlag_NoEntryPoint, str_lit("no-entry-point"), BuildFlagParam_None, Command__does_check &~ Command_test);
|
add_flag(&build_flags, BuildFlag_NoEntryPoint, str_lit("no-entry-point"), BuildFlagParam_None, Command__does_check &~ Command_test);
|
||||||
add_flag(&build_flags, BuildFlag_UseLLD, str_lit("lld"), BuildFlagParam_None, Command__does_build);
|
add_flag(&build_flags, BuildFlag_UseLLD, str_lit("lld"), BuildFlagParam_None, Command__does_build);
|
||||||
add_flag(&build_flags, BuildFlag_UseSeparateModules, str_lit("use-separate-modules"), BuildFlagParam_None, Command__does_build);
|
add_flag(&build_flags, BuildFlag_UseSeparateModules, str_lit("use-separate-modules"), BuildFlagParam_None, Command__does_build);
|
||||||
@@ -1181,6 +1183,9 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
|||||||
case BuildFlag_NoCRT:
|
case BuildFlag_NoCRT:
|
||||||
build_context.no_crt = true;
|
build_context.no_crt = true;
|
||||||
break;
|
break;
|
||||||
|
case BuildFlag_NoRPath:
|
||||||
|
build_context.no_rpath = true;
|
||||||
|
break;
|
||||||
case BuildFlag_NoEntryPoint:
|
case BuildFlag_NoEntryPoint:
|
||||||
build_context.no_entry_point = true;
|
build_context.no_entry_point = true;
|
||||||
break;
|
break;
|
||||||
@@ -2310,6 +2315,10 @@ gb_internal void print_show_help(String const arg0, String const &command) {
|
|||||||
print_usage_line(2, "Disables automatic linking with the C Run Time.");
|
print_usage_line(2, "Disables automatic linking with the C Run Time.");
|
||||||
print_usage_line(0, "");
|
print_usage_line(0, "");
|
||||||
|
|
||||||
|
print_usage_line(1, "-no-rpath");
|
||||||
|
print_usage_line(2, "Disables automatic addition of an rpath linked to the executable directory.");
|
||||||
|
print_usage_line(0, "");
|
||||||
|
|
||||||
print_usage_line(1, "-no-thread-local");
|
print_usage_line(1, "-no-thread-local");
|
||||||
print_usage_line(2, "Ignores @thread_local attribute, effectively treating the program as if it is single-threaded.");
|
print_usage_line(2, "Ignores @thread_local attribute, effectively treating the program as if it is single-threaded.");
|
||||||
print_usage_line(0, "");
|
print_usage_line(0, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user