mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Merge pull request #4704 from flysand7/4614-thread-locals
Error if `-no-crt` is used without `-no-thread-locals`
This commit is contained in:
+21
-2
@@ -2124,6 +2124,7 @@ gb_internal bool init_build_paths(String init_filename) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool no_crt_checks_failed = false;
|
||||||
if (build_context.no_crt && !build_context.ODIN_DEFAULT_TO_NIL_ALLOCATOR && !build_context.ODIN_DEFAULT_TO_PANIC_ALLOCATOR) {
|
if (build_context.no_crt && !build_context.ODIN_DEFAULT_TO_NIL_ALLOCATOR && !build_context.ODIN_DEFAULT_TO_PANIC_ALLOCATOR) {
|
||||||
switch (build_context.metrics.os) {
|
switch (build_context.metrics.os) {
|
||||||
case TargetOs_linux:
|
case TargetOs_linux:
|
||||||
@@ -2133,11 +2134,29 @@ gb_internal bool init_build_paths(String init_filename) {
|
|||||||
case TargetOs_openbsd:
|
case TargetOs_openbsd:
|
||||||
case TargetOs_netbsd:
|
case TargetOs_netbsd:
|
||||||
case TargetOs_haiku:
|
case TargetOs_haiku:
|
||||||
gb_printf_err("-no-crt on unix systems requires either -default-to-nil-allocator or -default-to-panic-allocator to also be present because the default allocator requires crt\n");
|
gb_printf_err("-no-crt on Unix systems requires either -default-to-nil-allocator or -default-to-panic-allocator to also be present, because the default allocator requires CRT\n");
|
||||||
return false;
|
no_crt_checks_failed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (build_context.no_crt && !build_context.no_thread_local) {
|
||||||
|
switch (build_context.metrics.os) {
|
||||||
|
case TargetOs_linux:
|
||||||
|
case TargetOs_darwin:
|
||||||
|
case TargetOs_essence:
|
||||||
|
case TargetOs_freebsd:
|
||||||
|
case TargetOs_openbsd:
|
||||||
|
case TargetOs_netbsd:
|
||||||
|
case TargetOs_haiku:
|
||||||
|
gb_printf_err("-no-crt on Unix systems requires the -no-thread-local flag to also be present, because the TLS is inaccessible without CRT\n");
|
||||||
|
no_crt_checks_failed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (no_crt_checks_failed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1044,7 +1044,7 @@ gb_internal AstPackage *get_package_of_type(Type *type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// NOTE(bill): 'content_name' is for debugging and error messages
|
// NOTE(bill): 'context_name' is for debugging and error messages
|
||||||
gb_internal void check_assignment(CheckerContext *c, Operand *operand, Type *type, String context_name) {
|
gb_internal void check_assignment(CheckerContext *c, Operand *operand, Type *type, String context_name) {
|
||||||
check_not_tuple(c, operand);
|
check_not_tuple(c, operand);
|
||||||
if (operand->mode == Addressing_Invalid) {
|
if (operand->mode == Addressing_Invalid) {
|
||||||
|
|||||||
@@ -2334,6 +2334,10 @@ gb_internal void print_show_help(String const arg0, String command, String optio
|
|||||||
print_usage_line(2, "Sets the default allocator to be the nil_allocator, an allocator which does nothing.");
|
print_usage_line(2, "Sets the default allocator to be the nil_allocator, an allocator which does nothing.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (print_flag("-default-to-panic-allocator")) {
|
||||||
|
print_usage_line(2, "Sets the default allocator to be the panic_allocator, an allocator which calls panic() on any allocation attempt.");
|
||||||
|
}
|
||||||
|
|
||||||
if (print_flag("-define:<name>=<value>")) {
|
if (print_flag("-define:<name>=<value>")) {
|
||||||
print_usage_line(2, "Defines a scalar boolean, integer or string as global constant.");
|
print_usage_line(2, "Defines a scalar boolean, integer or string as global constant.");
|
||||||
print_usage_line(2, "Example: -define:SPAM=123");
|
print_usage_line(2, "Example: -define:SPAM=123");
|
||||||
|
|||||||
Reference in New Issue
Block a user