From 5a5956bd204017321a86dd058898c0dc57ff2c03 Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Fri, 21 Aug 2020 14:31:24 -0600 Subject: [PATCH 01/55] Implement @Type for Enum --- src/analyze.cpp | 231 ++++++++++++++++++---------------- src/ir.cpp | 69 +++++++++- test/compile_errors.zig | 25 ++-- test/stage1/behavior/type.zig | 34 +++++ 4 files changed, 243 insertions(+), 116 deletions(-) diff --git a/src/analyze.cpp b/src/analyze.cpp index 7b71d7166b..acdbf3e933 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2586,7 +2586,6 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) { return ErrorNone; AstNode *decl_node = enum_type->data.enumeration.decl_node; - assert(decl_node->type == NodeTypeContainerDecl); if (enum_type->data.enumeration.resolve_loop_flag) { if (enum_type->data.enumeration.resolve_status != ResolveStatusInvalid) { @@ -2600,15 +2599,20 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) { enum_type->data.enumeration.resolve_loop_flag = true; - assert(!enum_type->data.enumeration.fields); - uint32_t field_count = (uint32_t)decl_node->data.container_decl.fields.length; - if (field_count == 0) { - add_node_error(g, decl_node, buf_sprintf("enums must have 1 or more fields")); + uint32_t field_count; + if (decl_node->type == NodeTypeContainerDecl) { + assert(!enum_type->data.enumeration.fields); + field_count = (uint32_t)decl_node->data.container_decl.fields.length; + if (field_count == 0) { + add_node_error(g, decl_node, buf_sprintf("enums must have 1 or more fields")); - enum_type->data.enumeration.src_field_count = field_count; - enum_type->data.enumeration.fields = nullptr; - enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; - return ErrorSemanticAnalyzeFail; + enum_type->data.enumeration.src_field_count = field_count; + enum_type->data.enumeration.fields = nullptr; + enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + return ErrorSemanticAnalyzeFail; + } + } else { + field_count = enum_type->data.enumeration.src_field_count; } Scope *scope = &enum_type->data.enumeration.decls_scope->base; @@ -2624,8 +2628,16 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) { enum_type->abi_size = tag_int_type->abi_size; enum_type->abi_align = tag_int_type->abi_align; - if (decl_node->data.container_decl.init_arg_expr != nullptr) { - ZigType *wanted_tag_int_type = analyze_type_expr(g, scope, decl_node->data.container_decl.init_arg_expr); + ZigType *wanted_tag_int_type = nullptr; + if (decl_node->type == NodeTypeContainerDecl) { + if (decl_node->data.container_decl.init_arg_expr != nullptr) { + wanted_tag_int_type = analyze_type_expr(g, scope, decl_node->data.container_decl.init_arg_expr); + } + } else { + wanted_tag_int_type = enum_type->data.enumeration.tag_int_type; + } + + if (wanted_tag_int_type != nullptr) { if (type_is_invalid(wanted_tag_int_type)) { enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; } else if (wanted_tag_int_type->id != ZigTypeIdInt && @@ -2654,7 +2666,6 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) { } } - enum_type->data.enumeration.non_exhaustive = false; enum_type->data.enumeration.tag_int_type = tag_int_type; enum_type->size_in_bits = tag_int_type->size_in_bits; enum_type->abi_size = tag_int_type->abi_size; @@ -2663,121 +2674,131 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) { BigInt bi_one; bigint_init_unsigned(&bi_one, 1); - AstNode *last_field_node = decl_node->data.container_decl.fields.at(field_count - 1); - if (buf_eql_str(last_field_node->data.struct_field.name, "_")) { - field_count -= 1; - if (field_count > 1 && log2_u64(field_count) == enum_type->size_in_bits) { - add_node_error(g, last_field_node, buf_sprintf("non-exhaustive enum specifies every value")); - enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + if (decl_node->type == NodeTypeContainerDecl) { + AstNode *last_field_node = decl_node->data.container_decl.fields.at(field_count - 1); + if (buf_eql_str(last_field_node->data.struct_field.name, "_")) { + if (last_field_node->data.struct_field.value != nullptr) { + add_node_error(g, last_field_node, buf_sprintf("value assigned to '_' field of non-exhaustive enum")); + enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + } + if (decl_node->data.container_decl.init_arg_expr == nullptr) { + add_node_error(g, decl_node, buf_sprintf("non-exhaustive enum must specify size")); + enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + } + enum_type->data.enumeration.non_exhaustive = true; + } else { + enum_type->data.enumeration.non_exhaustive = false; } - if (decl_node->data.container_decl.init_arg_expr == nullptr) { - add_node_error(g, last_field_node, buf_sprintf("non-exhaustive enum must specify size")); - enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; - } - if (last_field_node->data.struct_field.value != nullptr) { - add_node_error(g, last_field_node, buf_sprintf("value assigned to '_' field of non-exhaustive enum")); - enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; - } - enum_type->data.enumeration.non_exhaustive = true; } - enum_type->data.enumeration.src_field_count = field_count; - enum_type->data.enumeration.fields = heap::c_allocator.allocate(field_count); - enum_type->data.enumeration.fields_by_name.init(field_count); - - HashMap occupied_tag_values = {}; - occupied_tag_values.init(field_count); - - TypeEnumField *last_enum_field = nullptr; - - for (uint32_t field_i = 0; field_i < field_count; field_i += 1) { - AstNode *field_node = decl_node->data.container_decl.fields.at(field_i); - TypeEnumField *type_enum_field = &enum_type->data.enumeration.fields[field_i]; - type_enum_field->name = field_node->data.struct_field.name; - type_enum_field->decl_index = field_i; - type_enum_field->decl_node = field_node; - - if (field_node->data.struct_field.type != nullptr) { - ErrorMsg *msg = add_node_error(g, field_node->data.struct_field.type, - buf_sprintf("structs and unions, not enums, support field types")); - add_error_note(g, msg, decl_node, - buf_sprintf("consider 'union(enum)' here")); - } else if (field_node->data.struct_field.align_expr != nullptr) { - ErrorMsg *msg = add_node_error(g, field_node->data.struct_field.align_expr, - buf_sprintf("structs and unions, not enums, support field alignment")); - add_error_note(g, msg, decl_node, - buf_sprintf("consider 'union(enum)' here")); - } - - if (buf_eql_str(type_enum_field->name, "_")) { - add_node_error(g, field_node, buf_sprintf("'_' field of non-exhaustive enum must be last")); + if (enum_type->data.enumeration.non_exhaustive) { + field_count -= 1; + if (field_count > 1 && log2_u64(field_count) == enum_type->size_in_bits) { + add_node_error(g, decl_node, buf_sprintf("non-exhaustive enum specifies every value")); enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; } + } - auto field_entry = enum_type->data.enumeration.fields_by_name.put_unique(type_enum_field->name, type_enum_field); - if (field_entry != nullptr) { - ErrorMsg *msg = add_node_error(g, field_node, - buf_sprintf("duplicate enum field: '%s'", buf_ptr(type_enum_field->name))); - add_error_note(g, msg, field_entry->value->decl_node, buf_sprintf("other field here")); - enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; - continue; - } + if (decl_node->type == NodeTypeContainerDecl) { + enum_type->data.enumeration.src_field_count = field_count; + enum_type->data.enumeration.fields = heap::c_allocator.allocate(field_count); + enum_type->data.enumeration.fields_by_name.init(field_count); - AstNode *tag_value = field_node->data.struct_field.value; + HashMap occupied_tag_values = {}; + occupied_tag_values.init(field_count); - if (tag_value != nullptr) { - // A user-specified value is available - ZigValue *result = analyze_const_value(g, scope, tag_value, tag_int_type, - nullptr, UndefBad); - if (type_is_invalid(result->type)) { + TypeEnumField *last_enum_field = nullptr; + + for (uint32_t field_i = 0; field_i < field_count; field_i += 1) { + AstNode *field_node = decl_node->data.container_decl.fields.at(field_i); + TypeEnumField *type_enum_field = &enum_type->data.enumeration.fields[field_i]; + type_enum_field->name = field_node->data.struct_field.name; + type_enum_field->decl_index = field_i; + type_enum_field->decl_node = field_node; + + if (field_node->data.struct_field.type != nullptr) { + ErrorMsg *msg = add_node_error(g, field_node->data.struct_field.type, + buf_sprintf("structs and unions, not enums, support field types")); + add_error_note(g, msg, decl_node, + buf_sprintf("consider 'union(enum)' here")); + } else if (field_node->data.struct_field.align_expr != nullptr) { + ErrorMsg *msg = add_node_error(g, field_node->data.struct_field.align_expr, + buf_sprintf("structs and unions, not enums, support field alignment")); + add_error_note(g, msg, decl_node, + buf_sprintf("consider 'union(enum)' here")); + } + + if (buf_eql_str(type_enum_field->name, "_")) { + add_node_error(g, field_node, buf_sprintf("'_' field of non-exhaustive enum must be last")); + enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + } + + auto field_entry = enum_type->data.enumeration.fields_by_name.put_unique(type_enum_field->name, type_enum_field); + if (field_entry != nullptr) { + ErrorMsg *msg = add_node_error(g, field_node, + buf_sprintf("duplicate enum field: '%s'", buf_ptr(type_enum_field->name))); + add_error_note(g, msg, field_entry->value->decl_node, buf_sprintf("other field here")); enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; continue; } - assert(result->special != ConstValSpecialRuntime); - assert(result->type->id == ZigTypeIdInt || result->type->id == ZigTypeIdComptimeInt); + AstNode *tag_value = field_node->data.struct_field.value; - bigint_init_bigint(&type_enum_field->value, &result->data.x_bigint); - } else { - // No value was explicitly specified: allocate the last value + 1 - // or, if this is the first element, zero - if (last_enum_field != nullptr) { - bigint_add(&type_enum_field->value, &last_enum_field->value, &bi_one); + if (tag_value != nullptr) { + // A user-specified value is available + ZigValue *result = analyze_const_value(g, scope, tag_value, tag_int_type, + nullptr, UndefBad); + if (type_is_invalid(result->type)) { + enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + continue; + } + + assert(result->special != ConstValSpecialRuntime); + assert(result->type->id == ZigTypeIdInt || result->type->id == ZigTypeIdComptimeInt); + + bigint_init_bigint(&type_enum_field->value, &result->data.x_bigint); } else { - bigint_init_unsigned(&type_enum_field->value, 0); + // No value was explicitly specified: allocate the last value + 1 + // or, if this is the first element, zero + if (last_enum_field != nullptr) { + bigint_add(&type_enum_field->value, &last_enum_field->value, &bi_one); + } else { + bigint_init_unsigned(&type_enum_field->value, 0); + } + + // Make sure we can represent this number with tag_int_type + if (!bigint_fits_in_bits(&type_enum_field->value, + tag_int_type->size_in_bits, + tag_int_type->data.integral.is_signed)) { + enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; + + Buf *val_buf = buf_alloc(); + bigint_append_buf(val_buf, &type_enum_field->value, 10); + add_node_error(g, field_node, + buf_sprintf("enumeration value %s too large for type '%s'", + buf_ptr(val_buf), buf_ptr(&tag_int_type->name))); + + break; + } } - // Make sure we can represent this number with tag_int_type - if (!bigint_fits_in_bits(&type_enum_field->value, - tag_int_type->size_in_bits, - tag_int_type->data.integral.is_signed)) { + // Make sure the value is unique + auto entry = occupied_tag_values.put_unique(type_enum_field->value, field_node); + if (entry != nullptr && enum_type->data.enumeration.layout != ContainerLayoutExtern) { enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; Buf *val_buf = buf_alloc(); bigint_append_buf(val_buf, &type_enum_field->value, 10); - add_node_error(g, field_node, - buf_sprintf("enumeration value %s too large for type '%s'", - buf_ptr(val_buf), buf_ptr(&tag_int_type->name))); - break; + ErrorMsg *msg = add_node_error(g, field_node, + buf_sprintf("enum tag value %s already taken", buf_ptr(val_buf))); + add_error_note(g, msg, entry->value, + buf_sprintf("other occurrence here")); } + + last_enum_field = type_enum_field; } - - // Make sure the value is unique - auto entry = occupied_tag_values.put_unique(type_enum_field->value, field_node); - if (entry != nullptr && enum_type->data.enumeration.layout != ContainerLayoutExtern) { - enum_type->data.enumeration.resolve_status = ResolveStatusInvalid; - - Buf *val_buf = buf_alloc(); - bigint_append_buf(val_buf, &type_enum_field->value, 10); - - ErrorMsg *msg = add_node_error(g, field_node, - buf_sprintf("enum tag value %s already taken", buf_ptr(val_buf))); - add_error_note(g, msg, entry->value, - buf_sprintf("other occurrence here")); - } - - last_enum_field = type_enum_field; + occupied_tag_values.deinit(); } if (enum_type->data.enumeration.resolve_status == ResolveStatusInvalid) @@ -2786,8 +2807,6 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) { enum_type->data.enumeration.resolve_loop_flag = false; enum_type->data.enumeration.resolve_status = ResolveStatusSizeKnown; - occupied_tag_values.deinit(); - return ErrorNone; } diff --git a/src/ir.cpp b/src/ir.cpp index 976c50b8ff..731f31fbb4 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -26276,7 +26276,74 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI return entry; } - case ZigTypeIdEnum: + case ZigTypeIdEnum: { + assert(payload->special == ConstValSpecialStatic); + assert(payload->type == ir_type_info_get_type(ira, "Enum", nullptr)); + + ZigValue *layout_value = get_const_field(ira, source_instr->source_node, payload, "layout", 0); + assert(layout_value->special == ConstValSpecialStatic); + assert(layout_value->type == ir_type_info_get_type(ira, "ContainerLayout", nullptr)); + ContainerLayout layout = (ContainerLayout)bigint_as_u32(&layout_value->data.x_enum_tag); + + ZigType *tag_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "tag_type", 1); + + ZigValue *fields_value = get_const_field(ira, source_instr->source_node, payload, "fields", 2); + assert(fields_value->special == ConstValSpecialStatic); + assert(is_slice(fields_value->type)); + ZigValue *fields_ptr = fields_value->data.x_struct.fields[slice_ptr_index]; + ZigValue *fields_len_value = fields_value->data.x_struct.fields[slice_len_index]; + size_t fields_len = bigint_as_usize(&fields_len_value->data.x_bigint); + + ZigValue *decls_value = get_const_field(ira, source_instr->source_node, payload, "decls", 3); + assert(decls_value->special == ConstValSpecialStatic); + assert(is_slice(decls_value->type)); + ZigValue *decls_len_value = decls_value->data.x_struct.fields[slice_len_index]; + size_t decls_len = bigint_as_usize(&decls_len_value->data.x_bigint); + if (decls_len != 0) { + ir_add_error(ira, source_instr, buf_create_from_str("TypeInfo.Enum.decls must be empty for @Type")); + return ira->codegen->invalid_inst_gen->value->type; + } + + Error err; + bool is_exhaustive; + if ((err = get_const_field_bool(ira, source_instr->source_node, payload, "is_exhaustive", 4, &is_exhaustive))) + return ira->codegen->invalid_inst_gen->value->type; + + ZigType *entry = new_type_table_entry(ZigTypeIdEnum); + buf_init_from_buf(&entry->name, + get_anon_type_name(ira->codegen, ira->old_irb.exec, "enum", source_instr->scope, source_instr->source_node, &entry->name)); + entry->data.enumeration.decl_node = source_instr->source_node; + entry->data.enumeration.tag_int_type = tag_type; + entry->data.enumeration.decls_scope = create_decls_scope(ira->codegen, nullptr, nullptr, entry, entry, &entry->name); + entry->data.enumeration.fields = heap::c_allocator.allocate(fields_len); + entry->data.enumeration.fields_by_name.init(fields_len); + entry->data.enumeration.src_field_count = fields_len; + entry->data.enumeration.layout = layout; + entry->data.enumeration.non_exhaustive = !is_exhaustive; + + assert(fields_ptr->data.x_ptr.special == ConstPtrSpecialBaseArray); + assert(fields_ptr->data.x_ptr.data.base_array.elem_index == 0); + ZigValue *fields_arr = fields_ptr->data.x_ptr.data.base_array.array_val; + assert(fields_arr->special == ConstValSpecialStatic); + assert(fields_arr->data.x_array.special == ConstArraySpecialNone); + for (size_t i = 0; i < fields_len; i++) { + ZigValue *field_value = &fields_arr->data.x_array.data.s_none.elements[i]; + assert(field_value->type == ir_type_info_get_type(ira, "EnumField", nullptr)); + TypeEnumField *field = &entry->data.enumeration.fields[i]; + field->name = buf_alloc(); + if ((err = get_const_field_buf(ira, source_instr->source_node, field_value, "name", 0, field->name))) + return ira->codegen->invalid_inst_gen->value->type; + field->decl_index = i; + field->decl_node = source_instr->source_node; + if (entry->data.enumeration.fields_by_name.put_unique(field->name, field) != nullptr) { + ir_add_error(ira, source_instr, buf_sprintf("duplicate enum field '%s'", buf_ptr(field->name))); + return ira->codegen->invalid_inst_gen->value->type; + } + field->value = *get_const_field_lit_int(ira, source_instr->source_node, field_value, "value", 1); + } + + return entry; + } case ZigTypeIdUnion: ir_add_error(ira, source_instr, buf_sprintf( "TODO implement @Type for 'TypeInfo.%s': see https://github.com/ziglang/zig/issues/2907", type_id_name(tagTypeId))); diff --git a/test/compile_errors.zig b/test/compile_errors.zig index ca75b2fa9c..633df50368 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,22 @@ const tests = @import("tests.zig"); const std = @import("std"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.add("struct with declarations unavailable for @Type", + \\export fn entry() void { + \\ _ = @Type(@typeInfo(struct { const foo = 1; })); + \\} + , &[_][]const u8{ + "tmp.zig:2:15: error: TypeInfo.Struct.decls must be empty for @Type", + }); + + cases.add("enum with declarations unavailable for @Type", + \\export fn entry() void { + \\ _ = @Type(@typeInfo(enum { foo, const bar = 1; })); + \\} + , &[_][]const u8{ + "tmp.zig:2:15: error: TypeInfo.Enum.decls must be empty for @Type", + }); + cases.addTest("reject extern variables with initializers", \\extern var foo: int = 2; , &[_][]const u8{ @@ -1400,15 +1416,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { , &[_][]const u8{ "tmp.zig:3:36: error: expected type 'std.builtin.TypeInfo', found 'std.builtin.Int'", }); - - cases.add("struct with declarations unavailable for @Type", - \\export fn entry() void { - \\ _ = @Type(@typeInfo(struct { const foo = 1; })); - \\} - , &[_][]const u8{ - "tmp.zig:2:15: error: TypeInfo.Struct.decls must be empty for @Type", - }); - cases.add("wrong type for argument tuple to @asyncCall", \\export fn entry1() void { \\ var frame: @Frame(foo) = undefined; diff --git a/test/stage1/behavior/type.zig b/test/stage1/behavior/type.zig index 8ebf670279..949576fd04 100644 --- a/test/stage1/behavior/type.zig +++ b/test/stage1/behavior/type.zig @@ -280,3 +280,37 @@ test "Type.Struct" { testing.expectEqual(@as(usize, 0), infoC.decls.len); testing.expectEqual(@as(bool, false), infoC.is_tuple); } + +test "Type.Enum" { + const Foo = @Type(.{ + .Enum = .{ + .layout = .Auto, + .tag_type = u8, + .fields = &[_]TypeInfo.EnumField{ + .{ .name = "a", .value = 1 }, + .{ .name = "b", .value = 5 }, + }, + .decls = &[_]TypeInfo.Declaration{}, + .is_exhaustive = true, + }, + }); + testing.expectEqual(true, @typeInfo(Foo).Enum.is_exhaustive); + testing.expectEqual(@as(u8, 1), @enumToInt(Foo.a)); + testing.expectEqual(@as(u8, 5), @enumToInt(Foo.b)); + const Bar = @Type(.{ + .Enum = .{ + .layout = .Extern, + .tag_type = u32, + .fields = &[_]TypeInfo.EnumField{ + .{ .name = "a", .value = 1 }, + .{ .name = "b", .value = 5 }, + }, + .decls = &[_]TypeInfo.Declaration{}, + .is_exhaustive = false, + }, + }); + testing.expectEqual(false, @typeInfo(Bar).Enum.is_exhaustive); + testing.expectEqual(@as(u32, 1), @enumToInt(Bar.a)); + testing.expectEqual(@as(u32, 5), @enumToInt(Bar.b)); + testing.expectEqual(@as(u32, 6), @enumToInt(@intToEnum(Bar, 6))); +} From c31e8701d70416b3d95d66740ae2f6a6043a6922 Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Fri, 21 Aug 2020 15:00:23 -0600 Subject: [PATCH 02/55] Update compile-errors test for @Type(.Enum) changes --- test/compile_errors.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 633df50368..f6a1fa5105 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -614,8 +614,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { \\ _ = C; \\} , &[_][]const u8{ - "tmp.zig:4:5: error: non-exhaustive enum must specify size", - "error: value assigned to '_' field of non-exhaustive enum", + "tmp.zig:4:5: error: value assigned to '_' field of non-exhaustive enum", + "error: non-exhaustive enum must specify size", "error: non-exhaustive enum specifies every value", "error: '_' field of non-exhaustive enum must be last", }); From 351701bcadcd4fd00b1d69212d7ac203326ed02d Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Fri, 21 Aug 2020 17:45:30 -0600 Subject: [PATCH 03/55] @Type for Enum fix: use correct decls_scope --- src/ir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ir.cpp b/src/ir.cpp index 731f31fbb4..43bdaa8def 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -26314,7 +26314,8 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI get_anon_type_name(ira->codegen, ira->old_irb.exec, "enum", source_instr->scope, source_instr->source_node, &entry->name)); entry->data.enumeration.decl_node = source_instr->source_node; entry->data.enumeration.tag_int_type = tag_type; - entry->data.enumeration.decls_scope = create_decls_scope(ira->codegen, nullptr, nullptr, entry, entry, &entry->name); + entry->data.enumeration.decls_scope = create_decls_scope( + ira->codegen, source_instr->source_node, source_instr->scope, entry, get_scope_import(source_instr->scope), &entry->name); entry->data.enumeration.fields = heap::c_allocator.allocate(fields_len); entry->data.enumeration.fields_by_name.init(fields_len); entry->data.enumeration.src_field_count = fields_len; From f18b92ef3ab689749efd135968f0834478f9fffa Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 21 Aug 2020 23:36:21 -0700 Subject: [PATCH 04/55] stage2: implement spilling registers to the stack --- src-self-hosted/codegen.zig | 235 +++++++++++++++++++++++++++--------- test/stage2/test.zig | 52 ++++++++ 2 files changed, 227 insertions(+), 60 deletions(-) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 36bebe1ca5..ca6d9d800b 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -14,6 +14,7 @@ const Allocator = mem.Allocator; const trace = @import("tracy.zig").trace; const DW = std.dwarf; const leb128 = std.debug.leb; +const log = std.log.scoped(.codegen); // TODO Turn back on zig fmt when https://github.com/ziglang/zig/issues/5948 is implemented. // zig fmt: off @@ -344,6 +345,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { const Branch = struct { inst_table: std.AutoHashMapUnmanaged(*ir.Inst, MCValue) = .{}, + /// The key must be canonical register. registers: std.AutoHashMapUnmanaged(Register, RegisterAllocation) = .{}, free_registers: FreeRegInt = math.maxInt(FreeRegInt), @@ -381,9 +383,19 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { self.free_registers &= ~(@as(FreeRegInt, 1) << free_index); const reg = callee_preserved_regs[free_index]; self.registers.putAssumeCapacityNoClobber(reg, .{ .inst = inst }); + log.debug("alloc {} => {*}", .{reg, inst}); return reg; } + /// Does not track the register. + fn findUnusedReg(self: *Branch) ?Register { + const free_index = @ctz(FreeRegInt, self.free_registers); + if (free_index >= callee_preserved_regs.len) { + return null; + } + return callee_preserved_regs[free_index]; + } + fn deinit(self: *Branch, gpa: *Allocator) void { self.inst_table.deinit(gpa); self.registers.deinit(gpa); @@ -570,8 +582,10 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; const inst_table = &branch.inst_table; for (body.instructions) |inst| { - const new_inst = try self.genFuncInst(inst); - try inst_table.putNoClobber(self.gpa, inst, new_inst); + const mcv = try self.genFuncInst(inst); + log.debug("{*} => {}", .{inst, mcv}); + // TODO don't put void or dead things in here + try inst_table.putNoClobber(self.gpa, inst, mcv); var i: ir.Inst.DeathsBitIndex = 0; while (inst.getOperand(i)) |operand| : (i += 1) { @@ -714,7 +728,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { return self.allocMem(inst, abi_size, abi_align); } - fn allocRegOrMem(self: *Self, inst: *ir.Inst) !MCValue { + fn allocRegOrMem(self: *Self, inst: *ir.Inst, reg_ok: bool) !MCValue { const elem_ty = inst.ty; const abi_size = math.cast(u32, elem_ty.abiSize(self.target.*)) catch { return self.fail(inst.src, "type '{}' too big to fit into stack frame", .{elem_ty}); @@ -724,30 +738,73 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { self.stack_align = abi_align; const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; - // Make sure the type can fit in a register before we try to allocate one. - const ptr_bits = arch.ptrBitWidth(); - const ptr_bytes: u64 = @divExact(ptr_bits, 8); - if (abi_size <= ptr_bytes) { - try branch.registers.ensureCapacity(self.gpa, branch.registers.items().len + 1); - if (branch.allocReg(inst)) |reg| { - return MCValue{ .register = registerAlias(reg, abi_size) }; + if (reg_ok) { + // Make sure the type can fit in a register before we try to allocate one. + const ptr_bits = arch.ptrBitWidth(); + const ptr_bytes: u64 = @divExact(ptr_bits, 8); + if (abi_size <= ptr_bytes) { + try branch.registers.ensureCapacity(self.gpa, branch.registers.items().len + 1); + if (branch.allocReg(inst)) |reg| { + return MCValue{ .register = registerAlias(reg, abi_size) }; + } } } const stack_offset = try self.allocMem(inst, abi_size, abi_align); return MCValue{ .stack_offset = stack_offset }; } - /// Does not "move" the instruction. - fn copyToNewRegister(self: *Self, inst: *ir.Inst) !MCValue { + /// Copies a value to a register without tracking the register. The register is not considered + /// allocated. A second call to `copyToTmpRegister` may return the same register. + /// This can have a side effect of spilling instructions to the stack to free up a register. + fn copyToTmpRegister(self: *Self, src: usize, mcv: MCValue) !Register { + const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; + + const reg = branch.findUnusedReg() orelse b: { + // We'll take over the first register. Move the instruction that was previously + // there to a stack allocation. + const reg = callee_preserved_regs[0]; + const regs_entry = branch.registers.remove(reg).?; + const spilled_inst = regs_entry.value.inst; + + const stack_mcv = try self.allocRegOrMem(spilled_inst, false); + const inst_entry = branch.inst_table.getEntry(spilled_inst).?; + const reg_mcv = inst_entry.value; + assert(reg == toCanonicalReg(reg_mcv.register)); + inst_entry.value = stack_mcv; + try self.genSetStack(src, spilled_inst.ty, stack_mcv.stack_offset, reg_mcv); + + break :b reg; + }; + try self.genSetReg(src, reg, mcv); + return reg; + } + + /// Allocates a new register and copies `mcv` into it. + /// `reg_owner` is the instruction that gets associated with the register in the register table. + /// This can have a side effect of spilling instructions to the stack to free up a register. + fn copyToNewRegister(self: *Self, reg_owner: *ir.Inst, mcv: MCValue) !MCValue { const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; try branch.registers.ensureCapacity(self.gpa, branch.registers.items().len + 1); - const reg = branch.allocReg(inst) orelse - return self.fail(inst.src, "TODO implement spilling register to stack", .{}); - const old_mcv = branch.inst_table.get(inst).?; - const new_mcv: MCValue = .{ .register = reg }; - try self.genSetReg(inst.src, reg, old_mcv); - return new_mcv; + const reg = branch.allocReg(reg_owner) orelse b: { + // We'll take over the first register. Move the instruction that was previously + // there to a stack allocation. + const reg = callee_preserved_regs[0]; + const regs_entry = branch.registers.getEntry(reg).?; + const spilled_inst = regs_entry.value.inst; + regs_entry.value = .{ .inst = reg_owner }; + + const stack_mcv = try self.allocRegOrMem(spilled_inst, false); + const inst_entry = branch.inst_table.getEntry(spilled_inst).?; + const reg_mcv = inst_entry.value; + assert(reg == toCanonicalReg(reg_mcv.register)); + inst_entry.value = stack_mcv; + try self.genSetStack(reg_owner.src, spilled_inst.ty, stack_mcv.stack_offset, reg_mcv); + + break :b reg; + }; + try self.genSetReg(reg_owner.src, reg, mcv); + return MCValue{ .register = reg }; } fn genAlloc(self: *Self, inst: *ir.Inst.NoOp) !MCValue { @@ -868,13 +925,29 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { } } - fn reuseOperand(inst: *ir.Inst, op_index: ir.Inst.DeathsBitIndex, mcv: MCValue) bool { - if (!inst.operandDies(op_index) or !mcv.isMutable()) + fn reuseOperand(self: *Self, inst: *ir.Inst, op_index: ir.Inst.DeathsBitIndex, mcv: MCValue) bool { + if (!inst.operandDies(op_index)) return false; - // OK we're going to do it, but we need to clear the operand death bit so that - // it stays allocated. + switch (mcv) { + .register => |reg| { + // If it's in the registers table, need to associate the register with the + // new instruction. + const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; + const entry = branch.registers.getEntry(toCanonicalReg(reg)).?; + entry.value = .{ .inst = inst }; + log.debug("reusing {} => {*}", .{reg, inst}); + }, + .stack_offset => |off| { + log.debug("reusing stack offset {} => {*}", .{off, inst}); + return true; + }, + else => return false, + } + + // Prevent the operand deaths processing code from deallocating it. inst.clearOperandDeath(op_index); + return true; } @@ -887,11 +960,11 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { if (inst.base.isUnused() and !is_volatile) return MCValue.dead; const dst_mcv: MCValue = blk: { - if (reuseOperand(&inst.base, 0, ptr)) { + if (self.reuseOperand(&inst.base, 0, ptr)) { // The MCValue that holds the pointer can be re-used as the value. break :blk ptr; } else { - break :blk try self.allocRegOrMem(&inst.base); + break :blk try self.allocRegOrMem(&inst.base, true); } }; switch (ptr) { @@ -985,23 +1058,23 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { var dst_mcv: MCValue = undefined; var src_mcv: MCValue = undefined; var src_inst: *ir.Inst = undefined; - if (reuseOperand(inst, 0, lhs)) { + if (self.reuseOperand(inst, 0, lhs)) { // LHS dies; use it as the destination. // Both operands cannot be memory. src_inst = op_rhs; if (lhs.isMemory() and rhs.isMemory()) { - dst_mcv = try self.copyToNewRegister(op_lhs); + dst_mcv = try self.copyToNewRegister(inst, lhs); src_mcv = rhs; } else { dst_mcv = lhs; src_mcv = rhs; } - } else if (reuseOperand(inst, 1, rhs)) { + } else if (self.reuseOperand(inst, 1, rhs)) { // RHS dies; use it as the destination. // Both operands cannot be memory. src_inst = op_lhs; if (lhs.isMemory() and rhs.isMemory()) { - dst_mcv = try self.copyToNewRegister(op_rhs); + dst_mcv = try self.copyToNewRegister(inst, rhs); src_mcv = lhs; } else { dst_mcv = rhs; @@ -1009,11 +1082,11 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { } } else { if (lhs.isMemory()) { - dst_mcv = try self.copyToNewRegister(op_lhs); + dst_mcv = try self.copyToNewRegister(inst, lhs); src_mcv = rhs; src_inst = op_rhs; } else { - dst_mcv = try self.copyToNewRegister(op_rhs); + dst_mcv = try self.copyToNewRegister(inst, rhs); src_mcv = lhs; src_inst = op_lhs; } @@ -1026,18 +1099,26 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { switch (src_mcv) { .immediate => |imm| { if (imm > math.maxInt(u31)) { - src_mcv = try self.copyToNewRegister(src_inst); + src_mcv = MCValue{ .register = try self.copyToTmpRegister(src_inst.src, src_mcv) }; } }, else => {}, } - try self.genX8664BinMathCode(inst.src, dst_mcv, src_mcv, opx, mr); + try self.genX8664BinMathCode(inst.src, inst.ty, dst_mcv, src_mcv, opx, mr); return dst_mcv; } - fn genX8664BinMathCode(self: *Self, src: usize, dst_mcv: MCValue, src_mcv: MCValue, opx: u8, mr: u8) !void { + fn genX8664BinMathCode( + self: *Self, + src: usize, + dst_ty: Type, + dst_mcv: MCValue, + src_mcv: MCValue, + opx: u8, + mr: u8, + ) !void { switch (dst_mcv) { .none => unreachable, .undef => unreachable, @@ -1087,12 +1168,60 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { }, } }, - .embedded_in_code, .memory, .stack_offset => { + .stack_offset => |off| { + switch (src_mcv) { + .none => unreachable, + .undef => return self.genSetStack(src, dst_ty, off, .undef), + .dead, .unreach => unreachable, + .ptr_stack_offset => unreachable, + .ptr_embedded_in_code => unreachable, + .register => |src_reg| { + try self.genX8664ModRMRegToStack(src, dst_ty, off, src_reg, mr + 0x1); + }, + .immediate => |imm| { + return self.fail(src, "TODO implement x86 ADD/SUB/CMP source immediate", .{}); + }, + .embedded_in_code, .memory, .stack_offset => { + return self.fail(src, "TODO implement x86 ADD/SUB/CMP source memory", .{}); + }, + .compare_flags_unsigned => { + return self.fail(src, "TODO implement x86 ADD/SUB/CMP source compare flag (unsigned)", .{}); + }, + .compare_flags_signed => { + return self.fail(src, "TODO implement x86 ADD/SUB/CMP source compare flag (signed)", .{}); + }, + } + }, + .embedded_in_code, .memory => { return self.fail(src, "TODO implement x86 ADD/SUB/CMP destination memory", .{}); }, } } + fn genX8664ModRMRegToStack(self: *Self, src: usize, ty: Type, off: u32, reg: Register, opcode: u8) !void { + const abi_size = ty.abiSize(self.target.*); + const adj_off = off + abi_size; + try self.code.ensureCapacity(self.code.items.len + 7); + self.rex(.{ .w = reg.size() == 64, .r = reg.isExtended() }); + const reg_id: u8 = @truncate(u3, reg.id()); + if (adj_off <= 128) { + // example: 48 89 55 7f mov QWORD PTR [rbp+0x7f],rdx + const RM = @as(u8, 0b01_000_101) | (reg_id << 3); + const negative_offset = @intCast(i8, -@intCast(i32, adj_off)); + const twos_comp = @bitCast(u8, negative_offset); + self.code.appendSliceAssumeCapacity(&[_]u8{ opcode, RM, twos_comp }); + } else if (adj_off <= 2147483648) { + // example: 48 89 95 80 00 00 00 mov QWORD PTR [rbp+0x80],rdx + const RM = @as(u8, 0b10_000_101) | (reg_id << 3); + const negative_offset = @intCast(i32, -@intCast(i33, adj_off)); + const twos_comp = @bitCast(u32, negative_offset); + self.code.appendSliceAssumeCapacity(&[_]u8{ opcode, RM }); + mem.writeIntLittle(u32, self.code.addManyAsArrayAssumeCapacity(4), twos_comp); + } else { + return self.fail(src, "stack offset too large", .{}); + } + } + fn genArg(self: *Self, inst: *ir.Inst.Arg) !MCValue { if (FreeRegInt == u0) { return self.fail(inst.base.src, "TODO implement Register enum for {}", .{self.target.cpu.arch}); @@ -1109,7 +1238,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { const name_with_null = inst.name[0..mem.lenZ(inst.name) + 1]; switch (result) { .register => |reg| { - branch.registers.putAssumeCapacityNoClobber(reg, .{ .inst = &inst.base }); + branch.registers.putAssumeCapacityNoClobber(toCanonicalReg(reg), .{ .inst = &inst.base }); branch.markRegUsed(reg); try self.dbg_info.ensureCapacity(self.dbg_info.items.len + 8 + name_with_null.len); @@ -1304,13 +1433,13 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { // Either one, but not both, can be a memory operand. // Source operand can be an immediate, 8 bits or 32 bits. const dst_mcv = if (lhs.isImmediate() or (lhs.isMemory() and rhs.isMemory())) - try self.copyToNewRegister(inst.lhs) + try self.copyToNewRegister(&inst.base, lhs) else lhs; // This instruction supports only signed 32-bit immediates at most. const src_mcv = try self.limitImmediateType(inst.rhs, i32); - try self.genX8664BinMathCode(inst.base.src, dst_mcv, src_mcv, 7, 0x38); + try self.genX8664BinMathCode(inst.base.src, inst.base.ty, dst_mcv, src_mcv, 7, 0x38); const info = inst.lhs.ty.intInfo(self.target.*); if (info.signed) { return MCValue{ .compare_flags_signed = op }; @@ -1584,6 +1713,10 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { /// resulting REX is meaningful, but will remain the same if it is not. /// * Deliberately inserting a "meaningless REX" requires explicit usage of /// 0x40, and cannot be done via this function. + /// W => 64 bit mode + /// R => extension to the MODRM.reg field + /// X => extension to the SIB.index field + /// B => extension to the MODRM.rm field or the SIB.base field fn rex(self: *Self, arg: struct { b: bool = false, w: bool = false, x: bool = false, r: bool = false }) void { // From section 2.2.1.2 of the manual, REX is encoded as b0100WRXB. var value: u8 = 0x40; @@ -1681,27 +1814,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { return self.fail(src, "TODO implement set stack variable from embedded_in_code", .{}); }, .register => |reg| { - const abi_size = ty.abiSize(self.target.*); - const adj_off = stack_offset + abi_size; - try self.code.ensureCapacity(self.code.items.len + 7); - self.rex(.{ .w = reg.size() == 64, .b = reg.isExtended() }); - const reg_id: u8 = @truncate(u3, reg.id()); - if (adj_off <= 128) { - // example: 48 89 55 7f mov QWORD PTR [rbp+0x7f],rdx - const RM = @as(u8, 0b01_000_101) | (reg_id << 3); - const negative_offset = @intCast(i8, -@intCast(i32, adj_off)); - const twos_comp = @bitCast(u8, negative_offset); - self.code.appendSliceAssumeCapacity(&[_]u8{ 0x89, RM, twos_comp }); - } else if (adj_off <= 2147483648) { - // example: 48 89 95 80 00 00 00 mov QWORD PTR [rbp+0x80],rdx - const RM = @as(u8, 0b10_000_101) | (reg_id << 3); - const negative_offset = @intCast(i32, -@intCast(i33, adj_off)); - const twos_comp = @bitCast(u32, negative_offset); - self.code.appendSliceAssumeCapacity(&[_]u8{ 0x89, RM }); - mem.writeIntLittle(u32, self.code.addManyAsArrayAssumeCapacity(4), twos_comp); - } else { - return self.fail(src, "stack offset too large", .{}); - } + try self.genX8664ModRMRegToStack(src, ty, stack_offset, reg, 0x89); }, .memory => |vaddr| { return self.fail(src, "TODO implement set stack variable from memory vaddr", .{}); @@ -1709,7 +1822,9 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .stack_offset => |off| { if (stack_offset == off) return; // Copy stack variable to itself; nothing to do. - return self.fail(src, "TODO implement copy stack variable to stack variable", .{}); + + const reg = try self.copyToTmpRegister(src, mcv); + return self.genSetStack(src, ty, stack_offset, MCValue{ .register = reg }); }, }, else => return self.fail(src, "TODO implement getSetStack for {}", .{self.target.cpu.arch}), @@ -2027,7 +2142,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { }, }); if (imm >= math.maxInt(U)) { - return self.copyToNewRegister(inst); + return MCValue{ .register = try self.copyToTmpRegister(inst.src, mcv) }; } }, else => {}, diff --git a/test/stage2/test.zig b/test/stage2/test.zig index 11b1713181..791a073393 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -600,6 +600,58 @@ pub fn addCases(ctx: *TestContext) !void { "", ); + // Spilling registers to the stack. + case.addCompareOutput( + \\export fn _start() noreturn { + \\ assert(add(3, 4) == 791); + \\ + \\ exit(); + \\} + \\ + \\fn add(a: u32, b: u32) u32 { + \\ const x: u32 = blk: { + \\ const c = a + b; // 7 + \\ const d = a + c; // 10 + \\ const e = d + b; // 14 + \\ const f = d + e; // 24 + \\ const g = e + f; // 38 + \\ const h = f + g; // 62 + \\ const i = g + h; // 100 + \\ const j = i + d; // 110 + \\ const k = i + j; // 210 + \\ const l = k + c; // 217 + \\ const m = l + d; // 227 + \\ const n = m + e; // 241 + \\ const o = n + f; // 265 + \\ const p = o + g; // 303 + \\ const q = p + h; // 365 + \\ const r = q + i; // 465 + \\ const s = r + j; // 575 + \\ const t = s + k; // 785 + \\ break :blk t; + \\ }; + \\ const y = x + a; // 788 + \\ const z = y + a; // 791 + \\ return z; + \\} + \\ + \\pub fn assert(ok: bool) void { + \\ if (!ok) unreachable; // assertion failure + \\} + \\ + \\fn exit() noreturn { + \\ asm volatile ("syscall" + \\ : + \\ : [number] "{rax}" (231), + \\ [arg1] "{rdi}" (0) + \\ : "rcx", "r11", "memory" + \\ ); + \\ unreachable; + \\} + , + "", + ); + // Character literals and multiline strings. case.addCompareOutput( \\export fn _start() noreturn { From 9ab428185688896ab5b6d4bc924366d22bfe4ccd Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sat, 22 Aug 2020 01:12:34 +0200 Subject: [PATCH 05/55] std: remove init functions from linked list nodes These functions are rather useless and redundant as initializing the struct directly is just as easy: var node = TailQueue(u32).Node{ .data = 42 }; --- lib/std/linked_list.zig | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/std/linked_list.zig b/lib/std/linked_list.zig index 00e678e0ac..870b823aac 100644 --- a/lib/std/linked_list.zig +++ b/lib/std/linked_list.zig @@ -28,12 +28,6 @@ pub fn SinglyLinkedList(comptime T: type) type { pub const Data = T; - pub fn init(data: T) Node { - return Node{ - .data = data, - }; - } - /// Insert a new node after the current one. /// /// Arguments: @@ -175,12 +169,6 @@ pub fn TailQueue(comptime T: type) type { prev: ?*Node = null, next: ?*Node = null, data: T, - - pub fn init(data: T) Node { - return Node{ - .data = data, - }; - } }; first: ?*Node = null, From e919744c7ad2b224bef00ffc35ccacbe31a0aae7 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 22 Aug 2020 01:11:24 +0200 Subject: [PATCH 06/55] Promote hash/siphash to crypto/siphash SipHash *is* a cryptographic function, with a 128-bit security level. However, it is not a regular hash function: a secret key is required, and knowledge of that key allows collisions to be quickly computed offline. SipHash is therefore more suitable to be used as a MAC. The same API as other MACs was implemented in addition to functions directly returning an integer. The benchmarks have been updated accordingly. No changes to the SipHash implementation itself. --- lib/std/crypto.zig | 2 + lib/std/crypto/benchmark.zig | 4 ++ lib/std/{hash => crypto}/siphash.zig | 83 +++++++++++++++++++--------- lib/std/hash.zig | 3 +- lib/std/hash/benchmark.zig | 12 ---- 5 files changed, 65 insertions(+), 39 deletions(-) rename lib/std/{hash => crypto}/siphash.zig (82%) diff --git a/lib/std/crypto.zig b/lib/std/crypto.zig index 32ab5071c5..5de2f13896 100644 --- a/lib/std/crypto.zig +++ b/lib/std/crypto.zig @@ -18,6 +18,7 @@ pub const hash = struct { /// Authentication (MAC) functions. pub const auth = struct { pub const hmac = @import("crypto/hmac.zig"); + pub const siphash = @import("crypto/siphash.zig"); }; /// Authenticated Encryption with Associated Data @@ -80,6 +81,7 @@ test "crypto" { _ = @import("crypto/sha1.zig"); _ = @import("crypto/sha2.zig"); _ = @import("crypto/sha3.zig"); + _ = @import("crypto/siphash.zig"); _ = @import("crypto/25519/curve25519.zig"); _ = @import("crypto/25519/ed25519.zig"); _ = @import("crypto/25519/edwards25519.zig"); diff --git a/lib/std/crypto/benchmark.zig b/lib/std/crypto/benchmark.zig index 70bd30d6bb..d9c83992c9 100644 --- a/lib/std/crypto/benchmark.zig +++ b/lib/std/crypto/benchmark.zig @@ -60,6 +60,10 @@ const macs = [_]Crypto{ Crypto{ .ty = crypto.auth.hmac.HmacSha1, .name = "hmac-sha1" }, Crypto{ .ty = crypto.auth.hmac.sha2.HmacSha256, .name = "hmac-sha256" }, Crypto{ .ty = crypto.auth.hmac.sha2.HmacSha512, .name = "hmac-sha512" }, + Crypto{ .ty = crypto.auth.siphash.SipHash64(2, 4), .name = "siphash-2-4" }, + Crypto{ .ty = crypto.auth.siphash.SipHash64(1, 3), .name = "siphash-1-3" }, + Crypto{ .ty = crypto.auth.siphash.SipHash128(2, 4), .name = "siphash128-2-4" }, + Crypto{ .ty = crypto.auth.siphash.SipHash128(1, 3), .name = "siphash128-1-3" }, }; pub fn benchmarkMac(comptime Mac: anytype, comptime bytes: comptime_int) !u64 { diff --git a/lib/std/hash/siphash.zig b/lib/std/crypto/siphash.zig similarity index 82% rename from lib/std/hash/siphash.zig rename to lib/std/crypto/siphash.zig index 107ea19728..c4d8735b1c 100644 --- a/lib/std/hash/siphash.zig +++ b/lib/std/crypto/siphash.zig @@ -3,25 +3,39 @@ // This file is part of [zig](https://ziglang.org/), which is MIT licensed. // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. -// Siphash // -// SipHash is a moderately fast, non-cryptographic keyed hash function designed for resistance -// against hash flooding DoS attacks. +// SipHash is a moderately fast pseudorandom function, returning a 64-bit or 128-bit tag for an arbitrary long input. +// +// Typical use cases include: +// - protection against against DoS attacks for hash tables and bloom filters +// - authentication of short-lived messages in online protocols // // https://131002.net/siphash/ - const std = @import("../std.zig"); const assert = std.debug.assert; const testing = std.testing; const math = std.math; const mem = std.mem; -const Endian = std.builtin.Endian; - +/// SipHash function with 64-bit output. +/// +/// Recommended parameters are: +/// - (c_rounds=2, d_rounds=4) standard parameters. +/// - (c_rounds=1, d_rounds=2) reduced-round function. Faster, no known implications on its practical security level. +/// +/// SipHash is not a traditional hash function. If the input includes untrusted content, a secret key is absolutely necessary. +/// And due to its small output size, collisions in SipHash64 can be found with an exhaustive search. pub fn SipHash64(comptime c_rounds: usize, comptime d_rounds: usize) type { return SipHash(u64, c_rounds, d_rounds); } +/// SipHash function with 128-bit output. +/// +/// Recommended parameters are: +/// - (c_rounds=2, d_rounds=4) standard parameters. +/// - (c_rounds=1, d_rounds=2) reduced-round function. Faster, no known implications on its practical security level. +/// +/// SipHash is not a traditional hash function. If the input includes untrusted content, a secret key is absolutely necessary. pub fn SipHash128(comptime c_rounds: usize, comptime d_rounds: usize) type { return SipHash(u128, c_rounds, d_rounds); } @@ -146,30 +160,31 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round d.v2 = math.rotl(u64, d.v2, @as(u64, 32)); } - pub fn hash(key: []const u8, input: []const u8) T { - const aligned_len = input.len - (input.len % 8); - + pub fn hash(msg: []const u8, key: []const u8) T { + const aligned_len = msg.len - (msg.len % 8); var c = Self.init(key); - @call(.{ .modifier = .always_inline }, c.update, .{input[0..aligned_len]}); - return @call(.{ .modifier = .always_inline }, c.final, .{input[aligned_len..]}); + @call(.{ .modifier = .always_inline }, c.update, .{msg[0..aligned_len]}); + return @call(.{ .modifier = .always_inline }, c.final, .{msg[aligned_len..]}); } }; } -pub fn SipHash(comptime T: type, comptime c_rounds: usize, comptime d_rounds: usize) type { +fn SipHash(comptime T: type, comptime c_rounds: usize, comptime d_rounds: usize) type { assert(T == u64 or T == u128); assert(c_rounds > 0 and d_rounds > 0); return struct { const State = SipHashStateless(T, c_rounds, d_rounds); const Self = @This(); - const digest_size = 64; - const block_size = 64; + pub const minimum_key_length = 16; + pub const mac_length = @sizeOf(T); + pub const block_length = 8; state: State, buf: [8]u8, buf_len: usize, + /// Initialize a state for a SipHash function pub fn init(key: []const u8) Self { return Self{ .state = State.init(key), @@ -178,6 +193,7 @@ pub fn SipHash(comptime T: type, comptime c_rounds: usize, comptime d_rounds: us }; } + /// Add data to the state pub fn update(self: *Self, b: []const u8) void { var off: usize = 0; @@ -196,12 +212,27 @@ pub fn SipHash(comptime T: type, comptime c_rounds: usize, comptime d_rounds: us self.buf_len += @intCast(u8, b[off + aligned_len ..].len); } - pub fn final(self: *Self) T { + /// Return an authentication tag for the current state + pub fn final(self: *Self, out: []u8) void { + std.debug.assert(out.len >= mac_length); + mem.writeIntLittle(T, out[0..mac_length], self.state.final(self.buf[0..self.buf_len])); + } + + /// Return an authentication tag for a message and a key + pub fn create(out: []u8, msg: []const u8, key: []const u8) void { + var ctx = Self.init(key); + ctx.update(msg); + ctx.final(out[0..]); + } + + /// Return an authentication tag for the current state, as an integer + pub fn finalInt(self: *Self) T { return self.state.final(self.buf[0..self.buf_len]); } - pub fn hash(key: []const u8, input: []const u8) T { - return State.hash(key, input); + /// Return an authentication tag for a message and a key, as an integer + pub fn toInt(msg: []const u8, key: []const u8) T { + return State.hash(msg, key); } }; } @@ -284,8 +315,9 @@ test "siphash64-2-4 sanity" { for (vectors) |vector, i| { buffer[i] = @intCast(u8, i); - const expected = mem.readIntLittle(u64, &vector); - testing.expectEqual(siphash.hash(test_key, buffer[0..i]), expected); + var out: [siphash.mac_length]u8 = undefined; + siphash.create(&out, buffer[0..i], test_key); + testing.expectEqual(out, vector); } } @@ -363,8 +395,9 @@ test "siphash128-2-4 sanity" { for (vectors) |vector, i| { buffer[i] = @intCast(u8, i); - const expected = mem.readIntLittle(u128, &vector); - testing.expectEqual(siphash.hash(test_key, buffer[0..i]), expected); + var out: [siphash.mac_length]u8 = undefined; + siphash.create(&out, buffer[0..i], test_key[0..]); + testing.expectEqual(out, vector); } } @@ -379,14 +412,14 @@ test "iterative non-divisible update" { var end: usize = 9; while (end < buf.len) : (end += 9) { - const non_iterative_hash = Siphash.hash(key, buf[0..end]); + const non_iterative_hash = Siphash.toInt(buf[0..end], key[0..]); - var wy = Siphash.init(key); + var siphash = Siphash.init(key); var i: usize = 0; while (i < end) : (i += 7) { - wy.update(buf[i..std.math.min(i + 7, end)]); + siphash.update(buf[i..std.math.min(i + 7, end)]); } - const iterative_hash = wy.final(); + const iterative_hash = siphash.finalInt(); std.testing.expectEqual(iterative_hash, non_iterative_hash); } diff --git a/lib/std/hash.zig b/lib/std/hash.zig index 1cc078959c..7bac378316 100644 --- a/lib/std/hash.zig +++ b/lib/std/hash.zig @@ -20,7 +20,7 @@ pub const Fnv1a_32 = fnv.Fnv1a_32; pub const Fnv1a_64 = fnv.Fnv1a_64; pub const Fnv1a_128 = fnv.Fnv1a_128; -const siphash = @import("hash/siphash.zig"); +const siphash = @import("crypto/siphash.zig"); pub const SipHash64 = siphash.SipHash64; pub const SipHash128 = siphash.SipHash128; @@ -42,7 +42,6 @@ test "hash" { _ = @import("hash/auto_hash.zig"); _ = @import("hash/crc.zig"); _ = @import("hash/fnv.zig"); - _ = @import("hash/siphash.zig"); _ = @import("hash/murmur.zig"); _ = @import("hash/cityhash.zig"); _ = @import("hash/wyhash.zig"); diff --git a/lib/std/hash/benchmark.zig b/lib/std/hash/benchmark.zig index c23743160b..f0cafa9971 100644 --- a/lib/std/hash/benchmark.zig +++ b/lib/std/hash/benchmark.zig @@ -25,24 +25,12 @@ const Hash = struct { init_u64: ?u64 = null, }; -const siphash_key = "0123456789abcdef"; - const hashes = [_]Hash{ Hash{ .ty = hash.Wyhash, .name = "wyhash", .init_u64 = 0, }, - Hash{ - .ty = hash.SipHash64(1, 3), - .name = "siphash(1,3)", - .init_u8s = siphash_key, - }, - Hash{ - .ty = hash.SipHash64(2, 4), - .name = "siphash(2,4)", - .init_u8s = siphash_key, - }, Hash{ .ty = hash.Fnv1a_64, .name = "fnv1a", From a049c31f2184895c731636b6f71c5743200d64fc Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Fri, 21 Aug 2020 14:37:50 -0600 Subject: [PATCH 07/55] Remove TypeInfo.Error.value --- lib/std/builtin.zig | 2 -- src/ir.cpp | 5 +---- test/stage1/behavior/type_info.zig | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 919f45e730..3d103d6d06 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -289,8 +289,6 @@ pub const TypeInfo = union(enum) { /// therefore must be kept in sync with the compiler implementation. pub const Error = struct { name: []const u8, - /// This field is ignored when using @Type(). - value: comptime_int, }; /// This data structure is used by the Zig language code generation and diff --git a/src/ir.cpp b/src/ir.cpp index 976c50b8ff..8d65b91021 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -25494,9 +25494,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy error_val->special = ConstValSpecialStatic; error_val->type = type_info_error_type; - ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 2); - inner_fields[1]->special = ConstValSpecialStatic; - inner_fields[1]->type = ira->codegen->builtin_types.entry_num_lit_int; + ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 1); ZigValue *name = nullptr; if (error->cached_error_name_val != nullptr) @@ -25504,7 +25502,6 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy if (name == nullptr) name = create_const_str_lit(ira->codegen, &error->name)->data.x_ptr.data.ref.pointee; init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(&error->name), true); - bigint_init_unsigned(&inner_fields[1]->data.x_bigint, error->value); error_val->data.x_struct.fields = inner_fields; error_val->parent.id = ConstParentIdArray; diff --git a/test/stage1/behavior/type_info.zig b/test/stage1/behavior/type_info.zig index ab26558c04..d0da8815f7 100644 --- a/test/stage1/behavior/type_info.zig +++ b/test/stage1/behavior/type_info.zig @@ -153,7 +153,6 @@ fn testErrorSet() void { expect(error_set_info == .ErrorSet); expect(error_set_info.ErrorSet.?.len == 3); expect(mem.eql(u8, error_set_info.ErrorSet.?[0].name, "First")); - expect(error_set_info.ErrorSet.?[2].value == @errorToInt(TestErrorSet.Third)); const error_union_info = @typeInfo(TestErrorSet!usize); expect(error_union_info == .ErrorUnion); From 69de1a51cd4f43e1d7a1fab3208b835b6841579d Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sat, 22 Aug 2020 09:23:48 +0200 Subject: [PATCH 08/55] Add entry_point_command struct to Mach-O definitions The `entry_point_command` is a replacement for `thread_command`, and is used for main executables to specify the location of `main()` entry point. Signed-off-by: Jakub Konka --- lib/std/macho.zig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/std/macho.zig b/lib/std/macho.zig index 99a8cd776c..7eb22c7179 100644 --- a/lib/std/macho.zig +++ b/lib/std/macho.zig @@ -40,6 +40,24 @@ pub const uuid_command = extern struct { uuid: [16]u8, }; +/// The entry_point_command is a replacement for thread_command. +/// It is used for main executables to specify the location (file offset) +/// of main(). If -stack_size was used at link time, the stacksize +/// field will contain the stack size needed for the main thread. +pub const entry_point_command = struct { + /// LC_MAIN only used in MH_EXECUTE filetypes + cmd: u32, + + /// sizeof(struct entry_point_command) + cmdsize: u32, + + /// file (__TEXT) offset of main() + entryoff: u64, + + /// if not zero, initial stack size + stacksize: u64, +}; + /// The symtab_command contains the offsets and sizes of the link-edit 4.3BSD /// "stab" style symbol table information as described in the header files /// and . From 9605e5363b22874550687f5f96dc6cc8bf462115 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 22 Aug 2020 15:08:34 +0200 Subject: [PATCH 09/55] update update_glibc and process_headers to latest zig --- tools/process_headers.zig | 5 +++-- tools/update_glibc.zig | 40 +++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/tools/process_headers.zig b/tools/process_headers.zig index 918802f65d..72b3fe8942 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -15,6 +15,7 @@ const Arch = std.Target.Cpu.Arch; const Abi = std.Target.Abi; const OsTag = std.Target.Os.Tag; const assert = std.debug.assert; +const Sha256 = std.crypto.hash.sha2.Sha256; const LibCTarget = struct { name: []const u8, @@ -313,7 +314,7 @@ pub fn main() !void { var max_bytes_saved: usize = 0; var total_bytes: usize = 0; - var hasher = std.crypto.hash.sha2.Sha256.init(.{}); + var hasher = Sha256.init(.{}); for (libc_targets) |libc_target| { const dest_target = DestTarget{ @@ -359,7 +360,7 @@ pub fn main() !void { const trimmed = std.mem.trim(u8, raw_bytes, " \r\n\t"); total_bytes += raw_bytes.len; const hash = try allocator.alloc(u8, 32); - hasher.reset(); + hasher = Sha256.init(.{}); hasher.update(rel_path); hasher.update(trimmed); hasher.final(hash); diff --git a/tools/update_glibc.zig b/tools/update_glibc.zig index b6805962dc..a8aeef0799 100644 --- a/tools/update_glibc.zig +++ b/tools/update_glibc.zig @@ -148,12 +148,12 @@ pub fn main() !void { for (abi_lists) |*abi_list| { const target_funcs_gop = try target_functions.getOrPut(@ptrToInt(abi_list)); if (!target_funcs_gop.found_existing) { - target_funcs_gop.kv.value = FunctionSet{ + target_funcs_gop.entry.value = FunctionSet{ .list = std.ArrayList(VersionedFn).init(allocator), .fn_vers_list = FnVersionList.init(allocator), }; } - const fn_set = &target_funcs_gop.kv.value.list; + const fn_set = &target_funcs_gop.entry.value.list; for (lib_names) |lib_name, lib_name_index| { const lib_prefix = if (std.mem.eql(u8, lib_name, "ld")) "" else "lib"; @@ -203,11 +203,11 @@ pub fn main() !void { _ = try global_ver_set.put(ver, undefined); const gop = try global_fn_set.getOrPut(name); if (gop.found_existing) { - if (!std.mem.eql(u8, gop.kv.value.lib, "c")) { - gop.kv.value.lib = lib_name; + if (!std.mem.eql(u8, gop.entry.value.lib, "c")) { + gop.entry.value.lib = lib_name; } } else { - gop.kv.value = Function{ + gop.entry.value = Function{ .name = name, .lib = lib_name, .index = undefined, @@ -224,14 +224,14 @@ pub fn main() !void { const global_fn_list = blk: { var list = std.ArrayList([]const u8).init(allocator); var it = global_fn_set.iterator(); - while (it.next()) |kv| try list.append(kv.key); + while (it.next()) |entry| try list.append(entry.key); std.sort.sort([]const u8, list.span(), {}, strCmpLessThan); break :blk list.span(); }; const global_ver_list = blk: { var list = std.ArrayList([]const u8).init(allocator); var it = global_ver_set.iterator(); - while (it.next()) |kv| try list.append(kv.key); + while (it.next()) |entry| try list.append(entry.key); std.sort.sort([]const u8, list.span(), {}, versionLessThan); break :blk list.span(); }; @@ -254,9 +254,9 @@ pub fn main() !void { var buffered = std.io.bufferedOutStream(fns_txt_file.outStream()); const fns_txt = buffered.outStream(); for (global_fn_list) |name, i| { - const kv = global_fn_set.get(name).?; - kv.value.index = i; - try fns_txt.print("{} {}\n", .{ name, kv.value.lib }); + const entry = global_fn_set.getEntry(name).?; + entry.value.index = i; + try fns_txt.print("{} {}\n", .{ name, entry.value.lib }); } try buffered.flush(); } @@ -264,16 +264,16 @@ pub fn main() !void { // Now the mapping of version and function to integer index is complete. // Here we create a mapping of function name to list of versions. for (abi_lists) |*abi_list, abi_index| { - const kv = target_functions.get(@ptrToInt(abi_list)).?; - const fn_vers_list = &kv.value.fn_vers_list; - for (kv.value.list.span()) |*ver_fn| { + const entry = target_functions.getEntry(@ptrToInt(abi_list)).?; + const fn_vers_list = &entry.value.fn_vers_list; + for (entry.value.list.span()) |*ver_fn| { const gop = try fn_vers_list.getOrPut(ver_fn.name); if (!gop.found_existing) { - gop.kv.value = std.ArrayList(usize).init(allocator); + gop.entry.value = std.ArrayList(usize).init(allocator); } - const ver_index = global_ver_set.get(ver_fn.ver).?.value; - if (std.mem.indexOfScalar(usize, gop.kv.value.span(), ver_index) == null) { - try gop.kv.value.append(ver_index); + const ver_index = global_ver_set.getEntry(ver_fn.ver).?.value; + if (std.mem.indexOfScalar(usize, gop.entry.value.span(), ver_index) == null) { + try gop.entry.value.append(ver_index); } } } @@ -287,7 +287,7 @@ pub fn main() !void { // first iterate over the abi lists for (abi_lists) |*abi_list, abi_index| { - const fn_vers_list = &target_functions.get(@ptrToInt(abi_list)).?.value.fn_vers_list; + const fn_vers_list = &target_functions.getEntry(@ptrToInt(abi_list)).?.value.fn_vers_list; for (abi_list.targets) |target, it_i| { if (it_i != 0) try abilist_txt.writeByte(' '); try abilist_txt.print("{}-linux-{}", .{ @tagName(target.arch), @tagName(target.abi) }); @@ -295,11 +295,11 @@ pub fn main() !void { try abilist_txt.writeByte('\n'); // next, each line implicitly corresponds to a function for (global_fn_list) |name| { - const kv = fn_vers_list.get(name) orelse { + const entry = fn_vers_list.getEntry(name) orelse { try abilist_txt.writeByte('\n'); continue; }; - for (kv.value.span()) |ver_index, it_i| { + for (entry.value.span()) |ver_index, it_i| { if (it_i != 0) try abilist_txt.writeByte(' '); try abilist_txt.print("{d}", .{ver_index}); } From 0fa3cfdb4aa04bf92c5d9344cd4d265ccb40e0dc Mon Sep 17 00:00:00 2001 From: Matthew Knight Date: Sat, 22 Aug 2020 12:08:01 -0700 Subject: [PATCH 10/55] Bpf: move under os/linux instead of bits (#6126) * moved bpf syscall, added some bpf instructions and tests * had to move bpf out of bits so that a freestanding target could import it * removed line * fixed imports --- lib/std/os/bits/linux.zig | 1 - lib/std/os/linux.zig | 1 + lib/std/os/{bits => }/linux/bpf.zig | 4 +--- 3 files changed, 2 insertions(+), 4 deletions(-) rename lib/std/os/{bits => }/linux/bpf.zig (99%) diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 133b903110..1327eaa330 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -24,7 +24,6 @@ pub usingnamespace switch (builtin.arch) { }; pub usingnamespace @import("linux/netlink.zig"); -pub const BPF = @import("linux/bpf.zig"); const is_mips = builtin.arch.isMIPS(); diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index c5edacfab1..13094b3a3a 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -29,6 +29,7 @@ pub usingnamespace switch (builtin.arch) { }; pub usingnamespace @import("bits.zig"); pub const tls = @import("linux/tls.zig"); +pub const BPF = @import("linux/bpf.zig"); /// Set by startup code, used by `getauxval`. pub var elf_aux_maybe: ?[*]std.elf.Auxv = null; diff --git a/lib/std/os/bits/linux/bpf.zig b/lib/std/os/linux/bpf.zig similarity index 99% rename from lib/std/os/bits/linux/bpf.zig rename to lib/std/os/linux/bpf.zig index 5517e2ae80..928c157c42 100644 --- a/lib/std/os/bits/linux/bpf.zig +++ b/lib/std/os/linux/bpf.zig @@ -4,10 +4,8 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace std.os; -const std = @import("../../../std.zig"); +const std = @import("../../std.zig"); const expectEqual = std.testing.expectEqual; -const fd_t = std.os.fd_t; -const pid_t = std.os.pid_t; // instruction classes pub const LD = 0x00; From f540dc1b7ebc1663ef5d3823da4630ff51c697b6 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 21 Aug 2020 15:08:15 +0200 Subject: [PATCH 11/55] cache_hash: hash function change This makes the `cache_hash` hash function easier to replace. BLAKE3 would be a natural fit for hashing large files, but: - second preimage resistance is not necessary for the cache_hash use cases - our BLAKE3 implementation is currently very slow Switch to SipHash128, which gives us an immediate speed boost. --- lib/std/cache_hash.zig | 70 +++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/lib/std/cache_hash.zig b/lib/std/cache_hash.zig index edd0ebf126..5cd8194e21 100644 --- a/lib/std/cache_hash.zig +++ b/lib/std/cache_hash.zig @@ -4,7 +4,8 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. const std = @import("std.zig"); -const Blake3 = std.crypto.hash.Blake3; +const crypto = std.crypto; +const Hasher = crypto.auth.siphash.SipHash128(1, 3); // provides enough collision resistance for the CacheHash use cases, while being one of our fastest options right now const fs = std.fs; const base64 = std.base64; const ArrayList = std.ArrayList; @@ -16,9 +17,8 @@ const Allocator = std.mem.Allocator; const base64_encoder = fs.base64_encoder; const base64_decoder = fs.base64_decoder; -/// This is 70 more bits than UUIDs. For an analysis of probability of collisions, see: -/// https://en.wikipedia.org/wiki/Universally_unique_identifier#Collisions -const BIN_DIGEST_LEN = 24; +/// This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6 +const BIN_DIGEST_LEN = 16; const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN); const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024; @@ -43,9 +43,13 @@ pub const File = struct { } }; +/// CacheHash manages project-local `zig-cache` directories. +/// This is not a general-purpose cache. +/// It was designed to be fast and simple, not to withstand attacks using specially-crafted input. pub const CacheHash = struct { allocator: *Allocator, - blake3: Blake3, + hasher_init: Hasher, // initial state, that can be copied + hasher: Hasher, // current state for incremental hashing manifest_dir: fs.Dir, manifest_file: ?fs.File, manifest_dirty: bool, @@ -54,9 +58,11 @@ pub const CacheHash = struct { /// Be sure to call release after successful initialization. pub fn init(allocator: *Allocator, dir: fs.Dir, manifest_dir_path: []const u8) !CacheHash { + const hasher_init = Hasher.init(&[_]u8{0} ** Hasher.minimum_key_length); return CacheHash{ .allocator = allocator, - .blake3 = Blake3.init(.{}), + .hasher_init = hasher_init, + .hasher = hasher_init, .manifest_dir = try dir.makeOpenPath(manifest_dir_path, .{}), .manifest_file = null, .manifest_dirty = false, @@ -69,8 +75,8 @@ pub const CacheHash = struct { pub fn addSlice(self: *CacheHash, val: []const u8) void { assert(self.manifest_file == null); - self.blake3.update(val); - self.blake3.update(&[_]u8{0}); + self.hasher.update(val); + self.hasher.update(&[_]u8{0}); } /// Convert the input value into bytes and record it as a dependency of the @@ -133,12 +139,12 @@ pub const CacheHash = struct { assert(self.manifest_file == null); var bin_digest: [BIN_DIGEST_LEN]u8 = undefined; - self.blake3.final(&bin_digest); + self.hasher.final(&bin_digest); base64_encoder.encode(self.b64_digest[0..], &bin_digest); - self.blake3 = Blake3.init(.{}); - self.blake3.update(&bin_digest); + self.hasher = self.hasher_init; + self.hasher.update(&bin_digest); const manifest_file_path = try fmt.allocPrint(self.allocator, "{}.txt", .{self.b64_digest}); defer self.allocator.free(manifest_file_path); @@ -238,7 +244,7 @@ pub const CacheHash = struct { } var actual_digest: [BIN_DIGEST_LEN]u8 = undefined; - try hashFile(this_file, &actual_digest); + try hashFile(this_file, &actual_digest, self.hasher_init); if (!mem.eql(u8, &cache_hash_file.bin_digest, &actual_digest)) { cache_hash_file.bin_digest = actual_digest; @@ -248,7 +254,7 @@ pub const CacheHash = struct { } if (!any_file_changed) { - self.blake3.update(&cache_hash_file.bin_digest); + self.hasher.update(&cache_hash_file.bin_digest); } } @@ -256,8 +262,8 @@ pub const CacheHash = struct { // cache miss // keep the manifest file open // reset the hash - self.blake3 = Blake3.init(.{}); - self.blake3.update(&bin_digest); + self.hasher = self.hasher_init; + self.hasher.update(&bin_digest); // Remove files not in the initial hash for (self.files.items[input_file_count..]) |*file| { @@ -266,7 +272,7 @@ pub const CacheHash = struct { self.files.shrink(input_file_count); for (self.files.items) |file| { - self.blake3.update(&file.bin_digest); + self.hasher.update(&file.bin_digest); } return null; } @@ -304,23 +310,23 @@ pub const CacheHash = struct { // Hash while reading from disk, to keep the contents in the cpu cache while // doing hashing. - var blake3 = Blake3.init(.{}); + var hasher = self.hasher_init; var off: usize = 0; while (true) { // give me everything you've got, captain const bytes_read = try file.read(contents[off..]); if (bytes_read == 0) break; - blake3.update(contents[off..][0..bytes_read]); + hasher.update(contents[off..][0..bytes_read]); off += bytes_read; } - blake3.final(&ch_file.bin_digest); + hasher.final(&ch_file.bin_digest); ch_file.contents = contents; } else { - try hashFile(file, &ch_file.bin_digest); + try hashFile(file, &ch_file.bin_digest, self.hasher_init); } - self.blake3.update(&ch_file.bin_digest); + self.hasher.update(&ch_file.bin_digest); } /// Add a file as a dependency of process being cached, after the initial hash has been @@ -382,7 +388,7 @@ pub const CacheHash = struct { // the artifacts to cache. var bin_digest: [BIN_DIGEST_LEN]u8 = undefined; - self.blake3.final(&bin_digest); + self.hasher.final(&bin_digest); var out_digest: [BASE64_DIGEST_LEN]u8 = undefined; base64_encoder.encode(&out_digest, &bin_digest); @@ -433,17 +439,17 @@ pub const CacheHash = struct { } }; -fn hashFile(file: fs.File, bin_digest: []u8) !void { - var blake3 = Blake3.init(.{}); +fn hashFile(file: fs.File, bin_digest: []u8, hasher_init: anytype) !void { var buf: [1024]u8 = undefined; + var hasher = hasher_init; while (true) { const bytes_read = try file.read(&buf); if (bytes_read == 0) break; - blake3.update(buf[0..bytes_read]); + hasher.update(buf[0..bytes_read]); } - blake3.final(bin_digest); + hasher.final(bin_digest); } /// If the wall clock time, rounded to the same precision as the @@ -507,7 +513,7 @@ test "cache file and then recall it" { _ = try ch.addFile(temp_file, null); // There should be nothing in the cache - testing.expectEqual(@as(?[32]u8, null), try ch.hit()); + testing.expectEqual(@as(?[BASE64_DIGEST_LEN]u8, null), try ch.hit()); digest1 = ch.final(); } @@ -575,7 +581,7 @@ test "check that changing a file makes cache fail" { const temp_file_idx = try ch.addFile(temp_file, 100); // There should be nothing in the cache - testing.expectEqual(@as(?[32]u8, null), try ch.hit()); + testing.expectEqual(@as(?[BASE64_DIGEST_LEN]u8, null), try ch.hit()); testing.expect(mem.eql(u8, original_temp_file_contents, ch.files.items[temp_file_idx].contents.?)); @@ -592,7 +598,7 @@ test "check that changing a file makes cache fail" { const temp_file_idx = try ch.addFile(temp_file, 100); // A file that we depend on has been updated, so the cache should not contain an entry for it - testing.expectEqual(@as(?[32]u8, null), try ch.hit()); + testing.expectEqual(@as(?[BASE64_DIGEST_LEN]u8, null), try ch.hit()); // The cache system does not keep the contents of re-hashed input files. testing.expect(ch.files.items[temp_file_idx].contents == null); @@ -625,7 +631,7 @@ test "no file inputs" { ch.add("1234"); // There should be nothing in the cache - testing.expectEqual(@as(?[32]u8, null), try ch.hit()); + testing.expectEqual(@as(?[BASE64_DIGEST_LEN]u8, null), try ch.hit()); digest1 = ch.final(); } @@ -672,7 +678,7 @@ test "CacheHashes with files added after initial hash work" { _ = try ch.addFile(temp_file1, null); // There should be nothing in the cache - testing.expectEqual(@as(?[32]u8, null), try ch.hit()); + testing.expectEqual(@as(?[BASE64_DIGEST_LEN]u8, null), try ch.hit()); _ = try ch.addFilePost(temp_file2); @@ -705,7 +711,7 @@ test "CacheHashes with files added after initial hash work" { _ = try ch.addFile(temp_file1, null); // A file that we depend on has been updated, so the cache should not contain an entry for it - testing.expectEqual(@as(?[32]u8, null), try ch.hit()); + testing.expectEqual(@as(?[BASE64_DIGEST_LEN]u8, null), try ch.hit()); _ = try ch.addFilePost(temp_file2); From 2d402157d9e6ea34499604455cf1270ef7eb5a1f Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 22 Aug 2020 14:24:35 +0200 Subject: [PATCH 12/55] Improve documentation on siphash recommended parameters --- lib/std/crypto/siphash.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/std/crypto/siphash.zig b/lib/std/crypto/siphash.zig index c4d8735b1c..26c892fdd7 100644 --- a/lib/std/crypto/siphash.zig +++ b/lib/std/crypto/siphash.zig @@ -20,8 +20,10 @@ const mem = std.mem; /// SipHash function with 64-bit output. /// /// Recommended parameters are: +/// - (c_rounds=4, d_rounds=8) for conservative security; regular hash functions such as BLAKE2 or BLAKE3 are usually a better alternative. /// - (c_rounds=2, d_rounds=4) standard parameters. -/// - (c_rounds=1, d_rounds=2) reduced-round function. Faster, no known implications on its practical security level. +/// - (c_rounds=1, d_rounds=3) reduced-round function. Faster, no known implications on its practical security level. +/// - (c_rounds=1, d_rounds=2) fastest option, but the output may be distinguishable from random data with related keys or non-uniform input - not suitable as a PRF. /// /// SipHash is not a traditional hash function. If the input includes untrusted content, a secret key is absolutely necessary. /// And due to its small output size, collisions in SipHash64 can be found with an exhaustive search. @@ -32,8 +34,11 @@ pub fn SipHash64(comptime c_rounds: usize, comptime d_rounds: usize) type { /// SipHash function with 128-bit output. /// /// Recommended parameters are: +/// - (c_rounds=4, d_rounds=8) for conservative security; regular hash functions such as BLAKE2 or BLAKE3 are usually a better alternative. /// - (c_rounds=2, d_rounds=4) standard parameters. -/// - (c_rounds=1, d_rounds=2) reduced-round function. Faster, no known implications on its practical security level. +/// - (c_rounds=1, d_rounds=4) reduced-round function. Recommended to hash very short, similar strings, when a 128-bit PRF output is still required. +/// - (c_rounds=1, d_rounds=3) reduced-round function. Faster, no known implications on its practical security level. +/// - (c_rounds=1, d_rounds=2) fastest option, but the output may be distinguishable from random data with related keys or non-uniform input - not suitable as a PRF. /// /// SipHash is not a traditional hash function. If the input includes untrusted content, a secret key is absolutely necessary. pub fn SipHash128(comptime c_rounds: usize, comptime d_rounds: usize) type { From 29051a0674800881957479c423a1feb043391671 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 22 Aug 2020 12:41:51 -0700 Subject: [PATCH 13/55] stage2: codegen: fix crash I forgot to do -Denable-qemu -Denable-wasmtime when testing yesterday, sorry about that. In reuseOperand, the code assumed a re-used register would be tracked in the register table but that is not always the case. --- src-self-hosted/codegen.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index ca6d9d800b..4ce2e041c0 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -934,8 +934,9 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { // If it's in the registers table, need to associate the register with the // new instruction. const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; - const entry = branch.registers.getEntry(toCanonicalReg(reg)).?; - entry.value = .{ .inst = inst }; + if (branch.registers.getEntry(toCanonicalReg(reg))) |entry| { + entry.value = .{ .inst = inst }; + } log.debug("reusing {} => {*}", .{reg, inst}); }, .stack_offset => |off| { From 803a1025bbfb8757589068ae29f6f2fc57a4f566 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 17:52:03 -0400 Subject: [PATCH 14/55] Targets: add SPU Mark II architecture --- lib/std/elf.zig | 3 +++ lib/std/target.zig | 8 +++++++- src-self-hosted/link/Elf.zig | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/std/elf.zig b/lib/std/elf.zig index 79303e7163..cd2b5fcd06 100644 --- a/lib/std/elf.zig +++ b/lib/std/elf.zig @@ -976,6 +976,9 @@ pub const EM = extern enum(u16) { /// MIPS RS3000 Little-endian _MIPS_RS3_LE = 10, + /// SPU Mark II + _SPU_2 = 13, + /// Hewlett-Packard PA-RISC _PARISC = 15, diff --git a/lib/std/target.zig b/lib/std/target.zig index b162bdd0c3..fcd90357fb 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -663,6 +663,8 @@ pub const Target = struct { renderscript32, renderscript64, ve, + // Non-LLVM targets go here + spu_2, pub fn isARM(arch: Arch) bool { return switch (arch) { @@ -761,6 +763,7 @@ pub const Target = struct { .sparcv9 => ._SPARCV9, .s390x => ._S390, .ve => ._NONE, + .spu_2 => ._SPU_2, }; } @@ -803,6 +806,7 @@ pub const Target = struct { .renderscript64, .shave, .ve, + .spu_2, => .Little, .arc, @@ -827,6 +831,7 @@ pub const Target = struct { switch (arch) { .avr, .msp430, + .spu_2, => return 16, .arc, @@ -1317,12 +1322,13 @@ pub const Target = struct { .bpfeb, .nvptx, .nvptx64, + .spu_2, + .avr, => return result, // TODO go over each item in this list and either move it to the above list, or // implement the standard dynamic linker path code for it. .arc, - .avr, .hexagon, .msp430, .r600, diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index 3751411297..861c313eaa 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -249,7 +249,7 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf { .allocator = allocator, }, .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) { - 32 => .p32, + 16, 32 => .p32, 64 => .p64, else => return error.UnsupportedELFArchitecture, }, @@ -278,7 +278,7 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf .file = file, }, .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) { - 32 => .p32, + 16, 32 => .p32, 64 => .p64, else => return error.UnsupportedELFArchitecture, }, From d005ff16c6fe1a0ddb3997552d6cccf314e6d94f Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 10 Jul 2020 20:29:55 -0400 Subject: [PATCH 15/55] SPU-II: undefined0 inline asm --- src-self-hosted/codegen.zig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 4ce2e041c0..a737b1360d 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1642,6 +1642,29 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { if (!inst.is_volatile and inst.base.isUnused()) return MCValue.dead; switch (arch) { + .spu_2 => { + if (inst.inputs.len > 0 or inst.output != null) { + return self.fail(inst.base.src, "TODO implement inline asm inputs / outputs for SPU Mark II", .{}); + } + if (mem.eql(u8, inst.asm_source, "undefined0")) { + // Instructions are 16-bits, plus up to two sixteen bit immediates. + // Upper three bits of first byte are the execution + // condition; for now, only always (0b000) is supported. + // Next, there are two two-bit sequences indicating inputs; + // we only care to use zero (0b00). + // The lowest bit of byte one indicates whether flags + // should be updated; TODO: support that somehow. + // In all, we use a zero byte for the first half of the + // instruction. + // The second byte is 0bOOCCCCCR; OO is output behavior (we + // use zero, which discards the output), CCCCC is the + // command (8 for undefined0), R is reserved. + try self.code.appendSlice(&[_]u8{ 0x00, 0b00010000 }); + return MCValue.none; + } else { + return self.fail(inst.base.src, "TODO implement support for more SPU II assembly instructions", .{}); + } + }, .riscv64 => { for (inst.inputs) |input, i| { if (input.len < 3 or input[0] != '{' or input[input.len - 1] != '}') { From cdefc6acbaf7f582c6689d1e003405819f797181 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Tue, 21 Jul 2020 21:33:53 -0400 Subject: [PATCH 16/55] SPU-II: Implement function calls --- src-self-hosted/codegen.zig | 59 +++++++--- src-self-hosted/codegen/spu-mk2.zig | 167 ++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+), 14 deletions(-) create mode 100644 src-self-hosted/codegen/spu-mk2.zig diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index a737b1360d..8ff0d32461 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -102,6 +102,7 @@ pub fn generateSymbol( //.sparcv9 => return Function(.sparcv9).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.sparcel => return Function(.sparcel).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.s390x => return Function(.s390x).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), + .spu_2 => return Function(.spu_2).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.tce => return Function(.tce).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.tcele => return Function(.tcele).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.thumb => return Function(.thumb).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), @@ -1349,6 +1350,44 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { return self.fail(inst.base.src, "TODO implement calling runtime known function pointer", .{}); } }, + .spu_2 => { + if (inst.func.cast(ir.Inst.Constant)) |func_inst| { + if (info.args.len != 0) { + return self.fail(inst.base.src, "TODO implement call with more than 0 parameters", .{}); + } + if (func_inst.val.cast(Value.Payload.Function)) |func_val| { + const func = func_val.func; + const got = &elf_file.program_headers.items[elf_file.phdr_got_index.?]; + const got_addr = @intCast(u16, got.p_vaddr + func.owner_decl.link.elf.offset_table_index * 2); + const return_type = func.owner_decl.typed_value.most_recent.typed_value.ty.fnReturnType(); + // First, push the return address, then jump; if noreturn, don't bother with the first step + // TODO: implement packed struct -> u16 at comptime and move the bitcast here + var instr = Instruction{ .condition = .always, .input0 = .immediate, .input1 = .zero, .modify_flags = false, .output = .jump, .command = .load16 }; + if (return_type.zigTypeTag() == .NoReturn) { + try self.code.resize(self.code.items.len + 4); + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 4 ..][0..2], @bitCast(u16, instr)); + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 2 ..][0..2], got_addr); + return MCValue.unreach; + } else { + try self.code.resize(self.code.items.len + 8); + var push = Instruction{ .condition = .always, .input0 = .immediate, .input1 = .zero, .modify_flags = false, .output = .push, .command = .ipget }; + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 8 ..][0..2], @bitCast(u16, push)); + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 6 ..][0..2], @as(u16, 4)); + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 4 ..][0..2], @bitCast(u16, instr)); + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 2 ..][0..2], got_addr); + switch (return_type.zigTypeTag()) { + .Void => return MCValue{ .none = {} }, + .NoReturn => unreachable, + else => return self.fail(inst.base.src, "TODO implement fn call with non-void return value", .{}), + } + } + } else { + return self.fail(inst.base.src, "TODO implement calling bitcasted functions", .{}); + } + } else { + return self.fail(inst.base.src, "TODO implement calling runtime known function pointer", .{}); + } + }, else => return self.fail(inst.base.src, "TODO implement call for {}", .{self.target.cpu.arch}), } } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { @@ -1647,19 +1686,9 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { return self.fail(inst.base.src, "TODO implement inline asm inputs / outputs for SPU Mark II", .{}); } if (mem.eql(u8, inst.asm_source, "undefined0")) { - // Instructions are 16-bits, plus up to two sixteen bit immediates. - // Upper three bits of first byte are the execution - // condition; for now, only always (0b000) is supported. - // Next, there are two two-bit sequences indicating inputs; - // we only care to use zero (0b00). - // The lowest bit of byte one indicates whether flags - // should be updated; TODO: support that somehow. - // In all, we use a zero byte for the first half of the - // instruction. - // The second byte is 0bOOCCCCCR; OO is output behavior (we - // use zero, which discards the output), CCCCC is the - // command (8 for undefined0), R is reserved. - try self.code.appendSlice(&[_]u8{ 0x00, 0b00010000 }); + try self.code.resize(self.code.items.len + 2); + var instr = Instruction{ .condition = .always, .input0 = .zero, .input1 = .zero, .modify_flags = false, .output = .discard, .command = .undefined0 }; + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 2 ..][0..2], @bitCast(u16, instr)); return MCValue.none; } else { return self.fail(inst.base.src, "TODO implement support for more SPU II assembly instructions", .{}); @@ -1742,6 +1771,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { /// X => extension to the SIB.index field /// B => extension to the MODRM.rm field or the SIB.base field fn rex(self: *Self, arg: struct { b: bool = false, w: bool = false, x: bool = false, r: bool = false }) void { + std.debug.assert(arch == .x86_64); // From section 2.2.1.2 of the manual, REX is encoded as b0100WRXB. var value: u8 = 0x40; if (arg.b) { @@ -2289,7 +2319,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { result.stack_byte_count = next_stack_offset; result.stack_align = 16; }, - else => return self.fail(src, "TODO implement function parameters for {}", .{cc}), + else => return self.fail(src, "TODO implement function parameters for {} on x86_64", .{cc}), } }, else => if (param_types.len != 0) @@ -2336,6 +2366,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .i386 => @import("codegen/x86.zig"), .x86_64 => @import("codegen/x86_64.zig"), .riscv64 => @import("codegen/riscv64.zig"), + .spu_2 => @import("codegen/spu-mk2.zig"), else => struct { pub const Register = enum { dummy, diff --git a/src-self-hosted/codegen/spu-mk2.zig b/src-self-hosted/codegen/spu-mk2.zig new file mode 100644 index 0000000000..b44d4123bd --- /dev/null +++ b/src-self-hosted/codegen/spu-mk2.zig @@ -0,0 +1,167 @@ +const std = @import("std"); + +pub const ExecutionCondition = enum(u3) { + always = 0, + when_zero = 1, + not_zero = 2, + greater_zero = 3, + less_than_zero = 4, + greater_or_equal_zero = 5, + less_or_equal_zero = 6, + overflow = 7, +}; + +pub const InputBehaviour = enum(u2) { + zero = 0, + immediate = 1, + peek = 2, + pop = 3, +}; + +pub const OutputBehaviour = enum(u2) { + discard = 0, + push = 1, + jump = 2, + jump_relative = 3, +}; + +pub const Command = enum(u5) { + copy = 0, + ipget = 1, + get = 2, + set = 3, + store8 = 4, + store16 = 5, + load8 = 6, + load16 = 7, + undefined0 = 8, + undefined1 = 9, + frget = 10, + frset = 11, + bpget = 12, + bpset = 13, + spget = 14, + spset = 15, + add = 16, + sub = 17, + mul = 18, + div = 19, + mod = 20, + @"and" = 21, + @"or" = 22, + xor = 23, + not = 24, + signext = 25, + rol = 26, + ror = 27, + bswap = 28, + asr = 29, + lsl = 30, + lsr = 31, +}; + +pub const Instruction = packed struct { + condition: ExecutionCondition, + input0: InputBehaviour, + input1: InputBehaviour, + modify_flags: bool, + output: OutputBehaviour, + command: Command, + reserved: u1 = 0, + + pub fn format(instr: Instruction, comptime fmt: []const u8, options: std.fmt.FormatOptions, out: anytype) !void { + try std.fmt.format(out, "0x{x:0<4} ", .{@bitCast(u16, instr)}); + try out.writeAll(switch (instr.condition) { + .always => " ", + .when_zero => "== 0", + .not_zero => "!= 0", + .greater_zero => " > 0", + .less_than_zero => " < 0", + .greater_or_equal_zero => ">= 0", + .less_or_equal_zero => "<= 0", + .overflow => "ovfl", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.input0) { + .zero => "zero", + .immediate => "imm ", + .peek => "peek", + .pop => "pop ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.input1) { + .zero => "zero", + .immediate => "imm ", + .peek => "peek", + .pop => "pop ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.command) { + .copy => "copy ", + .ipget => "ipget ", + .get => "get ", + .set => "set ", + .store8 => "store8 ", + .store16 => "store16 ", + .load8 => "load8 ", + .load16 => "load16 ", + .undefined0 => "undefined", + .undefined1 => "undefined", + .frget => "frget ", + .frset => "frset ", + .bpget => "bpget ", + .bpset => "bpset ", + .spget => "spget ", + .spset => "spset ", + .add => "add ", + .sub => "sub ", + .mul => "mul ", + .div => "div ", + .mod => "mod ", + .@"and" => "and ", + .@"or" => "or ", + .xor => "xor ", + .not => "not ", + .signext => "signext ", + .rol => "rol ", + .ror => "ror ", + .bswap => "bswap ", + .asr => "asr ", + .lsl => "lsl ", + .lsr => "lsr ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.output) { + .discard => "discard", + .push => "push ", + .jump => "jmp ", + .jump_relative => "rjmp ", + }); + try out.writeAll(" "); + try out.writeAll(if (instr.modify_flags) + "+ flags" + else + " "); + } +}; + +pub const FlagRegister = packed struct { + zero: bool, + negative: bool, + carry: bool, + carry_enabled: bool, + interrupt0_enabled: bool, + interrupt1_enabled: bool, + interrupt2_enabled: bool, + interrupt3_enabled: bool, + reserved: u8 = 0, +}; + +pub const Register = enum { + dummy, + + pub fn allocIndex(self: Register) ?u4 { + return null; + } +}; +pub const callee_preserved_regs = [_]Register{}; From 8c321f0cf5f38e9286476170f51608dbc7b92c50 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Wed, 19 Aug 2020 11:42:19 -0400 Subject: [PATCH 17/55] SPU-II: Fix linking --- src-self-hosted/link.zig | 4 ++++ src-self-hosted/link/Elf.zig | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src-self-hosted/link.zig b/src-self-hosted/link.zig index 1e650d5e2c..e8604038c2 100644 --- a/src-self-hosted/link.zig +++ b/src-self-hosted/link.zig @@ -5,6 +5,9 @@ const fs = std.fs; const trace = @import("tracy.zig").trace; const Package = @import("Package.zig"); const Type = @import("type.zig").Type; +const build_options = @import("build_options"); + +const producer_string = if (std.builtin.is_test) "zig test" else "zig " ++ build_options.version; pub const Options = struct { target: std.Target, @@ -20,6 +23,7 @@ pub const Options = struct { /// Used for calculating how much space to reserve for executable program code in case /// the binary file deos not already have such a section. program_code_size_hint: u64 = 256 * 1024, + default_entry_addr: u64 = 0x8000000, }; pub const File = struct { diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index 861c313eaa..f197ebb6d2 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -286,6 +286,10 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf }; errdefer self.deinit(); + if (options.target.cpu.arch == .spu_2) { + self.base.options.default_entry_addr = 0; + } + // Index 0 is always a null symbol. try self.local_symbols.append(allocator, .{ .st_name = 0, @@ -466,8 +470,8 @@ pub fn populateMissingMetadata(self: *Elf) !void { .p_type = elf.PT_LOAD, .p_offset = off, .p_filesz = file_size, - .p_vaddr = default_entry_addr, - .p_paddr = default_entry_addr, + .p_vaddr = self.base.options.default_entry_addr, + .p_paddr = self.base.options.default_entry_addr, .p_memsz = file_size, .p_align = p_align, .p_flags = elf.PF_X | elf.PF_R, @@ -486,7 +490,7 @@ pub fn populateMissingMetadata(self: *Elf) !void { // TODO instead of hard coding the vaddr, make a function to find a vaddr to put things at. // we'll need to re-use that function anyway, in case the GOT grows and overlaps something // else in virtual memory. - const default_got_addr = if (ptr_size == 2) @as(u32, 0x8000) else 0x4000000; + const default_got_addr = if (self.base.options.target.cpu.arch.ptrBitWidth() == 16) @as(u32, 0x8000) else 0x4000000; try self.program_headers.append(self.base.allocator, .{ .p_type = elf.PT_LOAD, .p_offset = off, From f18636fa58905ec85d246cb14c18418f2ce74317 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Wed, 19 Aug 2020 12:48:10 -0400 Subject: [PATCH 18/55] SPU-II: Add common definitions --- lib/std/spu.zig | 3 + lib/std/spu/defines.zig | 158 +++++++++++++++++++++++++++ lib/std/std.zig | 3 + src-self-hosted/codegen/spu-mk2.zig | 160 +--------------------------- 4 files changed, 166 insertions(+), 158 deletions(-) create mode 100644 lib/std/spu.zig create mode 100644 lib/std/spu/defines.zig diff --git a/lib/std/spu.zig b/lib/std/spu.zig new file mode 100644 index 0000000000..275ef698ea --- /dev/null +++ b/lib/std/spu.zig @@ -0,0 +1,3 @@ +pub usingnamespace @import("spu/defines.zig"); + +pub const interpreter = @import("spu/interpreter.zig").Interpreter; diff --git a/lib/std/spu/defines.zig b/lib/std/spu/defines.zig new file mode 100644 index 0000000000..0f7e6b03be --- /dev/null +++ b/lib/std/spu/defines.zig @@ -0,0 +1,158 @@ +const std = @import("std"); + +pub const ExecutionCondition = enum(u3) { + always = 0, + when_zero = 1, + not_zero = 2, + greater_zero = 3, + less_than_zero = 4, + greater_or_equal_zero = 5, + less_or_equal_zero = 6, + overflow = 7, +}; + +pub const InputBehaviour = enum(u2) { + zero = 0, + immediate = 1, + peek = 2, + pop = 3, +}; + +pub const OutputBehaviour = enum(u2) { + discard = 0, + push = 1, + jump = 2, + jump_relative = 3, +}; + +pub const Command = enum(u5) { + copy = 0, + ipget = 1, + get = 2, + set = 3, + store8 = 4, + store16 = 5, + load8 = 6, + load16 = 7, + undefined0 = 8, + undefined1 = 9, + frget = 10, + frset = 11, + bpget = 12, + bpset = 13, + spget = 14, + spset = 15, + add = 16, + sub = 17, + mul = 18, + div = 19, + mod = 20, + @"and" = 21, + @"or" = 22, + xor = 23, + not = 24, + signext = 25, + rol = 26, + ror = 27, + bswap = 28, + asr = 29, + lsl = 30, + lsr = 31, +}; + +pub const Instruction = packed struct { + condition: ExecutionCondition, + input0: InputBehaviour, + input1: InputBehaviour, + modify_flags: bool, + output: OutputBehaviour, + command: Command, + reserved: u1 = 0, + + pub fn format(instr: Instruction, comptime fmt: []const u8, options: std.fmt.FormatOptions, out: anytype) !void { + try std.fmt.format(out, "0x{x:0<4} ", .{@bitCast(u16, instr)}); + try out.writeAll(switch (instr.condition) { + .always => " ", + .when_zero => "== 0", + .not_zero => "!= 0", + .greater_zero => " > 0", + .less_than_zero => " < 0", + .greater_or_equal_zero => ">= 0", + .less_or_equal_zero => "<= 0", + .overflow => "ovfl", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.input0) { + .zero => "zero", + .immediate => "imm ", + .peek => "peek", + .pop => "pop ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.input1) { + .zero => "zero", + .immediate => "imm ", + .peek => "peek", + .pop => "pop ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.command) { + .copy => "copy ", + .ipget => "ipget ", + .get => "get ", + .set => "set ", + .store8 => "store8 ", + .store16 => "store16 ", + .load8 => "load8 ", + .load16 => "load16 ", + .undefined0 => "undefined", + .undefined1 => "undefined", + .frget => "frget ", + .frset => "frset ", + .bpget => "bpget ", + .bpset => "bpset ", + .spget => "spget ", + .spset => "spset ", + .add => "add ", + .sub => "sub ", + .mul => "mul ", + .div => "div ", + .mod => "mod ", + .@"and" => "and ", + .@"or" => "or ", + .xor => "xor ", + .not => "not ", + .signext => "signext ", + .rol => "rol ", + .ror => "ror ", + .bswap => "bswap ", + .asr => "asr ", + .lsl => "lsl ", + .lsr => "lsr ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.output) { + .discard => "discard", + .push => "push ", + .jump => "jmp ", + .jump_relative => "rjmp ", + }); + try out.writeAll(" "); + try out.writeAll(if (instr.modify_flags) + "+ flags" + else + " "); + } +}; + +pub const FlagRegister = packed struct { + zero: bool, + negative: bool, + carry: bool, + carry_enabled: bool, + interrupt0_enabled: bool, + interrupt1_enabled: bool, + interrupt2_enabled: bool, + interrupt3_enabled: bool, + reserved: u8 = 0, +}; diff --git a/lib/std/std.zig b/lib/std/std.zig index 2ff44f5e41..e6287ac5b7 100644 --- a/lib/std/std.zig +++ b/lib/std/std.zig @@ -80,6 +80,9 @@ pub const valgrind = @import("valgrind.zig"); pub const zig = @import("zig.zig"); pub const start = @import("start.zig"); +// TODO move this +pub const spu = @import("spu.zig"); + // This forces the start.zig file to be imported, and the comptime logic inside that // file decides whether to export any appropriate start symbols. comptime { diff --git a/src-self-hosted/codegen/spu-mk2.zig b/src-self-hosted/codegen/spu-mk2.zig index b44d4123bd..0a95dce663 100644 --- a/src-self-hosted/codegen/spu-mk2.zig +++ b/src-self-hosted/codegen/spu-mk2.zig @@ -1,161 +1,4 @@ -const std = @import("std"); - -pub const ExecutionCondition = enum(u3) { - always = 0, - when_zero = 1, - not_zero = 2, - greater_zero = 3, - less_than_zero = 4, - greater_or_equal_zero = 5, - less_or_equal_zero = 6, - overflow = 7, -}; - -pub const InputBehaviour = enum(u2) { - zero = 0, - immediate = 1, - peek = 2, - pop = 3, -}; - -pub const OutputBehaviour = enum(u2) { - discard = 0, - push = 1, - jump = 2, - jump_relative = 3, -}; - -pub const Command = enum(u5) { - copy = 0, - ipget = 1, - get = 2, - set = 3, - store8 = 4, - store16 = 5, - load8 = 6, - load16 = 7, - undefined0 = 8, - undefined1 = 9, - frget = 10, - frset = 11, - bpget = 12, - bpset = 13, - spget = 14, - spset = 15, - add = 16, - sub = 17, - mul = 18, - div = 19, - mod = 20, - @"and" = 21, - @"or" = 22, - xor = 23, - not = 24, - signext = 25, - rol = 26, - ror = 27, - bswap = 28, - asr = 29, - lsl = 30, - lsr = 31, -}; - -pub const Instruction = packed struct { - condition: ExecutionCondition, - input0: InputBehaviour, - input1: InputBehaviour, - modify_flags: bool, - output: OutputBehaviour, - command: Command, - reserved: u1 = 0, - - pub fn format(instr: Instruction, comptime fmt: []const u8, options: std.fmt.FormatOptions, out: anytype) !void { - try std.fmt.format(out, "0x{x:0<4} ", .{@bitCast(u16, instr)}); - try out.writeAll(switch (instr.condition) { - .always => " ", - .when_zero => "== 0", - .not_zero => "!= 0", - .greater_zero => " > 0", - .less_than_zero => " < 0", - .greater_or_equal_zero => ">= 0", - .less_or_equal_zero => "<= 0", - .overflow => "ovfl", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.input0) { - .zero => "zero", - .immediate => "imm ", - .peek => "peek", - .pop => "pop ", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.input1) { - .zero => "zero", - .immediate => "imm ", - .peek => "peek", - .pop => "pop ", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.command) { - .copy => "copy ", - .ipget => "ipget ", - .get => "get ", - .set => "set ", - .store8 => "store8 ", - .store16 => "store16 ", - .load8 => "load8 ", - .load16 => "load16 ", - .undefined0 => "undefined", - .undefined1 => "undefined", - .frget => "frget ", - .frset => "frset ", - .bpget => "bpget ", - .bpset => "bpset ", - .spget => "spget ", - .spset => "spset ", - .add => "add ", - .sub => "sub ", - .mul => "mul ", - .div => "div ", - .mod => "mod ", - .@"and" => "and ", - .@"or" => "or ", - .xor => "xor ", - .not => "not ", - .signext => "signext ", - .rol => "rol ", - .ror => "ror ", - .bswap => "bswap ", - .asr => "asr ", - .lsl => "lsl ", - .lsr => "lsr ", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.output) { - .discard => "discard", - .push => "push ", - .jump => "jmp ", - .jump_relative => "rjmp ", - }); - try out.writeAll(" "); - try out.writeAll(if (instr.modify_flags) - "+ flags" - else - " "); - } -}; - -pub const FlagRegister = packed struct { - zero: bool, - negative: bool, - carry: bool, - carry_enabled: bool, - interrupt0_enabled: bool, - interrupt1_enabled: bool, - interrupt2_enabled: bool, - interrupt3_enabled: bool, - reserved: u8 = 0, -}; +pub usingnamespace @import("std").spu; pub const Register = enum { dummy, @@ -164,4 +7,5 @@ pub const Register = enum { return null; } }; + pub const callee_preserved_regs = [_]Register{}; From f2fef240a1a1d7caa06daa8e1bdf58206b42a73c Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Wed, 19 Aug 2020 12:45:34 -0400 Subject: [PATCH 19/55] SPU-II: Test harness skeleton --- lib/std/spu/interpreter.zig | 159 ++++++++++++++++++++++++++++++++++++ src-self-hosted/test.zig | 51 +++++++++++- test/stage2/spu-ii.zig | 23 ++++++ test/stage2/test.zig | 1 + 4 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 lib/std/spu/interpreter.zig create mode 100644 test/stage2/spu-ii.zig diff --git a/lib/std/spu/interpreter.zig b/lib/std/spu/interpreter.zig new file mode 100644 index 0000000000..ed22b13099 --- /dev/null +++ b/lib/std/spu/interpreter.zig @@ -0,0 +1,159 @@ +const std = @import("std"); +usingnamespace @import("defines.zig"); + +pub fn Interpreter(comptime Bus: type) type { + return struct { + ip: u16 = 0, + sp: u16 = undefined, + bp: u16 = undefined, + fr: FlagRegister = @bitCast(FlagRegister, @as(u16, 0)), + /// This is set to true when we hit an undefined0 instruction, allowing it to + /// be used as a trap for testing purposes + undefined0: bool = false, + bus: Bus, + + pub fn ExecuteBlock(self: *@This(), comptime size: ?u32) !void { + var count: usize = 0; + while (size == null or count < size.?) { + count += 1; + var instruction = @bitCast(Instruction, self.bus.read16(self.ip)); + + std.log.debug(.SPU_2_Interpreter, "Executing {}\n", .{instruction}); + + self.ip +%= 2; + + const execute = switch (instruction.condition) { + .always => true, + .not_zero => !self.fr.zero, + .when_zero => self.fr.zero, + .overflow => self.fr.carry, + ExecutionCondition.greater_or_equal_zero => !self.fr.negative, + else => return error.unimplemented, + }; + + if (execute) { + const val0 = switch (instruction.input0) { + .zero => @as(u16, 0), + .immediate => i: { + const val = self.bus.read16(@intCast(u16, self.ip)); + self.ip +%= 2; + break :i val; + }, + else => |e| e: { + // peek or pop; show value at current SP, and if pop, increment sp + const val = self.bus.read16(self.sp); + if (e == .pop) { + self.sp +%= 2; + } + break :e val; + }, + }; + const val1 = switch (instruction.input1) { + .zero => @as(u16, 0), + .immediate => i: { + const val = self.bus.read16(@intCast(u16, self.ip)); + self.ip +%= 2; + break :i val; + }, + else => |e| e: { + // peek or pop; show value at current SP, and if pop, increment sp + const val = self.bus.read16(self.sp); + if (e == .pop) { + self.sp +%= 2; + } + break :e val; + }, + }; + + const output: u16 = switch (instruction.command) { + .get => self.bus.read16(self.bp +% (2 *% val0)), + .set => a: { + self.bus.write16(self.bp +% 2 *% val0, val1); + break :a val1; + }, + .load8 => self.bus.read8(val0), + .load16 => self.bus.read16(val0), + .store8 => a: { + const val = @truncate(u8, val1); + self.bus.write8(val0, val); + break :a val; + }, + .store16 => a: { + self.bus.write16(val0, val1); + break :a val1; + }, + .copy => val0, + .add => a: { + var val: u16 = undefined; + self.fr.carry = @addWithOverflow(u16, val0, val1, &val); + break :a val; + }, + .sub => a: { + var val: u16 = undefined; + self.fr.carry = @subWithOverflow(u16, val0, val1, &val); + break :a val; + }, + .spset => a: { + self.sp = val0; + break :a val0; + }, + .bpset => a: { + self.bp = val0; + break :a val0; + }, + .frset => a: { + const val = (@bitCast(u16, self.fr) & val1) | (val0 & ~val1); + self.fr = @bitCast(FlagRegister, val); + break :a val; + }, + .bswap => (val0 >> 8) | (val0 << 8), + .bpget => self.bp, + .spget => self.sp, + .ipget => self.ip +% (2 *% val0), + .lsl => val0 << 1, + .lsr => val0 >> 1, + .@"and" => val0 & val1, + .@"or" => val0 | val1, + .xor => val0 ^ val1, + .not => ~val0, + .undefined0 => { + self.undefined0 = true; + // Break out of the loop, and let the caller decide what to do + return; + }, + .undefined1 => return error.BadInstruction, + .signext => if ((val0 & 0x80) != 0) + (val0 & 0xFF) | 0xFF00 + else + (val0 & 0xFF), + else => return error.unimplemented, + }; + + switch (instruction.output) { + .discard => {}, + .push => { + self.sp -%= 2; + self.bus.write16(self.sp, output); + }, + .jump => { + self.ip = output; + if (!(instruction.command == .copy and instruction.input0 == .immediate)) { + // Not absolute. Break, for compatibility with JIT. + break; + } + }, + else => return error.unimplemented, + } + if (instruction.modify_flags) { + self.fr.negative = (output & 0x8000) != 0; + self.fr.zero = (output == 0x0000); + } + } else { + if (instruction.input0 == .immediate) self.ip +%= 2; + if (instruction.input1 == .immediate) self.ip +%= 2; + break; + } + } + } + }; +} diff --git a/src-self-hosted/test.zig b/src-self-hosted/test.zig index 9e88466cf7..db2c4a8838 100644 --- a/src-self-hosted/test.zig +++ b/src-self-hosted/test.zig @@ -571,6 +571,56 @@ pub const TestContext = struct { std.debug.assert(!case.cbe); update_node.estimated_total_items = 4; + if (case.target.cpu_arch) |arch| { + if (arch == .spu_2) { + if (case.target.os_tag) |os| { + if (os != .freestanding) { + std.debug.panic("Only freestanding makes sense for SPU-II tests!", .{}); + } + } else { + std.debug.panic("SPU_2 has no native OS, check the test!", .{}); + } + var output = std.ArrayList(u8).init(allocator); + // defer output.deinit(); + const uart = struct { + fn in(_out: usize) !u8 { + return error.not_implemented; + } + fn out(_output: usize, val: u8) !void { + try @intToPtr(*std.ArrayList(u8), _output).append(val); + } + }; + var interpreter = std.spu.interpreter(struct { + RAM: [0x10000]u8 = undefined, + + pub fn read8(bus: @This(), addr: u16) u8 { + return bus.RAM[addr]; + } + pub fn read16(bus: @This(), addr: u16) u16 { + return std.mem.readIntLittle(u16, bus.RAM[addr..][0..2]); + } + + pub fn write8(bus: *@This(), addr: u16, val: u8) void { + bus.RAM[addr] = val; + } + + pub fn write16(bus: *@This(), addr: u16, val: u16) void { + std.mem.writeIntLittle(u16, bus.RAM[addr..][0..2], val); + } + }){ + .bus = .{}, + }; + + //defer interpreter.deinit(allocator); + std.debug.print("TODO implement SPU-II test loader\n", .{}); + std.process.exit(1); + // TODO: loop detection? Solve the halting problem? fork() and limit by wall clock? + // Limit by emulated cycles? + // while (!interpreter.undefined0) { + // try interpreter.ExecuteBlock(100); + // } + } + } var exec_result = x: { var exec_node = update_node.start("execute", null); exec_node.activate(); @@ -635,7 +685,6 @@ pub const TestContext = struct { var test_node = update_node.start("test", null); test_node.activate(); defer test_node.end(); - defer allocator.free(exec_result.stdout); defer allocator.free(exec_result.stderr); switch (exec_result.term) { diff --git a/test/stage2/spu-ii.zig b/test/stage2/spu-ii.zig new file mode 100644 index 0000000000..1316f19d0d --- /dev/null +++ b/test/stage2/spu-ii.zig @@ -0,0 +1,23 @@ +const std = @import("std"); +const TestContext = @import("../../src-self-hosted/test.zig").TestContext; + +const spu = std.zig.CrossTarget{ + .cpu_arch = .spu_2, + .os_tag = .freestanding, +}; + +pub fn addCases(ctx: *TestContext) !void { + { + var case = ctx.exe("SPU-II Basic Test", spu); + case.addCompareOutput( + \\fn killEmulator() noreturn { + \\ asm volatile ("undefined0"); + \\ unreachable; + \\} + \\ + \\export fn _start() noreturn { + \\ killEmulator(); + \\} + , ""); + } +} diff --git a/test/stage2/test.zig b/test/stage2/test.zig index 791a073393..832d9a44db 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -785,4 +785,5 @@ pub fn addCases(ctx: *TestContext) !void { \\} \\extern var foo; , &[_][]const u8{":4:1: error: unable to infer variable type"}); + try @import("spu-ii.zig").addCases(ctx); } From 3a9af0c88be324dd049d85da0600230a03404946 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Wed, 19 Aug 2020 12:26:19 -0400 Subject: [PATCH 20/55] SPU-II: Ignore @breakpoint for now --- src-self-hosted/codegen.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 8ff0d32461..aec4ea81e6 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1265,6 +1265,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .riscv64 => { mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.ebreak.toU32()); }, + .spu_2 => {}, else => return self.fail(src, "TODO implement @breakpoint() for {}", .{self.target.cpu.arch}), } return .none; From f2796239baf1b5883e007729e6064e144c443b56 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 07:20:25 -0400 Subject: [PATCH 21/55] SPU-II: Fix logging in interp, remove JIT-compat code --- lib/std/spu/interpreter.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/std/spu/interpreter.zig b/lib/std/spu/interpreter.zig index ed22b13099..66d75a5676 100644 --- a/lib/std/spu/interpreter.zig +++ b/lib/std/spu/interpreter.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const log = std.log.scoped(.SPU_2_Interpreter); usingnamespace @import("defines.zig"); pub fn Interpreter(comptime Bus: type) type { @@ -18,7 +19,7 @@ pub fn Interpreter(comptime Bus: type) type { count += 1; var instruction = @bitCast(Instruction, self.bus.read16(self.ip)); - std.log.debug(.SPU_2_Interpreter, "Executing {}\n", .{instruction}); + log.debug("Executing {}\n", .{instruction}); self.ip +%= 2; @@ -137,10 +138,6 @@ pub fn Interpreter(comptime Bus: type) type { }, .jump => { self.ip = output; - if (!(instruction.command == .copy and instruction.input0 == .immediate)) { - // Not absolute. Break, for compatibility with JIT. - break; - } }, else => return error.unimplemented, } From fa1d18a15583253d457c39fc38e5bdda8b3f2cf2 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 07:20:51 -0400 Subject: [PATCH 22/55] Linker: fix GOT production on 16-bit targets --- src-self-hosted/link/Elf.zig | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index f197ebb6d2..34f2243718 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -2201,7 +2201,7 @@ fn writeSectHeader(self: *Elf, index: usize) !void { fn writeOffsetTableEntry(self: *Elf, index: usize) !void { const shdr = &self.sections.items[self.got_section_index.?]; const phdr = &self.program_headers.items[self.phdr_got_index.?]; - const entry_size: u16 = self.ptrWidthBytes(); + const entry_size: u16 = self.base.options.target.cpu.arch.ptrBitWidth() / 8; if (self.offset_table_count_dirty) { // TODO Also detect virtual address collisions. const allocated_size = self.allocatedSize(shdr.sh_offset); @@ -2225,17 +2225,23 @@ fn writeOffsetTableEntry(self: *Elf, index: usize) !void { } const endian = self.base.options.target.cpu.arch.endian(); const off = shdr.sh_offset + @as(u64, entry_size) * index; - switch (self.ptr_width) { - .p32 => { + switch (entry_size) { + 2 => { + var buf: [2]u8 = undefined; + mem.writeInt(u16, &buf, @intCast(u16, self.offset_table.items[index]), endian); + try self.base.file.?.pwriteAll(&buf, off); + }, + 4 => { var buf: [4]u8 = undefined; mem.writeInt(u32, &buf, @intCast(u32, self.offset_table.items[index]), endian); try self.base.file.?.pwriteAll(&buf, off); }, - .p64 => { + 8 => { var buf: [8]u8 = undefined; mem.writeInt(u64, &buf, self.offset_table.items[index], endian); try self.base.file.?.pwriteAll(&buf, off); }, + else => unreachable, } } From 096c5d5e4bf6856fc2250c42a07d1df7c31a1775 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 07:21:11 -0400 Subject: [PATCH 23/55] Tests: implement SPU-II harness --- src-self-hosted/test.zig | 68 ++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/src-self-hosted/test.zig b/src-self-hosted/test.zig index db2c4a8838..ebd050e80c 100644 --- a/src-self-hosted/test.zig +++ b/src-self-hosted/test.zig @@ -580,16 +580,7 @@ pub const TestContext = struct { } else { std.debug.panic("SPU_2 has no native OS, check the test!", .{}); } - var output = std.ArrayList(u8).init(allocator); - // defer output.deinit(); - const uart = struct { - fn in(_out: usize) !u8 { - return error.not_implemented; - } - fn out(_output: usize, val: u8) !void { - try @intToPtr(*std.ArrayList(u8), _output).append(val); - } - }; + var interpreter = std.spu.interpreter(struct { RAM: [0x10000]u8 = undefined, @@ -611,14 +602,59 @@ pub const TestContext = struct { .bus = .{}, }; - //defer interpreter.deinit(allocator); - std.debug.print("TODO implement SPU-II test loader\n", .{}); - std.process.exit(1); + { + var load_node = update_node.start("load", null); + load_node.activate(); + defer load_node.end(); + + var file = try tmp.dir.openFile(bin_name, .{ .read = true }); + defer file.close(); + + const header = try std.elf.readHeader(file); + var iterator = header.program_header_iterator(file); + + var none_loaded = true; + + while (try iterator.next()) |phdr| { + if (phdr.p_type != std.elf.PT_LOAD) { + std.debug.print("Encountered unexpected ELF program header: type {}\n", .{phdr.p_type}); + std.process.exit(1); + } + if (phdr.p_paddr != phdr.p_vaddr) { + std.debug.print("Physical address does not match virtual address in ELF header!\n", .{}); + std.process.exit(1); + } + if (phdr.p_filesz != phdr.p_memsz) { + std.debug.print("Physical size does not match virtual size in ELF header!\n", .{}); + std.process.exit(1); + } + if ((try file.pread(interpreter.bus.RAM[phdr.p_paddr .. phdr.p_paddr + phdr.p_filesz], phdr.p_offset)) != phdr.p_filesz) { + std.debug.print("Read less than expected from ELF file!", .{}); + std.process.exit(1); + } + std.log.scoped(.spu2_test).debug("Loaded 0x{x} bytes to 0x{x:0<4}\n", .{ phdr.p_filesz, phdr.p_paddr }); + none_loaded = false; + } + if (none_loaded) { + std.debug.print("No data found in ELF file!\n", .{}); + std.process.exit(1); + } + } + + var exec_node = update_node.start("execute", null); + exec_node.activate(); + defer exec_node.end(); + // TODO: loop detection? Solve the halting problem? fork() and limit by wall clock? // Limit by emulated cycles? - // while (!interpreter.undefined0) { - // try interpreter.ExecuteBlock(100); - // } + while (!interpreter.undefined0) { + const pre_ip = interpreter.ip; + try interpreter.ExecuteBlock(1); + if (pre_ip == interpreter.ip) { + std.debug.print("Infinite loop detected in SPU II test!\n", .{}); + std.process.exit(1); + } + } } } var exec_result = x: { From 222e23c6786e0ac307524c6c91b41782111af82a Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 07:25:21 -0400 Subject: [PATCH 24/55] Linker: make defaults read-only --- src-self-hosted/link.zig | 2 +- src-self-hosted/link/Elf.zig | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src-self-hosted/link.zig b/src-self-hosted/link.zig index e8604038c2..59b01dc762 100644 --- a/src-self-hosted/link.zig +++ b/src-self-hosted/link.zig @@ -23,7 +23,7 @@ pub const Options = struct { /// Used for calculating how much space to reserve for executable program code in case /// the binary file deos not already have such a section. program_code_size_hint: u64 = 256 * 1024, - default_entry_addr: u64 = 0x8000000, + entry_addr: ?u64 = null, }; pub const File = struct { diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index 34f2243718..53798053c2 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -286,10 +286,6 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf }; errdefer self.deinit(); - if (options.target.cpu.arch == .spu_2) { - self.base.options.default_entry_addr = 0; - } - // Index 0 is always a null symbol. try self.local_symbols.append(allocator, .{ .st_name = 0, @@ -466,12 +462,13 @@ pub fn populateMissingMetadata(self: *Elf) !void { const p_align = 0x1000; const off = self.findFreeSpace(file_size, p_align); log.debug("found PT_LOAD free space 0x{x} to 0x{x}\n", .{ off, off + file_size }); + const entry_addr: u64 = self.entry_addr orelse if (self.base.options.target.cpu.arch == .spu_2) @as(u64, 0) else default_entry_addr; try self.program_headers.append(self.base.allocator, .{ .p_type = elf.PT_LOAD, .p_offset = off, .p_filesz = file_size, - .p_vaddr = self.base.options.default_entry_addr, - .p_paddr = self.base.options.default_entry_addr, + .p_vaddr = entry_addr, + .p_paddr = entry_addr, .p_memsz = file_size, .p_align = p_align, .p_flags = elf.PF_X | elf.PF_R, @@ -490,13 +487,13 @@ pub fn populateMissingMetadata(self: *Elf) !void { // TODO instead of hard coding the vaddr, make a function to find a vaddr to put things at. // we'll need to re-use that function anyway, in case the GOT grows and overlaps something // else in virtual memory. - const default_got_addr = if (self.base.options.target.cpu.arch.ptrBitWidth() == 16) @as(u32, 0x8000) else 0x4000000; + const got_addr = if (self.base.options.target.cpu.arch.ptrBitWidth() == 16) @as(u32, 0x8000) else 0x4000000; try self.program_headers.append(self.base.allocator, .{ .p_type = elf.PT_LOAD, .p_offset = off, .p_filesz = file_size, - .p_vaddr = default_got_addr, - .p_paddr = default_got_addr, + .p_vaddr = got_addr, + .p_paddr = got_addr, .p_memsz = file_size, .p_align = p_align, .p_flags = elf.PF_R, From f448b518f874929dd219ed957c314889d5dbf0cf Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 18:19:23 -0400 Subject: [PATCH 25/55] SPU-II: use undefined1 as breakpoint --- lib/std/spu/interpreter.zig | 9 ++++++++- src-self-hosted/codegen.zig | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/std/spu/interpreter.zig b/lib/std/spu/interpreter.zig index 66d75a5676..d008955a93 100644 --- a/lib/std/spu/interpreter.zig +++ b/lib/std/spu/interpreter.zig @@ -11,6 +11,9 @@ pub fn Interpreter(comptime Bus: type) type { /// This is set to true when we hit an undefined0 instruction, allowing it to /// be used as a trap for testing purposes undefined0: bool = false, + /// This is set to true when we hit an undefined1 instruction, allowing it to + /// be used as a trap for testing purposes. undefined1 is used as a breakpoint. + undefined1: bool = false, bus: Bus, pub fn ExecuteBlock(self: *@This(), comptime size: ?u32) !void { @@ -122,7 +125,11 @@ pub fn Interpreter(comptime Bus: type) type { // Break out of the loop, and let the caller decide what to do return; }, - .undefined1 => return error.BadInstruction, + .undefined1 => { + self.undefined1 = true; + // Break out of the loop, and let the caller decide what to do + return; + }, .signext => if ((val0 & 0x80) != 0) (val0 & 0xFF) | 0xFF00 else diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index aec4ea81e6..c3cb1fb8e2 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1265,7 +1265,11 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .riscv64 => { mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.ebreak.toU32()); }, - .spu_2 => {}, + .spu_2 => { + try self.code.resize(self.code.items.len + 2); + var instr = Instruction{ .condition = .always, .input0 = .zero, .input1 = .zero, .modify_flags = false, .output = .discard, .command = .undefined1 }; + mem.writeIntLittle(u16, self.code.items[self.code.items.len - 2 ..][0..2], @bitCast(u16, instr)); + }, else => return self.fail(src, "TODO implement @breakpoint() for {}", .{self.target.cpu.arch}), } return .none; From ad9df43e4926247cff20a9d9851fffb2a99c8a30 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 18:24:00 -0400 Subject: [PATCH 26/55] Tests: limit SPU-II cycle count --- src-self-hosted/test.zig | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src-self-hosted/test.zig b/src-self-hosted/test.zig index ebd050e80c..3f02d78b9b 100644 --- a/src-self-hosted/test.zig +++ b/src-self-hosted/test.zig @@ -645,14 +645,17 @@ pub const TestContext = struct { exec_node.activate(); defer exec_node.end(); - // TODO: loop detection? Solve the halting problem? fork() and limit by wall clock? - // Limit by emulated cycles? + var blocks: u16 = 1000; + const block_size = 1000; while (!interpreter.undefined0) { const pre_ip = interpreter.ip; - try interpreter.ExecuteBlock(1); - if (pre_ip == interpreter.ip) { - std.debug.print("Infinite loop detected in SPU II test!\n", .{}); - std.process.exit(1); + if (blocks > 0) { + blocks -= 1; + try interpreter.ExecuteBlock(block_size); + if (pre_ip == interpreter.ip) { + std.debug.print("Infinite loop detected in SPU II test!\n", .{}); + std.process.exit(1); + } } } } From 24efbf5ddfd7037eb5e0ec32fe73e10631add788 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Fri, 21 Aug 2020 18:25:46 -0400 Subject: [PATCH 27/55] Codegen: Move REX assert to comptime --- src-self-hosted/codegen.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index c3cb1fb8e2..93305b70e3 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1776,7 +1776,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { /// X => extension to the SIB.index field /// B => extension to the MODRM.rm field or the SIB.base field fn rex(self: *Self, arg: struct { b: bool = false, w: bool = false, x: bool = false, r: bool = false }) void { - std.debug.assert(arch == .x86_64); + comptime assert(arch == .x86_64); // From section 2.2.1.2 of the manual, REX is encoded as b0100WRXB. var value: u8 = 0x40; if (arg.b) { From 54f3b0a560f17effbb582f86ebf83c53916fc697 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 22 Aug 2020 13:36:08 -0700 Subject: [PATCH 28/55] stage2: clean up SPU Mk II code * move SPU code from std to self hosted compiler * change std lib comments to be descriptive rather than prescriptive * avoid usingnamespace * fix case style of error codes * remove duplication of producer_string * generalize handling of less than 64 bit arch pointers * clean up SPU II related test harness code --- lib/std/spu.zig | 3 - lib/std/spu/defines.zig | 158 -------------- lib/std/std.zig | 3 - lib/std/target.zig | 3 +- src-self-hosted/codegen/spu-mk2.zig | 161 +++++++++++++- .../codegen/spu-mk2}/interpreter.zig | 11 +- src-self-hosted/link.zig | 2 +- src-self-hosted/link/Elf.zig | 39 ++-- src-self-hosted/test.zig | 205 ++++++++++-------- test/stage2/test.zig | 3 +- 10 files changed, 308 insertions(+), 280 deletions(-) delete mode 100644 lib/std/spu.zig delete mode 100644 lib/std/spu/defines.zig rename {lib/std/spu => src-self-hosted/codegen/spu-mk2}/interpreter.zig (95%) diff --git a/lib/std/spu.zig b/lib/std/spu.zig deleted file mode 100644 index 275ef698ea..0000000000 --- a/lib/std/spu.zig +++ /dev/null @@ -1,3 +0,0 @@ -pub usingnamespace @import("spu/defines.zig"); - -pub const interpreter = @import("spu/interpreter.zig").Interpreter; diff --git a/lib/std/spu/defines.zig b/lib/std/spu/defines.zig deleted file mode 100644 index 0f7e6b03be..0000000000 --- a/lib/std/spu/defines.zig +++ /dev/null @@ -1,158 +0,0 @@ -const std = @import("std"); - -pub const ExecutionCondition = enum(u3) { - always = 0, - when_zero = 1, - not_zero = 2, - greater_zero = 3, - less_than_zero = 4, - greater_or_equal_zero = 5, - less_or_equal_zero = 6, - overflow = 7, -}; - -pub const InputBehaviour = enum(u2) { - zero = 0, - immediate = 1, - peek = 2, - pop = 3, -}; - -pub const OutputBehaviour = enum(u2) { - discard = 0, - push = 1, - jump = 2, - jump_relative = 3, -}; - -pub const Command = enum(u5) { - copy = 0, - ipget = 1, - get = 2, - set = 3, - store8 = 4, - store16 = 5, - load8 = 6, - load16 = 7, - undefined0 = 8, - undefined1 = 9, - frget = 10, - frset = 11, - bpget = 12, - bpset = 13, - spget = 14, - spset = 15, - add = 16, - sub = 17, - mul = 18, - div = 19, - mod = 20, - @"and" = 21, - @"or" = 22, - xor = 23, - not = 24, - signext = 25, - rol = 26, - ror = 27, - bswap = 28, - asr = 29, - lsl = 30, - lsr = 31, -}; - -pub const Instruction = packed struct { - condition: ExecutionCondition, - input0: InputBehaviour, - input1: InputBehaviour, - modify_flags: bool, - output: OutputBehaviour, - command: Command, - reserved: u1 = 0, - - pub fn format(instr: Instruction, comptime fmt: []const u8, options: std.fmt.FormatOptions, out: anytype) !void { - try std.fmt.format(out, "0x{x:0<4} ", .{@bitCast(u16, instr)}); - try out.writeAll(switch (instr.condition) { - .always => " ", - .when_zero => "== 0", - .not_zero => "!= 0", - .greater_zero => " > 0", - .less_than_zero => " < 0", - .greater_or_equal_zero => ">= 0", - .less_or_equal_zero => "<= 0", - .overflow => "ovfl", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.input0) { - .zero => "zero", - .immediate => "imm ", - .peek => "peek", - .pop => "pop ", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.input1) { - .zero => "zero", - .immediate => "imm ", - .peek => "peek", - .pop => "pop ", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.command) { - .copy => "copy ", - .ipget => "ipget ", - .get => "get ", - .set => "set ", - .store8 => "store8 ", - .store16 => "store16 ", - .load8 => "load8 ", - .load16 => "load16 ", - .undefined0 => "undefined", - .undefined1 => "undefined", - .frget => "frget ", - .frset => "frset ", - .bpget => "bpget ", - .bpset => "bpset ", - .spget => "spget ", - .spset => "spset ", - .add => "add ", - .sub => "sub ", - .mul => "mul ", - .div => "div ", - .mod => "mod ", - .@"and" => "and ", - .@"or" => "or ", - .xor => "xor ", - .not => "not ", - .signext => "signext ", - .rol => "rol ", - .ror => "ror ", - .bswap => "bswap ", - .asr => "asr ", - .lsl => "lsl ", - .lsr => "lsr ", - }); - try out.writeAll(" "); - try out.writeAll(switch (instr.output) { - .discard => "discard", - .push => "push ", - .jump => "jmp ", - .jump_relative => "rjmp ", - }); - try out.writeAll(" "); - try out.writeAll(if (instr.modify_flags) - "+ flags" - else - " "); - } -}; - -pub const FlagRegister = packed struct { - zero: bool, - negative: bool, - carry: bool, - carry_enabled: bool, - interrupt0_enabled: bool, - interrupt1_enabled: bool, - interrupt2_enabled: bool, - interrupt3_enabled: bool, - reserved: u8 = 0, -}; diff --git a/lib/std/std.zig b/lib/std/std.zig index e6287ac5b7..2ff44f5e41 100644 --- a/lib/std/std.zig +++ b/lib/std/std.zig @@ -80,9 +80,6 @@ pub const valgrind = @import("valgrind.zig"); pub const zig = @import("zig.zig"); pub const start = @import("start.zig"); -// TODO move this -pub const spu = @import("spu.zig"); - // This forces the start.zig file to be imported, and the comptime logic inside that // file decides whether to export any appropriate start symbols. comptime { diff --git a/lib/std/target.zig b/lib/std/target.zig index fcd90357fb..080ac65f5c 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -663,7 +663,8 @@ pub const Target = struct { renderscript32, renderscript64, ve, - // Non-LLVM targets go here + // Stage1 currently assumes that architectures above this comment + // map one-to-one with the ZigLLVM_ArchType enum. spu_2, pub fn isARM(arch: Arch) bool { diff --git a/src-self-hosted/codegen/spu-mk2.zig b/src-self-hosted/codegen/spu-mk2.zig index 0a95dce663..542862caca 100644 --- a/src-self-hosted/codegen/spu-mk2.zig +++ b/src-self-hosted/codegen/spu-mk2.zig @@ -1,4 +1,163 @@ -pub usingnamespace @import("std").spu; +const std = @import("std"); + +pub const Interpreter = @import("spu-mk2/interpreter.zig").Interpreter; + +pub const ExecutionCondition = enum(u3) { + always = 0, + when_zero = 1, + not_zero = 2, + greater_zero = 3, + less_than_zero = 4, + greater_or_equal_zero = 5, + less_or_equal_zero = 6, + overflow = 7, +}; + +pub const InputBehaviour = enum(u2) { + zero = 0, + immediate = 1, + peek = 2, + pop = 3, +}; + +pub const OutputBehaviour = enum(u2) { + discard = 0, + push = 1, + jump = 2, + jump_relative = 3, +}; + +pub const Command = enum(u5) { + copy = 0, + ipget = 1, + get = 2, + set = 3, + store8 = 4, + store16 = 5, + load8 = 6, + load16 = 7, + undefined0 = 8, + undefined1 = 9, + frget = 10, + frset = 11, + bpget = 12, + bpset = 13, + spget = 14, + spset = 15, + add = 16, + sub = 17, + mul = 18, + div = 19, + mod = 20, + @"and" = 21, + @"or" = 22, + xor = 23, + not = 24, + signext = 25, + rol = 26, + ror = 27, + bswap = 28, + asr = 29, + lsl = 30, + lsr = 31, +}; + +pub const Instruction = packed struct { + condition: ExecutionCondition, + input0: InputBehaviour, + input1: InputBehaviour, + modify_flags: bool, + output: OutputBehaviour, + command: Command, + reserved: u1 = 0, + + pub fn format(instr: Instruction, comptime fmt: []const u8, options: std.fmt.FormatOptions, out: anytype) !void { + try std.fmt.format(out, "0x{x:0<4} ", .{@bitCast(u16, instr)}); + try out.writeAll(switch (instr.condition) { + .always => " ", + .when_zero => "== 0", + .not_zero => "!= 0", + .greater_zero => " > 0", + .less_than_zero => " < 0", + .greater_or_equal_zero => ">= 0", + .less_or_equal_zero => "<= 0", + .overflow => "ovfl", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.input0) { + .zero => "zero", + .immediate => "imm ", + .peek => "peek", + .pop => "pop ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.input1) { + .zero => "zero", + .immediate => "imm ", + .peek => "peek", + .pop => "pop ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.command) { + .copy => "copy ", + .ipget => "ipget ", + .get => "get ", + .set => "set ", + .store8 => "store8 ", + .store16 => "store16 ", + .load8 => "load8 ", + .load16 => "load16 ", + .undefined0 => "undefined", + .undefined1 => "undefined", + .frget => "frget ", + .frset => "frset ", + .bpget => "bpget ", + .bpset => "bpset ", + .spget => "spget ", + .spset => "spset ", + .add => "add ", + .sub => "sub ", + .mul => "mul ", + .div => "div ", + .mod => "mod ", + .@"and" => "and ", + .@"or" => "or ", + .xor => "xor ", + .not => "not ", + .signext => "signext ", + .rol => "rol ", + .ror => "ror ", + .bswap => "bswap ", + .asr => "asr ", + .lsl => "lsl ", + .lsr => "lsr ", + }); + try out.writeAll(" "); + try out.writeAll(switch (instr.output) { + .discard => "discard", + .push => "push ", + .jump => "jmp ", + .jump_relative => "rjmp ", + }); + try out.writeAll(" "); + try out.writeAll(if (instr.modify_flags) + "+ flags" + else + " "); + } +}; + +pub const FlagRegister = packed struct { + zero: bool, + negative: bool, + carry: bool, + carry_enabled: bool, + interrupt0_enabled: bool, + interrupt1_enabled: bool, + interrupt2_enabled: bool, + interrupt3_enabled: bool, + reserved: u8 = 0, +}; pub const Register = enum { dummy, diff --git a/lib/std/spu/interpreter.zig b/src-self-hosted/codegen/spu-mk2/interpreter.zig similarity index 95% rename from lib/std/spu/interpreter.zig rename to src-self-hosted/codegen/spu-mk2/interpreter.zig index d008955a93..1ec99546c6 100644 --- a/lib/std/spu/interpreter.zig +++ b/src-self-hosted/codegen/spu-mk2/interpreter.zig @@ -1,6 +1,9 @@ const std = @import("std"); const log = std.log.scoped(.SPU_2_Interpreter); -usingnamespace @import("defines.zig"); +const spu = @import("../spu-mk2.zig"); +const FlagRegister = spu.FlagRegister; +const Instruction = spu.Instruction; +const ExecutionCondition = spu.ExecutionCondition; pub fn Interpreter(comptime Bus: type) type { return struct { @@ -32,7 +35,7 @@ pub fn Interpreter(comptime Bus: type) type { .when_zero => self.fr.zero, .overflow => self.fr.carry, ExecutionCondition.greater_or_equal_zero => !self.fr.negative, - else => return error.unimplemented, + else => return error.Unimplemented, }; if (execute) { @@ -134,7 +137,7 @@ pub fn Interpreter(comptime Bus: type) type { (val0 & 0xFF) | 0xFF00 else (val0 & 0xFF), - else => return error.unimplemented, + else => return error.Unimplemented, }; switch (instruction.output) { @@ -146,7 +149,7 @@ pub fn Interpreter(comptime Bus: type) type { .jump => { self.ip = output; }, - else => return error.unimplemented, + else => return error.Unimplemented, } if (instruction.modify_flags) { self.fr.negative = (output & 0x8000) != 0; diff --git a/src-self-hosted/link.zig b/src-self-hosted/link.zig index 59b01dc762..7a5680dfbf 100644 --- a/src-self-hosted/link.zig +++ b/src-self-hosted/link.zig @@ -7,7 +7,7 @@ const Package = @import("Package.zig"); const Type = @import("type.zig").Type; const build_options = @import("build_options"); -const producer_string = if (std.builtin.is_test) "zig test" else "zig " ++ build_options.version; +pub const producer_string = if (std.builtin.is_test) "zig test" else "zig " ++ build_options.version; pub const Options = struct { target: std.Target, diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index 53798053c2..eeb0289b05 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -14,12 +14,10 @@ const leb128 = std.debug.leb; const Package = @import("../Package.zig"); const Value = @import("../value.zig").Value; const Type = @import("../type.zig").Type; -const build_options = @import("build_options"); const link = @import("../link.zig"); const File = link.File; const Elf = @This(); -const producer_string = if (std.builtin.is_test) "zig test" else "zig " ++ build_options.version; const default_entry_addr = 0x8000000; // TODO Turn back on zig fmt when https://github.com/ziglang/zig/issues/5948 is implemented. @@ -249,8 +247,8 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf { .allocator = allocator, }, .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) { - 16, 32 => .p32, - 64 => .p64, + 0 ... 32 => .p32, + 33 ... 64 => .p64, else => return error.UnsupportedELFArchitecture, }, }; @@ -278,8 +276,8 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf .file = file, }, .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) { - 16, 32 => .p32, - 64 => .p64, + 0 ... 32 => .p32, + 33 ... 64 => .p64, else => return error.UnsupportedELFArchitecture, }, .shdr_table_dirty = true, @@ -346,7 +344,7 @@ fn getDebugLineProgramEnd(self: Elf) u32 { /// Returns end pos of collision, if any. fn detectAllocCollision(self: *Elf, start: u64, size: u64) ?u64 { - const small_ptr = self.base.options.target.cpu.arch.ptrBitWidth() == 32; + const small_ptr = self.ptr_width == .p32; const ehdr_size: u64 = if (small_ptr) @sizeOf(elf.Elf32_Ehdr) else @sizeOf(elf.Elf64_Ehdr); if (start < ehdr_size) return ehdr_size; @@ -487,7 +485,7 @@ pub fn populateMissingMetadata(self: *Elf) !void { // TODO instead of hard coding the vaddr, make a function to find a vaddr to put things at. // we'll need to re-use that function anyway, in case the GOT grows and overlaps something // else in virtual memory. - const got_addr = if (self.base.options.target.cpu.arch.ptrBitWidth() == 16) @as(u32, 0x8000) else 0x4000000; + const got_addr: u32 = if (self.base.options.target.cpu.arch.ptrBitWidth() >= 32) 0x4000000 else 0x8000; try self.program_headers.append(self.base.allocator, .{ .p_type = elf.PT_LOAD, .p_offset = off, @@ -864,7 +862,7 @@ pub fn flush(self: *Elf, module: *Module) !void { // Write the form for the compile unit, which must match the abbrev table above. const name_strp = try self.makeDebugString(self.base.options.root_pkg.root_src_path); const comp_dir_strp = try self.makeDebugString(self.base.options.root_pkg.root_src_dir_path); - const producer_strp = try self.makeDebugString(producer_string); + const producer_strp = try self.makeDebugString(link.producer_string); // Currently only one compilation unit is supported, so the address range is simply // identical to the main program header virtual address and memory size. const text_phdr = &self.program_headers.items[self.phdr_load_re_index.?]; @@ -2152,29 +2150,28 @@ pub fn deleteExport(self: *Elf, exp: Export) void { fn writeProgHeader(self: *Elf, index: usize) !void { const foreign_endian = self.base.options.target.cpu.arch.endian() != std.Target.current.cpu.arch.endian(); const offset = self.program_headers.items[index].p_offset; - switch (self.base.options.target.cpu.arch.ptrBitWidth()) { - 32 => { + switch (self.ptr_width) { + .p32 => { var phdr = [1]elf.Elf32_Phdr{progHeaderTo32(self.program_headers.items[index])}; if (foreign_endian) { bswapAllFields(elf.Elf32_Phdr, &phdr[0]); } return self.base.file.?.pwriteAll(mem.sliceAsBytes(&phdr), offset); }, - 64 => { + .p64 => { var phdr = [1]elf.Elf64_Phdr{self.program_headers.items[index]}; if (foreign_endian) { bswapAllFields(elf.Elf64_Phdr, &phdr[0]); } return self.base.file.?.pwriteAll(mem.sliceAsBytes(&phdr), offset); }, - else => return error.UnsupportedArchitecture, } } fn writeSectHeader(self: *Elf, index: usize) !void { const foreign_endian = self.base.options.target.cpu.arch.endian() != std.Target.current.cpu.arch.endian(); - switch (self.base.options.target.cpu.arch.ptrBitWidth()) { - 32 => { + switch (self.ptr_width) { + .p32 => { var shdr: [1]elf.Elf32_Shdr = undefined; shdr[0] = sectHeaderTo32(self.sections.items[index]); if (foreign_endian) { @@ -2183,7 +2180,7 @@ fn writeSectHeader(self: *Elf, index: usize) !void { const offset = self.shdr_table_offset.? + index * @sizeOf(elf.Elf32_Shdr); return self.base.file.?.pwriteAll(mem.sliceAsBytes(&shdr), offset); }, - 64 => { + .p64 => { var shdr = [1]elf.Elf64_Shdr{self.sections.items[index]}; if (foreign_endian) { bswapAllFields(elf.Elf64_Shdr, &shdr[0]); @@ -2191,14 +2188,13 @@ fn writeSectHeader(self: *Elf, index: usize) !void { const offset = self.shdr_table_offset.? + index * @sizeOf(elf.Elf64_Shdr); return self.base.file.?.pwriteAll(mem.sliceAsBytes(&shdr), offset); }, - else => return error.UnsupportedArchitecture, } } fn writeOffsetTableEntry(self: *Elf, index: usize) !void { const shdr = &self.sections.items[self.got_section_index.?]; const phdr = &self.program_headers.items[self.phdr_got_index.?]; - const entry_size: u16 = self.base.options.target.cpu.arch.ptrBitWidth() / 8; + const entry_size: u16 = self.archPtrWidthBytes(); if (self.offset_table_count_dirty) { // TODO Also detect virtual address collisions. const allocated_size = self.allocatedSize(shdr.sh_offset); @@ -2351,6 +2347,7 @@ fn writeAllGlobalSymbols(self: *Elf) !void { } } +/// Always 4 or 8 depending on whether this is 32-bit ELF or 64-bit ELF. fn ptrWidthBytes(self: Elf) u8 { return switch (self.ptr_width) { .p32 => 4, @@ -2358,6 +2355,12 @@ fn ptrWidthBytes(self: Elf) u8 { }; } +/// Does not necessarily match `ptrWidthBytes` for example can be 2 bytes +/// in a 32-bit ELF file. +fn archPtrWidthBytes(self: Elf) u8 { + return @intCast(u8, self.base.options.target.cpu.arch.ptrBitWidth() / 8); +} + /// The reloc offset for the virtual address of a function in its Line Number Program. /// Size is a virtual address integer. const dbg_line_vaddr_reloc_index = 3; diff --git a/src-self-hosted/test.zig b/src-self-hosted/test.zig index 3f02d78b9b..f9c9121817 100644 --- a/src-self-hosted/test.zig +++ b/src-self-hosted/test.zig @@ -571,95 +571,6 @@ pub const TestContext = struct { std.debug.assert(!case.cbe); update_node.estimated_total_items = 4; - if (case.target.cpu_arch) |arch| { - if (arch == .spu_2) { - if (case.target.os_tag) |os| { - if (os != .freestanding) { - std.debug.panic("Only freestanding makes sense for SPU-II tests!", .{}); - } - } else { - std.debug.panic("SPU_2 has no native OS, check the test!", .{}); - } - - var interpreter = std.spu.interpreter(struct { - RAM: [0x10000]u8 = undefined, - - pub fn read8(bus: @This(), addr: u16) u8 { - return bus.RAM[addr]; - } - pub fn read16(bus: @This(), addr: u16) u16 { - return std.mem.readIntLittle(u16, bus.RAM[addr..][0..2]); - } - - pub fn write8(bus: *@This(), addr: u16, val: u8) void { - bus.RAM[addr] = val; - } - - pub fn write16(bus: *@This(), addr: u16, val: u16) void { - std.mem.writeIntLittle(u16, bus.RAM[addr..][0..2], val); - } - }){ - .bus = .{}, - }; - - { - var load_node = update_node.start("load", null); - load_node.activate(); - defer load_node.end(); - - var file = try tmp.dir.openFile(bin_name, .{ .read = true }); - defer file.close(); - - const header = try std.elf.readHeader(file); - var iterator = header.program_header_iterator(file); - - var none_loaded = true; - - while (try iterator.next()) |phdr| { - if (phdr.p_type != std.elf.PT_LOAD) { - std.debug.print("Encountered unexpected ELF program header: type {}\n", .{phdr.p_type}); - std.process.exit(1); - } - if (phdr.p_paddr != phdr.p_vaddr) { - std.debug.print("Physical address does not match virtual address in ELF header!\n", .{}); - std.process.exit(1); - } - if (phdr.p_filesz != phdr.p_memsz) { - std.debug.print("Physical size does not match virtual size in ELF header!\n", .{}); - std.process.exit(1); - } - if ((try file.pread(interpreter.bus.RAM[phdr.p_paddr .. phdr.p_paddr + phdr.p_filesz], phdr.p_offset)) != phdr.p_filesz) { - std.debug.print("Read less than expected from ELF file!", .{}); - std.process.exit(1); - } - std.log.scoped(.spu2_test).debug("Loaded 0x{x} bytes to 0x{x:0<4}\n", .{ phdr.p_filesz, phdr.p_paddr }); - none_loaded = false; - } - if (none_loaded) { - std.debug.print("No data found in ELF file!\n", .{}); - std.process.exit(1); - } - } - - var exec_node = update_node.start("execute", null); - exec_node.activate(); - defer exec_node.end(); - - var blocks: u16 = 1000; - const block_size = 1000; - while (!interpreter.undefined0) { - const pre_ip = interpreter.ip; - if (blocks > 0) { - blocks -= 1; - try interpreter.ExecuteBlock(block_size); - if (pre_ip == interpreter.ip) { - std.debug.print("Infinite loop detected in SPU II test!\n", .{}); - std.process.exit(1); - } - } - } - } - } var exec_result = x: { var exec_node = update_node.start("execute", null); exec_node.activate(); @@ -672,7 +583,10 @@ pub const TestContext = struct { switch (case.target.getExternalExecutor()) { .native => try argv.append(exe_path), - .unavailable => return, // No executor available; pass test. + .unavailable => { + try self.runInterpreterIfAvailable(allocator, &exec_node, case, tmp.dir, bin_name); + return; // Pass test. + }, .qemu => |qemu_bin_name| if (enable_qemu) { // TODO Ability for test cases to specify whether to link libc. @@ -745,4 +659,115 @@ pub const TestContext = struct { } } } + + fn runInterpreterIfAvailable( + self: *TestContext, + gpa: *Allocator, + node: *std.Progress.Node, + case: Case, + tmp_dir: std.fs.Dir, + bin_name: []const u8, + ) !void { + const arch = case.target.cpu_arch orelse return; + switch (arch) { + .spu_2 => return self.runSpu2Interpreter(gpa, node, case, tmp_dir, bin_name), + else => return, + } + } + + fn runSpu2Interpreter( + self: *TestContext, + gpa: *Allocator, + update_node: *std.Progress.Node, + case: Case, + tmp_dir: std.fs.Dir, + bin_name: []const u8, + ) !void { + const spu = @import("codegen/spu-mk2.zig"); + if (case.target.os_tag) |os| { + if (os != .freestanding) { + std.debug.panic("Only freestanding makes sense for SPU-II tests!", .{}); + } + } else { + std.debug.panic("SPU_2 has no native OS, check the test!", .{}); + } + + var interpreter = spu.Interpreter(struct { + RAM: [0x10000]u8 = undefined, + + pub fn read8(bus: @This(), addr: u16) u8 { + return bus.RAM[addr]; + } + pub fn read16(bus: @This(), addr: u16) u16 { + return std.mem.readIntLittle(u16, bus.RAM[addr..][0..2]); + } + + pub fn write8(bus: *@This(), addr: u16, val: u8) void { + bus.RAM[addr] = val; + } + + pub fn write16(bus: *@This(), addr: u16, val: u16) void { + std.mem.writeIntLittle(u16, bus.RAM[addr..][0..2], val); + } + }){ + .bus = .{}, + }; + + { + var load_node = update_node.start("load", null); + load_node.activate(); + defer load_node.end(); + + var file = try tmp_dir.openFile(bin_name, .{ .read = true }); + defer file.close(); + + const header = try std.elf.readHeader(file); + var iterator = header.program_header_iterator(file); + + var none_loaded = true; + + while (try iterator.next()) |phdr| { + if (phdr.p_type != std.elf.PT_LOAD) { + std.debug.print("Encountered unexpected ELF program header: type {}\n", .{phdr.p_type}); + std.process.exit(1); + } + if (phdr.p_paddr != phdr.p_vaddr) { + std.debug.print("Physical address does not match virtual address in ELF header!\n", .{}); + std.process.exit(1); + } + if (phdr.p_filesz != phdr.p_memsz) { + std.debug.print("Physical size does not match virtual size in ELF header!\n", .{}); + std.process.exit(1); + } + if ((try file.pread(interpreter.bus.RAM[phdr.p_paddr .. phdr.p_paddr + phdr.p_filesz], phdr.p_offset)) != phdr.p_filesz) { + std.debug.print("Read less than expected from ELF file!", .{}); + std.process.exit(1); + } + std.log.scoped(.spu2_test).debug("Loaded 0x{x} bytes to 0x{x:0<4}\n", .{ phdr.p_filesz, phdr.p_paddr }); + none_loaded = false; + } + if (none_loaded) { + std.debug.print("No data found in ELF file!\n", .{}); + std.process.exit(1); + } + } + + var exec_node = update_node.start("execute", null); + exec_node.activate(); + defer exec_node.end(); + + var blocks: u16 = 1000; + const block_size = 1000; + while (!interpreter.undefined0) { + const pre_ip = interpreter.ip; + if (blocks > 0) { + blocks -= 1; + try interpreter.ExecuteBlock(block_size); + if (pre_ip == interpreter.ip) { + std.debug.print("Infinite loop detected in SPU II test!\n", .{}); + std.process.exit(1); + } + } + } + } }; diff --git a/test/stage2/test.zig b/test/stage2/test.zig index 832d9a44db..627cfc7fe0 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -26,6 +26,8 @@ const wasi = std.zig.CrossTarget{ pub fn addCases(ctx: *TestContext) !void { try @import("zir.zig").addCases(ctx); try @import("cbe.zig").addCases(ctx); + try @import("spu-ii.zig").addCases(ctx); + { var case = ctx.exe("hello world with updates", linux_x64); @@ -785,5 +787,4 @@ pub fn addCases(ctx: *TestContext) !void { \\} \\extern var foo; , &[_][]const u8{":4:1: error: unable to infer variable type"}); - try @import("spu-ii.zig").addCases(ctx); } From c61ea4cdb7db3aa8bfb18ebd27a58ae347f731c0 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 22 Aug 2020 15:52:37 +0200 Subject: [PATCH 29/55] update glibc headers to 2.32 --- .../include/aarch64-linux-gnu/bits/hwcap.h | 21 +- .../aarch64-linux-gnu/bits/long-double.h | 2 +- .../aarch64-linux-gnu/bits/typesizes.h | 38 +- .../aarch64-linux-gnu/gnu/lib-names-lp64.h | 2 - .../aarch64-linux-gnu/gnu/stubs-lp64.h | 5 +- .../include/aarch64_be-linux-gnu/bits/hwcap.h | 21 +- .../aarch64_be-linux-gnu/bits/long-double.h | 2 +- .../aarch64_be-linux-gnu/bits/typesizes.h | 38 +- .../gnu/lib-names-lp64_be.h | 2 - .../aarch64_be-linux-gnu/gnu/stubs-lp64_be.h | 5 +- .../arm-linux-gnueabi/bits/long-double.h | 15 +- .../arm-linux-gnueabi/bits/semaphore.h | 13 +- .../arm-linux-gnueabihf/bits/long-double.h | 15 +- .../arm-linux-gnueabihf/bits/semaphore.h | 13 +- .../armeb-linux-gnueabi/bits/long-double.h | 15 +- .../armeb-linux-gnueabi/bits/semaphore.h | 13 +- .../armeb-linux-gnueabihf/bits/long-double.h | 15 +- .../armeb-linux-gnueabihf/bits/semaphore.h | 13 +- lib/libc/include/generic-glibc/argp.h | 3 +- lib/libc/include/generic-glibc/bits/a.out.h | 6 +- .../include/generic-glibc/bits/endianness.h | 9 +- .../include/generic-glibc/bits/environments.h | 64 ++- lib/libc/include/generic-glibc/bits/epoll.h | 4 +- .../include/generic-glibc/bits/fcntl-linux.h | 3 +- lib/libc/include/generic-glibc/bits/fcntl.h | 65 +-- lib/libc/include/generic-glibc/bits/fenv.h | 109 ++-- .../include/generic-glibc/bits/fenvinline.h | 8 - lib/libc/include/generic-glibc/bits/floatn.h | 62 ++- .../generic-glibc/bits/flt-eval-method.h | 17 +- lib/libc/include/generic-glibc/bits/fp-logb.h | 10 +- .../generic-glibc/bits/indirect-return.h | 20 +- .../include/generic-glibc/bits/ipctypes.h | 19 +- .../include/generic-glibc/bits/iscanonical.h | 40 +- lib/libc/include/generic-glibc/bits/link.h | 208 +++++--- .../include/generic-glibc/bits/long-double.h | 11 +- .../include/generic-glibc/bits/math-vector.h | 46 +- .../bits/mathcalls-helper-functions.h | 18 +- .../include/generic-glibc/bits/mathcalls.h | 9 +- .../include/generic-glibc/bits/mathinline.h | 12 - .../include/generic-glibc/bits/mman-shared.h | 1 + lib/libc/include/generic-glibc/bits/mman.h | 18 +- lib/libc/include/generic-glibc/bits/msq-pad.h | 31 -- lib/libc/include/generic-glibc/bits/msq.h | 39 +- .../include/generic-glibc/bits/procfs-id.h | 9 +- lib/libc/include/generic-glibc/bits/procfs.h | 37 +- .../generic-glibc/bits/pthreadtypes-arch.h | 46 +- .../include/generic-glibc/bits/resource.h | 2 +- lib/libc/include/generic-glibc/bits/sem-pad.h | 33 -- lib/libc/include/generic-glibc/bits/sem.h | 26 +- .../include/generic-glibc/bits/semaphore.h | 9 +- lib/libc/include/generic-glibc/bits/setjmp.h | 65 +-- lib/libc/include/generic-glibc/bits/shm-pad.h | 37 -- lib/libc/include/generic-glibc/bits/shm.h | 35 +- .../include/generic-glibc/bits/sigcontext.h | 181 ++++++- .../include/generic-glibc/bits/siginfo-arch.h | 14 +- .../generic-glibc/bits/signum-generic.h | 27 +- lib/libc/include/generic-glibc/bits/signum.h | 58 -- .../generic-glibc/bits/socket-constants.h | 16 +- lib/libc/include/generic-glibc/bits/stat.h | 299 +++++------ .../generic-glibc/bits/statx-generic.h | 1 + .../include/generic-glibc/bits/stdio-ldbl.h | 46 +- lib/libc/include/generic-glibc/bits/stdio2.h | 25 +- .../include/generic-glibc/bits/stdlib-ldbl.h | 22 + lib/libc/include/generic-glibc/bits/stdlib.h | 17 +- .../generic-glibc/bits/string_fortified.h | 5 +- .../include/generic-glibc/bits/struct_mutex.h | 57 +- .../generic-glibc/bits/struct_rwlock.h | 38 +- .../include/generic-glibc/bits/sys_errlist.h | 32 -- lib/libc/include/generic-glibc/bits/syscall.h | 24 +- lib/libc/include/generic-glibc/bits/sysctl.h | 1 - .../include/generic-glibc/bits/syslog-ldbl.h | 4 +- .../generic-glibc/bits/thread-shared-types.h | 10 + .../include/generic-glibc/bits/timesize.h | 13 +- lib/libc/include/generic-glibc/bits/types.h | 1 + .../include/generic-glibc/bits/typesizes.h | 66 ++- lib/libc/include/generic-glibc/bits/unistd.h | 58 +- .../include/generic-glibc/bits/wchar-ldbl.h | 36 +- .../include/generic-glibc/bits/wordsize.h | 38 +- lib/libc/include/generic-glibc/complex.h | 29 +- lib/libc/include/generic-glibc/elf.h | 80 ++- lib/libc/include/generic-glibc/err.h | 3 +- lib/libc/include/generic-glibc/error.h | 6 +- lib/libc/include/generic-glibc/features.h | 2 +- lib/libc/include/generic-glibc/fenv.h | 4 - .../finclude/math-vector-fortran.h | 26 +- lib/libc/include/generic-glibc/fpu_control.h | 161 +++--- .../include/generic-glibc/gnu/lib-names-32.h | 2 - .../generic-glibc/gnu/lib-names-hard.h | 2 - .../generic-glibc/gnu/lib-names-n32_hard.h | 2 - .../generic-glibc/gnu/lib-names-n64_hard.h | 2 - .../generic-glibc/gnu/lib-names-o32_hard.h | 2 - .../generic-glibc/gnu/lib-names-soft.h | 2 - .../include/generic-glibc/gnu/lib-names.h | 41 +- lib/libc/include/generic-glibc/gnu/stubs-32.h | 2 - lib/libc/include/generic-glibc/gnu/stubs-64.h | 18 - .../include/generic-glibc/gnu/stubs-hard.h | 2 - .../generic-glibc/gnu/stubs-n32_hard.h | 2 - .../generic-glibc/gnu/stubs-n64_hard.h | 2 - .../generic-glibc/gnu/stubs-o32_hard.h | 2 - .../include/generic-glibc/gnu/stubs-soft.h | 2 - lib/libc/include/generic-glibc/gnu/stubs.h | 40 +- lib/libc/include/generic-glibc/inttypes.h | 48 +- lib/libc/include/generic-glibc/malloc.h | 7 +- lib/libc/include/generic-glibc/math.h | 88 +++- lib/libc/include/generic-glibc/monetary.h | 3 +- .../include/generic-glibc/netinet/icmp6.h | 8 +- lib/libc/include/generic-glibc/netinet/in.h | 4 + lib/libc/include/generic-glibc/nss.h | 203 ++++++- lib/libc/include/generic-glibc/printf.h | 3 +- lib/libc/include/generic-glibc/pthread.h | 15 + lib/libc/include/generic-glibc/signal.h | 31 +- lib/libc/include/generic-glibc/stdio.h | 27 +- lib/libc/include/generic-glibc/stdlib.h | 15 +- lib/libc/include/generic-glibc/string.h | 48 +- lib/libc/include/generic-glibc/sys/asm.h | 497 ------------------ lib/libc/include/generic-glibc/sys/cachectl.h | 41 -- lib/libc/include/generic-glibc/sys/cdefs.h | 49 +- lib/libc/include/generic-glibc/sys/elf.h | 14 +- lib/libc/include/generic-glibc/sys/ptrace.h | 46 +- lib/libc/include/generic-glibc/sys/random.h | 1 + lib/libc/include/generic-glibc/sys/sysctl.h | 76 --- lib/libc/include/generic-glibc/sys/syslog.h | 4 +- lib/libc/include/generic-glibc/sys/ucontext.h | 286 +++++++--- lib/libc/include/generic-glibc/sys/user.h | 322 +++++------- lib/libc/include/generic-glibc/threads.h | 13 +- lib/libc/include/generic-glibc/unistd.h | 65 ++- lib/libc/include/generic-glibc/wchar.h | 14 +- lib/libc/include/i386-linux-gnu/bits/fenv.h | 54 -- .../include/i386-linux-gnu/bits/long-double.h | 2 +- lib/libc/include/i386-linux-gnu/bits/select.h | 42 +- .../include/i386-linux-gnu/bits/sem-pad.h | 24 - .../include/i386-linux-gnu/bits/semaphore.h | 5 +- lib/libc/include/i386-linux-gnu/bits/sysctl.h | 20 - .../include/i386-linux-gnu/bits/typesizes.h | 6 + .../include/mips-linux-gnu/bits/msq-pad.h | 31 -- .../include/mips-linux-gnu/bits/resource.h | 2 +- .../include/mips-linux-gnu/bits/sem-pad.h | 24 - .../include/mips-linux-gnu/bits/shm-pad.h | 26 - lib/libc/include/mips-linux-gnu/bits/signum.h | 68 --- .../mips64-linux-gnuabi64/bits/msq-pad.h | 31 -- .../mips64-linux-gnuabi64/bits/resource.h | 2 +- .../mips64-linux-gnuabi64/bits/sem-pad.h | 24 - .../mips64-linux-gnuabi64/bits/shm-pad.h | 26 - .../mips64-linux-gnuabi64/bits/signum.h | 68 --- .../mips64-linux-gnuabin32/bits/msq-pad.h | 31 -- .../mips64-linux-gnuabin32/bits/resource.h | 2 +- .../mips64-linux-gnuabin32/bits/sem-pad.h | 24 - .../mips64-linux-gnuabin32/bits/shm-pad.h | 26 - .../mips64-linux-gnuabin32/bits/signum.h | 68 --- .../mips64el-linux-gnuabi64/bits/msq-pad.h | 31 -- .../mips64el-linux-gnuabi64/bits/resource.h | 2 +- .../mips64el-linux-gnuabi64/bits/sem-pad.h | 24 - .../mips64el-linux-gnuabi64/bits/shm-pad.h | 26 - .../mips64el-linux-gnuabi64/bits/signum.h | 68 --- .../mips64el-linux-gnuabin32/bits/msq-pad.h | 31 -- .../mips64el-linux-gnuabin32/bits/resource.h | 2 +- .../mips64el-linux-gnuabin32/bits/sem-pad.h | 24 - .../mips64el-linux-gnuabin32/bits/shm-pad.h | 26 - .../mips64el-linux-gnuabin32/bits/signum.h | 68 --- .../include/mipsel-linux-gnu/bits/msq-pad.h | 31 -- .../include/mipsel-linux-gnu/bits/resource.h | 2 +- .../include/mipsel-linux-gnu/bits/sem-pad.h | 24 - .../include/mipsel-linux-gnu/bits/shm-pad.h | 26 - .../include/mipsel-linux-gnu/bits/signum.h | 68 --- .../powerpc-linux-gnu/bits/fenvinline.h | 102 ---- .../include/powerpc-linux-gnu/bits/hwcap.h | 4 +- .../powerpc-linux-gnu/bits/iscanonical.h | 2 +- .../powerpc-linux-gnu/bits/long-double.h | 2 +- .../include/powerpc-linux-gnu/bits/msq-pad.h | 26 - .../include/powerpc-linux-gnu/bits/sem-pad.h | 26 - .../powerpc-linux-gnu/bits/semaphore.h | 5 +- .../include/powerpc-linux-gnu/bits/shm-pad.h | 28 - .../powerpc-linux-gnu/gnu/lib-names-32.h | 2 - lib/libc/include/powerpc-linux-gnu/ieee754.h | 68 ++- .../powerpc64-linux-gnu/bits/fenvinline.h | 102 ---- .../include/powerpc64-linux-gnu/bits/hwcap.h | 4 +- .../powerpc64-linux-gnu/bits/iscanonical.h | 2 +- .../powerpc64-linux-gnu/bits/long-double.h | 2 +- .../powerpc64-linux-gnu/bits/msq-pad.h | 26 - .../powerpc64-linux-gnu/bits/sem-pad.h | 26 - .../powerpc64-linux-gnu/bits/semaphore.h | 5 +- .../powerpc64-linux-gnu/bits/shm-pad.h | 28 - .../powerpc64-linux-gnu/gnu/lib-names-64-v1.h | 2 - .../powerpc64-linux-gnu/gnu/stubs-64-v1.h | 2 - .../include/powerpc64-linux-gnu/ieee754.h | 68 ++- .../powerpc64le-linux-gnu/bits/fenvinline.h | 102 ---- .../powerpc64le-linux-gnu/bits/hwcap.h | 4 +- .../powerpc64le-linux-gnu/bits/iscanonical.h | 2 +- .../powerpc64le-linux-gnu/bits/long-double.h | 5 +- .../powerpc64le-linux-gnu/bits/msq-pad.h | 26 - .../powerpc64le-linux-gnu/bits/sem-pad.h | 26 - .../powerpc64le-linux-gnu/bits/semaphore.h | 5 +- .../powerpc64le-linux-gnu/bits/shm-pad.h | 28 - .../gnu/lib-names-64-v2.h | 2 - .../powerpc64le-linux-gnu/gnu/stubs-64-v2.h | 2 - .../include/powerpc64le-linux-gnu/ieee754.h | 68 ++- .../riscv64-linux-gnu/bits/long-double.h | 2 +- .../riscv64-linux-gnu/bits/semaphore.h | 14 +- .../riscv64-linux-gnu/bits/typesizes.h | 38 +- .../riscv64-linux-gnu/gnu/lib-names-lp64.h | 2 - .../riscv64-linux-gnu/gnu/stubs-lp64.h | 5 +- lib/libc/include/s390x-linux-gnu/bits/fenv.h | 4 +- .../s390x-linux-gnu/bits/long-double.h | 2 +- .../include/s390x-linux-gnu/bits/semaphore.h | 4 +- .../include/s390x-linux-gnu/bits/typesizes.h | 7 + .../s390x-linux-gnu/gnu/lib-names-64.h | 2 - lib/libc/include/sparc-linux-gnu/bits/fenv.h | 9 - .../sparc-linux-gnu/bits/long-double.h | 2 +- .../include/sparc-linux-gnu/bits/msq-pad.h | 26 - .../include/sparc-linux-gnu/bits/resource.h | 2 +- .../include/sparc-linux-gnu/bits/sem-pad.h | 26 - .../include/sparc-linux-gnu/bits/semaphore.h | 5 +- .../include/sparc-linux-gnu/bits/shm-pad.h | 28 - .../include/sparc-linux-gnu/bits/signum.h | 39 -- .../include/sparc-linux-gnu/bits/typesizes.h | 7 + .../sparc-linux-gnu/gnu/lib-names-64.h | 2 - .../include/sparcv9-linux-gnu/bits/fenv.h | 9 - .../sparcv9-linux-gnu/bits/long-double.h | 2 +- .../include/sparcv9-linux-gnu/bits/msq-pad.h | 26 - .../include/sparcv9-linux-gnu/bits/resource.h | 2 +- .../include/sparcv9-linux-gnu/bits/sem-pad.h | 26 - .../sparcv9-linux-gnu/bits/semaphore.h | 5 +- .../include/sparcv9-linux-gnu/bits/shm-pad.h | 28 - .../include/sparcv9-linux-gnu/bits/signum.h | 39 -- .../sparcv9-linux-gnu/bits/typesizes.h | 7 + lib/libc/include/x86_64-linux-gnu/bits/fenv.h | 54 -- .../x86_64-linux-gnu/bits/long-double.h | 2 +- .../include/x86_64-linux-gnu/bits/select.h | 42 +- .../include/x86_64-linux-gnu/bits/sem-pad.h | 24 - .../include/x86_64-linux-gnu/bits/semaphore.h | 5 +- .../include/x86_64-linux-gnu/bits/sysctl.h | 20 - .../include/x86_64-linux-gnu/bits/typesizes.h | 6 + .../x86_64-linux-gnu/gnu/lib-names-64.h | 2 - .../include/x86_64-linux-gnu/gnu/stubs-64.h | 2 - .../include/x86_64-linux-gnux32/bits/fenv.h | 54 -- .../x86_64-linux-gnux32/bits/long-double.h | 2 +- .../include/x86_64-linux-gnux32/bits/select.h | 42 +- .../x86_64-linux-gnux32/bits/sem-pad.h | 24 - .../x86_64-linux-gnux32/bits/semaphore.h | 5 +- .../include/x86_64-linux-gnux32/bits/sysctl.h | 20 - .../x86_64-linux-gnux32/bits/typesizes.h | 6 + .../x86_64-linux-gnux32/gnu/lib-names-x32.h | 2 - .../x86_64-linux-gnux32/gnu/stubs-x32.h | 2 - 243 files changed, 2791 insertions(+), 4584 deletions(-) delete mode 100644 lib/libc/include/generic-glibc/bits/fenvinline.h delete mode 100644 lib/libc/include/generic-glibc/bits/mathinline.h delete mode 100644 lib/libc/include/generic-glibc/bits/msq-pad.h delete mode 100644 lib/libc/include/generic-glibc/bits/sem-pad.h delete mode 100644 lib/libc/include/generic-glibc/bits/shm-pad.h delete mode 100644 lib/libc/include/generic-glibc/bits/signum.h delete mode 100644 lib/libc/include/generic-glibc/bits/sys_errlist.h delete mode 100644 lib/libc/include/generic-glibc/bits/sysctl.h delete mode 100644 lib/libc/include/generic-glibc/gnu/stubs-64.h delete mode 100644 lib/libc/include/generic-glibc/sys/asm.h delete mode 100644 lib/libc/include/generic-glibc/sys/cachectl.h delete mode 100644 lib/libc/include/generic-glibc/sys/sysctl.h delete mode 100644 lib/libc/include/i386-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/i386-linux-gnu/bits/sysctl.h delete mode 100644 lib/libc/include/mips-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/mips-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/mips-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/mips-linux-gnu/bits/signum.h delete mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h delete mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h delete mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h delete mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/signum.h delete mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h delete mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h delete mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h delete mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/signum.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h delete mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h delete mode 100644 lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/mipsel-linux-gnu/bits/signum.h delete mode 100644 lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h delete mode 100644 lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h delete mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h delete mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/sparc-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/sparc-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/sparc-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/sparc-linux-gnu/bits/signum.h delete mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h delete mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h delete mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/signum.h delete mode 100644 lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h delete mode 100644 lib/libc/include/x86_64-linux-gnu/bits/sysctl.h delete mode 100644 lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h delete mode 100644 lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h diff --git a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h index cf38b9d8b7..9f3cadf056 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h @@ -53,4 +53,23 @@ #define HWCAP_SSBS (1 << 28) #define HWCAP_SB (1 << 29) #define HWCAP_PACA (1 << 30) -#define HWCAP_PACG (1UL << 31) \ No newline at end of file +#define HWCAP_PACG (1UL << 31) + +#define HWCAP2_DCPODP (1 << 0) +#define HWCAP2_SVE2 (1 << 1) +#define HWCAP2_SVEAES (1 << 2) +#define HWCAP2_SVEPMULL (1 << 3) +#define HWCAP2_SVEBITPERM (1 << 4) +#define HWCAP2_SVESHA3 (1 << 5) +#define HWCAP2_SVESM4 (1 << 6) +#define HWCAP2_FLAGM2 (1 << 7) +#define HWCAP2_FRINT (1 << 8) +#define HWCAP2_SVEI8MM (1 << 9) +#define HWCAP2_SVEF32MM (1 << 10) +#define HWCAP2_SVEF64MM (1 << 11) +#define HWCAP2_SVEBF16 (1 << 12) +#define HWCAP2_I8MM (1 << 13) +#define HWCAP2_BF16 (1 << 14) +#define HWCAP2_DGH (1 << 15) +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h index ce06962796..f95b24f8e7 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h b/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h index d9e9b274ac..a5f4c78b94 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h @@ -26,31 +26,45 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -76,11 +90,17 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h index f1923e9517..d25085e24f 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h index 342cde4c98..4c2911dd6d 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h @@ -15,10 +15,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk -#define __stub_stty -#define __stub_sysctl \ No newline at end of file +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h index cf38b9d8b7..9f3cadf056 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h @@ -53,4 +53,23 @@ #define HWCAP_SSBS (1 << 28) #define HWCAP_SB (1 << 29) #define HWCAP_PACA (1 << 30) -#define HWCAP_PACG (1UL << 31) \ No newline at end of file +#define HWCAP_PACG (1UL << 31) + +#define HWCAP2_DCPODP (1 << 0) +#define HWCAP2_SVE2 (1 << 1) +#define HWCAP2_SVEAES (1 << 2) +#define HWCAP2_SVEPMULL (1 << 3) +#define HWCAP2_SVEBITPERM (1 << 4) +#define HWCAP2_SVESHA3 (1 << 5) +#define HWCAP2_SVESM4 (1 << 6) +#define HWCAP2_FLAGM2 (1 << 7) +#define HWCAP2_FRINT (1 << 8) +#define HWCAP2_SVEI8MM (1 << 9) +#define HWCAP2_SVEF32MM (1 << 10) +#define HWCAP2_SVEF64MM (1 << 11) +#define HWCAP2_SVEBF16 (1 << 12) +#define HWCAP2_I8MM (1 << 13) +#define HWCAP2_BF16 (1 << 14) +#define HWCAP2_DGH (1 << 15) +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h index ce06962796..f95b24f8e7 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h b/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h index d9e9b274ac..a5f4c78b94 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h @@ -26,31 +26,45 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -76,11 +90,17 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h b/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h index f5cf894313..fb1dd8a26c 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h +++ b/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h b/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h index 342cde4c98..4c2911dd6d 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h +++ b/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h @@ -15,10 +15,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk -#define __stub_stty -#define __stub_sysctl \ No newline at end of file +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/long-double.h b/lib/libc/include/arm-linux-gnueabi/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/long-double.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h b/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h b/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h b/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h b/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h b/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h b/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h b/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/generic-glibc/argp.h b/lib/libc/include/generic-glibc/argp.h index 0bb8d732f5..8101648163 100644 --- a/lib/libc/include/generic-glibc/argp.h +++ b/lib/libc/include/generic-glibc/argp.h @@ -554,7 +554,8 @@ __NTH (__option_is_end (const struct argp_option *__opt)) # endif #endif /* Use extern inlines. */ -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/bits/a.out.h b/lib/libc/include/generic-glibc/bits/a.out.h index c075e94124..3c81a52dbb 100644 --- a/lib/libc/include/generic-glibc/bits/a.out.h +++ b/lib/libc/include/generic-glibc/bits/a.out.h @@ -2,6 +2,10 @@ # error "Never use directly; include instead." #endif +#ifdef __x86_64__ + /* Signal to users of this header that this architecture really doesn't support a.out binary format. */ -#define __NO_A_OUT_SUPPORT 1 \ No newline at end of file +#define __NO_A_OUT_SUPPORT 1 + +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/endianness.h b/lib/libc/include/generic-glibc/bits/endianness.h index 5a0a871460..80180b782e 100644 --- a/lib/libc/include/generic-glibc/bits/endianness.h +++ b/lib/libc/include/generic-glibc/bits/endianness.h @@ -5,12 +5,7 @@ # error "Never use directly; include instead." #endif -/* MIPS has selectable endianness. */ -#ifdef __MIPSEB -# define __BYTE_ORDER __BIG_ENDIAN -#endif -#ifdef __MIPSEL -# define __BYTE_ORDER __LITTLE_ENDIAN -#endif +/* i386/x86_64 are little-endian. */ +#define __BYTE_ORDER __LITTLE_ENDIAN #endif /* bits/endianness.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/environments.h b/lib/libc/include/generic-glibc/bits/environments.h index 1b5e74a08e..2b18837e58 100644 --- a/lib/libc/include/generic-glibc/bits/environments.h +++ b/lib/libc/include/generic-glibc/bits/environments.h @@ -41,13 +41,16 @@ #if __WORDSIZE == 64 -/* We can never provide environments with 32-bit wide pointers. */ -# define _POSIX_V7_ILP32_OFF32 -1 -# define _POSIX_V7_ILP32_OFFBIG -1 -# define _POSIX_V6_ILP32_OFF32 -1 -# define _POSIX_V6_ILP32_OFFBIG -1 -# define _XBS5_ILP32_OFF32 -1 -# define _XBS5_ILP32_OFFBIG -1 +/* Environments with 32-bit wide pointers are optionally provided. + Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG + # undef _POSIX_V6_ILP32_OFF32 + # undef _POSIX_V6_ILP32_OFFBIG + # undef _XBS5_ILP32_OFF32 + # undef _XBS5_ILP32_OFFBIG + and users need to check at runtime. */ + /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 @@ -61,27 +64,42 @@ #else /* __WORDSIZE == 32 */ -/* By default we have 32-bit wide `int', `long int', pointers and `off_t' - and all platforms support LFS. */ -# define _POSIX_V7_ILP32_OFF32 1 +/* We have 32-bit wide `int', `long int' and pointers and all platforms + support LFS. -mx32 has 64-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFFBIG 1 -# define _POSIX_V6_ILP32_OFF32 1 -# define _POSIX_V6_ILP32_OFFBIG 1 -# define _XBS5_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFFBIG 1 +# ifndef __x86_64__ +/* -m32 has 32-bit wide `off_t'. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFF32 1 +# define _XBS5_ILP32_OFF32 1 +# endif + /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ -/* We can never provide environments with 64-bit wide pointers. */ -# define _POSIX_V7_LP64_OFF64 -1 -# define _POSIX_V7_LPBIG_OFFBIG -1 -# define _POSIX_V6_LP64_OFF64 -1 -# define _POSIX_V6_LPBIG_OFFBIG -1 -# define _XBS5_LP64_OFF64 -1 -# define _XBS5_LPBIG_OFFBIG -1 +/* Environments with 64-bit wide pointers can be provided, + so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG + # undef _POSIX_V6_LP64_OFF64 + # undef _POSIX_V6_LPBIG_OFFBIG + # undef _XBS5_LP64_OFF64 + # undef _XBS5_LPBIG_OFFBIG + and sysconf tests for it at runtime. */ -/* CFLAGS. */ -#define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +#endif /* __WORDSIZE == 32 */ -#endif /* __WORDSIZE == 32 */ \ No newline at end of file +#define __ILP32_OFF32_CFLAGS "-m32" +#define __ILP32_OFF32_LDFLAGS "-m32" +#if defined __x86_64__ && defined __ILP32__ +# define __ILP32_OFFBIG_CFLAGS "-mx32" +# define __ILP32_OFFBIG_LDFLAGS "-mx32" +#else +# define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +# define __ILP32_OFFBIG_LDFLAGS "-m32" +#endif +#define __LP64_OFF64_CFLAGS "-m64" +#define __LP64_OFF64_LDFLAGS "-m64" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/epoll.h b/lib/libc/include/generic-glibc/bits/epoll.h index 6d92d7ce11..5f23749272 100644 --- a/lib/libc/include/generic-glibc/bits/epoll.h +++ b/lib/libc/include/generic-glibc/bits/epoll.h @@ -24,4 +24,6 @@ enum { EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC - }; \ No newline at end of file + }; + +#define __EPOLL_PACKED __attribute__ ((__packed__)) \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fcntl-linux.h b/lib/libc/include/generic-glibc/bits/fcntl-linux.h index 4e3813d8c4..14d7e72f01 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl-linux.h +++ b/lib/libc/include/generic-glibc/bits/fcntl-linux.h @@ -290,7 +290,8 @@ struct f_owner_ex #ifdef __USE_GNU /* Hint values for F_{GET,SET}_RW_HINT. */ -# define RWF_WRITE_LIFE_NOT_SET 0 +# define RWH_WRITE_LIFE_NOT_SET 0 +# define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET # define RWH_WRITE_LIFE_NONE 1 # define RWH_WRITE_LIFE_SHORT 2 # define RWH_WRITE_LIFE_MEDIUM 3 diff --git a/lib/libc/include/generic-glibc/bits/fcntl.h b/lib/libc/include/generic-glibc/bits/fcntl.h index b9fa29e200..4eb8fa0b6f 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl.h +++ b/lib/libc/include/generic-glibc/bits/fcntl.h @@ -1,5 +1,5 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* O_*, F_*, FD_* bit values for Linux/x86. + Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,56 +13,24 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -#ifndef _FCNTL_H +#ifndef _FCNTL_H # error "Never use directly; include instead." #endif -#include - -#define O_APPEND 0x0008 -#define O_SYNC 0x4010 -#define O_NONBLOCK 0x0080 -#define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ -#define O_EXCL 0x0400 /* not fcntl */ -#define O_NOCTTY 0x0800 /* not fcntl */ -#define O_ASYNC 0x1000 - -#define __O_DIRECT 0x8000 /* Direct disk access hint. */ -#define __O_DSYNC 0x0010 /* Synchronize data. */ - -#if _MIPS_SIM == _ABI64 -/* Not necessary, files are always with 64bit off_t. */ -# define __O_LARGEFILE 0 -#else -# define __O_LARGEFILE 0x2000 /* Allow large file opens. */ +#ifdef __x86_64__ +# define __O_LARGEFILE 0 #endif -#ifndef __USE_FILE_OFFSET64 -# define F_GETLK 14 /* Get record locking info. */ -# define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ -#else -# define F_GETLK F_GETLK64 /* Get record locking info. */ -# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ -# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#ifdef __x86_64__ +/* Not necessary, we always have 64-bit offsets. */ +# define F_GETLK64 5 /* Get record locking info. */ +# define F_SETLK64 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 7 /* Set record locking info (blocking). */ #endif -#if _MIPS_SIM != _ABI64 -# define F_GETLK64 33 /* Get record locking info. */ -# define F_SETLK64 34 /* Set record locking info (non-blocking). */ -# define F_SETLKW64 35 /* Set record locking info (blocking). */ -#else -# define F_GETLK64 14 /* Get record locking info. */ -# define F_SETLK64 6 /* Set record locking info (non-blocking).*/ -# define F_SETLKW64 7 /* Set record locking info (blocking). */ -#endif - -#define __F_SETOWN 24 /* Get owner (process receiving SIGIO). */ -#define __F_GETOWN 23 /* Set owner (process receiving SIGIO). */ struct flock { @@ -71,23 +39,12 @@ struct flock #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ -#if _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - fcntls in o32 and n32, never has this field. */ - long int l_sysid; -#endif #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ -#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - flock in o32 and n32, never has this field. */ - long int __glibc_reserved0[4]; -#endif }; -typedef struct flock flock_t; #ifdef __USE_LARGEFILE64 struct flock64 diff --git a/lib/libc/include/generic-glibc/bits/fenv.h b/lib/libc/include/generic-glibc/bits/fenv.h index cdf79211de..b504e27b15 100644 --- a/lib/libc/include/generic-glibc/bits/fenv.h +++ b/lib/libc/include/generic-glibc/bits/fenv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2020 Free Software Foundation, Inc. +/* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,101 +12,104 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _FENV_H # error "Never use directly; include instead." #endif - -#ifdef __mips_hard_float - /* Define bits representing the exception. We use the bit positions of the appropriate bits in the FPU control word. */ enum { - FE_INEXACT = -# define FE_INEXACT 0x04 - FE_INEXACT, - FE_UNDERFLOW = -# define FE_UNDERFLOW 0x08 - FE_UNDERFLOW, - FE_OVERFLOW = -# define FE_OVERFLOW 0x10 - FE_OVERFLOW, - FE_DIVBYZERO = -# define FE_DIVBYZERO 0x20 - FE_DIVBYZERO, FE_INVALID = -# define FE_INVALID 0x40 +#define FE_INVALID 0x01 FE_INVALID, + __FE_DENORM = 0x02, + FE_DIVBYZERO = +#define FE_DIVBYZERO 0x04 + FE_DIVBYZERO, + FE_OVERFLOW = +#define FE_OVERFLOW 0x08 + FE_OVERFLOW, + FE_UNDERFLOW = +#define FE_UNDERFLOW 0x10 + FE_UNDERFLOW, + FE_INEXACT = +#define FE_INEXACT 0x20 + FE_INEXACT }; -# define FE_ALL_EXCEPT \ +#define FE_ALL_EXCEPT \ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) -/* The MIPS FPU supports all of the four defined rounding modes. We +/* The ix87 FPU supports all of the four defined rounding modes. We use again the bit positions in the FPU control word as the values for the appropriate macros. */ enum { FE_TONEAREST = -# define FE_TONEAREST 0x0 +#define FE_TONEAREST 0 FE_TONEAREST, - FE_TOWARDZERO = -# define FE_TOWARDZERO 0x1 - FE_TOWARDZERO, - FE_UPWARD = -# define FE_UPWARD 0x2 - FE_UPWARD, FE_DOWNWARD = -# define FE_DOWNWARD 0x3 - FE_DOWNWARD +#define FE_DOWNWARD 0x400 + FE_DOWNWARD, + FE_UPWARD = +#define FE_UPWARD 0x800 + FE_UPWARD, + FE_TOWARDZERO = +#define FE_TOWARDZERO 0xc00 + FE_TOWARDZERO }; -#else - -/* In the soft-float case, only rounding to nearest is supported, with - no exceptions. */ - -enum - { - __FE_UNDEFINED = -1, - - FE_TONEAREST = -# define FE_TONEAREST 0x0 - FE_TONEAREST - }; - -# define FE_ALL_EXCEPT 0 - -#endif - /* Type representing exception flags. */ typedef unsigned short int fexcept_t; -/* Type representing floating-point environment. This function corresponds - to the layout of the block written by the `fstenv'. */ +/* Type representing floating-point environment. This structure + corresponds to the layout of the block written by the `fstenv' + instruction and has additional fields for the contents of the MXCSR + register as written by the `stmxcsr' instruction. */ typedef struct { - unsigned int __fp_control_register; + unsigned short int __control_word; + unsigned short int __glibc_reserved1; + unsigned short int __status_word; + unsigned short int __glibc_reserved2; + unsigned short int __tags; + unsigned short int __glibc_reserved3; + unsigned int __eip; + unsigned short int __cs_selector; + unsigned int __opcode:11; + unsigned int __glibc_reserved4:5; + unsigned int __data_offset; + unsigned short int __data_selector; + unsigned short int __glibc_reserved5; +#ifdef __x86_64__ + unsigned int __mxcsr; +#endif } fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1) -#if defined __USE_GNU && defined __mips_hard_float +#ifdef __USE_GNU /* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((const fenv_t *) -2) +# define FE_NOMASK_ENV ((const fenv_t *) -2) #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ -typedef unsigned int femode_t; +typedef struct + { + unsigned short int __control_word; + unsigned short int __glibc_reserved; + unsigned int __mxcsr; + } +femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) diff --git a/lib/libc/include/generic-glibc/bits/fenvinline.h b/lib/libc/include/generic-glibc/bits/fenvinline.h deleted file mode 100644 index 1367c80eaf..0000000000 --- a/lib/libc/include/generic-glibc/bits/fenvinline.h +++ /dev/null @@ -1,8 +0,0 @@ -/* This file provides inline versions of floating-pint environment - handling functions. If there were any. */ - -#ifndef __NO_MATH_INLINES - -/* Here is where the code would go. */ - -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/floatn.h b/lib/libc/include/generic-glibc/bits/floatn.h index 68a17ab2c7..36d64c23ec 100644 --- a/lib/libc/include/generic-glibc/bits/floatn.h +++ b/lib/libc/include/generic-glibc/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on MIPS platforms. +/* Macros to control TS 18661-3 glibc features on x86. Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,35 +20,38 @@ #define _BITS_FLOATN_H #include -#include /* Defined to 1 if the current compiler invocation provides a floating-point type with the IEEE 754 binary128 format, and this - glibc includes corresponding *f128 interfaces for it. */ -#ifndef __NO_LONG_DOUBLE_MATH + glibc includes corresponding *f128 interfaces for it. The required + libgcc support was added some time after the basic compiler + support, for x86_64 and x86. */ +#if (defined __x86_64__ \ + ? __GNUC_PREREQ (4, 3) \ + : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) # define __HAVE_FLOAT128 1 #else -/* glibc does not support _Float128 for platforms where long double is - normally binary128 when building with long double as binary64. - GCC's default for supported scalar modes does not support it either - in that case. */ # define __HAVE_FLOAT128 0 #endif /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct from the default float, double and long double types in this glibc. */ -#define __HAVE_DISTINCT_FLOAT128 0 +#if __HAVE_FLOAT128 +# define __HAVE_DISTINCT_FLOAT128 1 +#else +# define __HAVE_DISTINCT_FLOAT128 0 +#endif /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for _Float64x, and this glibc includes corresponding *f64x interfaces for it. */ -#define __HAVE_FLOAT64X __HAVE_FLOAT128 +#define __HAVE_FLOAT64X 1 /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has the format of _Float128, which must be different from that of long double. */ -#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 +#define __HAVE_FLOAT64X_LONG_DOUBLE 1 #ifndef __ASSEMBLER__ @@ -57,7 +60,7 @@ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* The literal suffix f128 exists only since GCC 7.0. */ -# define __f128(x) x##l +# define __f128(x) x##q # else # define __f128(x) x##f128 # endif @@ -66,7 +69,10 @@ /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus -# define __CFLOAT128 _Complex long double +/* Add a typedef for older GCC compilers which don't natively support + _Complex _Float128. */ +typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); +# define __CFLOAT128 __cfloat128 # else # define __CFLOAT128 _Complex _Float128 # endif @@ -77,15 +83,33 @@ /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) || defined __cplusplus -typedef long double _Float128; +typedef __float128 _Float128; # endif -/* Various built-in functions do not exist before GCC 7.0. */ +/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) -# define __builtin_huge_valf128() (__builtin_huge_vall ()) -# define __builtin_inff128() (__builtin_infl ()) -# define __builtin_nanf128(x) (__builtin_nanl (x)) -# define __builtin_nansf128(x) (__builtin_nansl (x)) +# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) +# endif + +/* Older GCC has only a subset of built-in functions for _Float128 on + x86, and __builtin_infq is not usable in static initializers. + Converting a narrower sNaN to _Float128 produces a quiet NaN, so + attempts to use _Float128 sNaNs will not work properly with older + compilers. */ +# if !__GNUC_PREREQ (7, 0) +# define __builtin_copysignf128 __builtin_copysignq +# define __builtin_fabsf128 __builtin_fabsq +# define __builtin_inff128() ((_Float128) __builtin_inf ()) +# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x)) +# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x)) +# endif + +/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, + e.g.: __builtin_signbitf128, before GCC 6. However, there has never + been a __builtin_signbitf128 in GCC and the type-generic builtin is + only available since GCC 6. */ +# if !__GNUC_PREREQ (6, 0) +# define __builtin_signbitf128 __signbitf128 # endif # endif diff --git a/lib/libc/include/generic-glibc/bits/flt-eval-method.h b/lib/libc/include/generic-glibc/bits/flt-eval-method.h index 11297d9c17..9da0307897 100644 --- a/lib/libc/include/generic-glibc/bits/flt-eval-method.h +++ b/lib/libc/include/generic-glibc/bits/flt-eval-method.h @@ -1,4 +1,4 @@ -/* Define __GLIBC_FLT_EVAL_METHOD. +/* Define __GLIBC_FLT_EVAL_METHOD. x86 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,23 +20,14 @@ # error "Never use directly; include instead." #endif -/* __GLIBC_FLT_EVAL_METHOD is the value of FLT_EVAL_METHOD used to - determine the evaluation method typedefs such as float_t and - double_t. It must be a value from C11 or TS 18661-3:2015, and not - -1. */ - -/* In the default version of this header, follow __FLT_EVAL_METHOD__. - -1 is mapped to 2 (considering evaluation as long double to be a - conservatively safe assumption), and if __FLT_EVAL_METHOD__ is not - defined then assume there is no excess precision and use the value - 0. */ - #ifdef __FLT_EVAL_METHOD__ # if __FLT_EVAL_METHOD__ == -1 # define __GLIBC_FLT_EVAL_METHOD 2 # else # define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ # endif -#else +#elif defined __x86_64__ # define __GLIBC_FLT_EVAL_METHOD 0 +#else +# define __GLIBC_FLT_EVAL_METHOD 2 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fp-logb.h b/lib/libc/include/generic-glibc/bits/fp-logb.h index efc488bc27..5f2e2a9f88 100644 --- a/lib/libc/include/generic-glibc/bits/fp-logb.h +++ b/lib/libc/include/generic-glibc/bits/fp-logb.h @@ -1,4 +1,4 @@ -/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. +/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,9 +20,5 @@ # error "Never use directly; include instead." #endif -/* __FP_LOGB0_IS_MIN is defined to 1 if FP_ILOGB0 is INT_MIN, and 0 if - it is -INT_MAX. __FP_LOGBNAN_IS_MIN is defined to 1 if FP_ILOGBNAN - is INT_MIN, and 0 if it is INT_MAX. */ - -#define __FP_LOGB0_IS_MIN 0 -#define __FP_LOGBNAN_IS_MIN 0 \ No newline at end of file +#define __FP_LOGB0_IS_MIN 1 +#define __FP_LOGBNAN_IS_MIN 1 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/indirect-return.h b/lib/libc/include/generic-glibc/bits/indirect-return.h index 5a7beddda9..e74139721c 100644 --- a/lib/libc/include/generic-glibc/bits/indirect-return.h +++ b/lib/libc/include/generic-glibc/bits/indirect-return.h @@ -1,4 +1,4 @@ -/* Definition of __INDIRECT_RETURN. Generic version. +/* Definition of __INDIRECT_RETURN. x86 version. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,6 +20,18 @@ # error "Never include directly; use instead." #endif -/* __INDIRECT_RETURN is used on swapcontext to indicate if it requires - special compiler treatment. */ -#define __INDIRECT_RETURN \ No newline at end of file +/* On x86, swapcontext returns via indirect branch when the shadow stack + is enabled. Define __INDIRECT_RETURN to indicate whether swapcontext + returns via indirect branch. */ +#if defined __CET__ && (__CET__ & 2) != 0 +# if __glibc_has_attribute (__indirect_return__) +# define __INDIRECT_RETURN __attribute__ ((__indirect_return__)) +# else +/* Newer compilers provide the indirect_return attribute, but without + it we can use returns_twice to affect the optimizer in the same + way and avoid unsafe optimizations. */ +# define __INDIRECT_RETURN __attribute__ ((__returns_twice__)) +# endif +#else +# define __INDIRECT_RETURN +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/ipctypes.h b/lib/libc/include/generic-glibc/bits/ipctypes.h index 2fce70dab0..7f6bb7662d 100644 --- a/lib/libc/include/generic-glibc/bits/ipctypes.h +++ b/lib/libc/include/generic-glibc/bits/ipctypes.h @@ -1,5 +1,5 @@ -/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic. - Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. + Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,21 +16,18 @@ License along with the GNU C Library; if not, see . */ -/* - * Never include directly. - */ +#ifndef _SYS_IPC_H +# error "Never use directly; include instead." +#endif #ifndef _BITS_IPCTYPES_H #define _BITS_IPCTYPES_H 1 -#include - /* Used in `struct shmid_ds'. */ -# if __WORDSIZE == 32 -typedef unsigned short int __ipc_pid_t; -# else +# ifdef __x86_64__ typedef int __ipc_pid_t; +# else +typedef unsigned short int __ipc_pid_t; # endif - #endif /* bits/ipctypes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/iscanonical.h b/lib/libc/include/generic-glibc/bits/iscanonical.h index 446a24d01b..ee0d8720f9 100644 --- a/lib/libc/include/generic-glibc/bits/iscanonical.h +++ b/lib/libc/include/generic-glibc/bits/iscanonical.h @@ -1,4 +1,4 @@ -/* Define iscanonical macro. +/* Define iscanonical macro. ldbl-96 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,9 +20,35 @@ # error "Never use directly; include instead." #endif -/* Return nonzero value if X is canonical. By default, we only have - IEEE interchange binary formats, in which all values are canonical, - but the argument must still be converted to its semantic type for - any exceptions arising from the conversion, before being - discarded. */ -#define iscanonical(x) ((void) (__typeof (x)) (x), 1) \ No newline at end of file +extern int __iscanonicall (long double __x) + __THROW __attribute__ ((__const__)); +#define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) +#define __iscanonical(x) ((void) (__typeof (x)) (x), 1) +#if __HAVE_DISTINCT_FLOAT128 +# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) +#endif + +/* Return nonzero value if X is canonical. In IEEE interchange binary + formats, all values are canonical, but the argument must still be + converted to its semantic type for any exceptions arising from the + conversion, before being discarded; in extended precision, there + are encodings that are not consistently handled as corresponding to + any particular value of the type, and we return 0 for those. */ +#ifndef __cplusplus +# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) +#else +/* In C++ mode, __MATH_TG cannot be used, because it relies on + __builtin_types_compatible_p, which is a C-only builtin. On the + other hand, overloading provides the means to distinguish between + the floating-point types. The overloading resolution will match + the correct parameter (regardless of type qualifiers (i.e.: const + and volatile)). */ +extern "C++" { +inline int iscanonical (float __val) { return __iscanonicalf (__val); } +inline int iscanonical (double __val) { return __iscanonical (__val); } +inline int iscanonical (long double __val) { return __iscanonicall (__val); } +# if __HAVE_DISTINCT_FLOAT128 +inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } +# endif +} +#endif /* __cplusplus */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/link.h b/lib/libc/include/generic-glibc/bits/link.h index 9fc3255bf9..68938e8e0c 100644 --- a/lib/libc/include/generic-glibc/bits/link.h +++ b/lib/libc/include/generic-glibc/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2020 Free Software Foundation, Inc. +/* Copyright (C) 2004-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,106 +12,148 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _LINK_H # error "Never include directly; use instead." #endif -#include -#if _MIPS_SIM == _ABIO32 - -/* Registers for entry into PLT on MIPS. */ -typedef struct La_mips_32_regs +#ifndef __x86_64__ +/* Registers for entry into PLT on IA-32. */ +typedef struct La_i86_regs { - uint32_t lr_reg[4]; /* $a0 through $a3 */ - double lr_fpreg[2]; /* $f12 and $f14 */ - uint32_t lr_ra; - uint32_t lr_sp; -} La_mips_32_regs; + uint32_t lr_edx; + uint32_t lr_ecx; + uint32_t lr_eax; + uint32_t lr_ebp; + uint32_t lr_esp; +} La_i86_regs; -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_32_retval +/* Return values for calls from PLT on IA-32. */ +typedef struct La_i86_retval { - uint32_t lrv_v0; - uint32_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_32_retval; + uint32_t lrv_eax; + uint32_t lrv_edx; + long double lrv_st0; + long double lrv_st1; + uint64_t lrv_bnd0; + uint64_t lrv_bnd1; +} La_i86_retval; -#else - -typedef struct La_mips_64_regs -{ - uint64_t lr_reg[8]; /* $a0 through $a7 */ - double lr_fpreg[8]; /* $f12 throgh $f19 */ - uint64_t lr_ra; - uint64_t lr_sp; -} La_mips_64_regs; - -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_64_retval -{ - uint64_t lrv_v0; - uint64_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_64_retval; - -#endif __BEGIN_DECLS -#if _MIPS_SIM == _ABIO32 +extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_i86_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_i86_regs *__inregs, + La_i86_retval *__outregs, + const char *symname); -extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_32_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_32_regs *__inregs, - La_mips_32_retval *__outregs, - const char *__symname); - -#elif _MIPS_SIM == _ABIN32 - -extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *__symname); +__END_DECLS #else -extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *__symname); +/* Registers for entry into PLT on x86-64. */ +# if __GNUC_PREREQ (4,0) +typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16))); +typedef float La_x86_64_ymm + __attribute__ ((__vector_size__ (32), __aligned__ (16))); +typedef double La_x86_64_zmm + __attribute__ ((__vector_size__ (64), __aligned__ (16))); +# else +typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__))); +# endif +typedef union +{ +# if __GNUC_PREREQ (4,0) + La_x86_64_ymm ymm[2]; + La_x86_64_zmm zmm[1]; +# endif + La_x86_64_xmm xmm[4]; +} La_x86_64_vector __attribute__ ((__aligned__ (16))); + +typedef struct La_x86_64_regs +{ + uint64_t lr_rdx; + uint64_t lr_r8; + uint64_t lr_r9; + uint64_t lr_rcx; + uint64_t lr_rsi; + uint64_t lr_rdi; + uint64_t lr_rbp; + uint64_t lr_rsp; + La_x86_64_xmm lr_xmm[8]; + La_x86_64_vector lr_vector[8]; +#ifndef __ILP32__ + __int128_t lr_bnd[4]; #endif +} La_x86_64_regs; -__END_DECLS \ No newline at end of file +/* Return values for calls from PLT on x86-64. */ +typedef struct La_x86_64_retval +{ + uint64_t lrv_rax; + uint64_t lrv_rdx; + La_x86_64_xmm lrv_xmm0; + La_x86_64_xmm lrv_xmm1; + long double lrv_st0; + long double lrv_st1; + La_x86_64_vector lrv_vector0; + La_x86_64_vector lrv_vector1; +#ifndef __ILP32__ + __int128_t lrv_bnd0; + __int128_t lrv_bnd1; +#endif +} La_x86_64_retval; + +#define La_x32_regs La_x86_64_regs +#define La_x32_retval La_x86_64_retval + +__BEGIN_DECLS + +extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_x86_64_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_x86_64_regs *__inregs, + La_x86_64_retval *__outregs, + const char *__symname); + +extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_x32_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_x32_regs *__inregs, + La_x32_retval *__outregs, + const char *__symname); + +__END_DECLS + +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/long-double.h b/lib/libc/include/generic-glibc/bits/long-double.h index 27339ff440..75bc1fcce4 100644 --- a/lib/libc/include/generic-glibc/bits/long-double.h +++ b/lib/libc/include/generic-glibc/bits/long-double.h @@ -1,4 +1,4 @@ -/* Properties of long double type. MIPS version. +/* Properties of long double type. ldbl-96 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,9 +16,6 @@ License along with the GNU C Library; if not, see . */ -#include - -#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 -# define __NO_LONG_DOUBLE_MATH 1 -#endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +/* long double is distinct from double, so there is nothing to + define here. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/math-vector.h b/lib/libc/include/generic-glibc/bits/math-vector.h index da37ee7bff..f7571e827d 100644 --- a/lib/libc/include/generic-glibc/bits/math-vector.h +++ b/lib/libc/include/generic-glibc/bits/math-vector.h @@ -4,7 +4,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - License published by the Free Software Foundation; either + License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, @@ -21,7 +21,43 @@ include instead." #endif -/* Get default empty definitions required for __MATHCALL_VEC unfolding. - Plaform-specific analogue of this header should redefine them with specific - SIMD declarations. */ -#include \ No newline at end of file +/* Get default empty definitions for simd declarations. */ +#include + +#if defined __x86_64__ && defined __FAST_MATH__ +# if defined _OPENMP && _OPENMP >= 201307 +/* OpenMP case. */ +# define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") +# elif __GNUC_PREREQ (6,0) +/* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ +# define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) +# endif + +# ifdef __DECL_SIMD_x86_64 +# undef __DECL_SIMD_cos +# define __DECL_SIMD_cos __DECL_SIMD_x86_64 +# undef __DECL_SIMD_cosf +# define __DECL_SIMD_cosf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sin +# define __DECL_SIMD_sin __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sinf +# define __DECL_SIMD_sinf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sincos +# define __DECL_SIMD_sincos __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sincosf +# define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_log +# define __DECL_SIMD_log __DECL_SIMD_x86_64 +# undef __DECL_SIMD_logf +# define __DECL_SIMD_logf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_exp +# define __DECL_SIMD_exp __DECL_SIMD_x86_64 +# undef __DECL_SIMD_expf +# define __DECL_SIMD_expf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_pow +# define __DECL_SIMD_pow __DECL_SIMD_x86_64 +# undef __DECL_SIMD_powf +# define __DECL_SIMD_powf __DECL_SIMD_x86_64 + +# endif +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h b/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h index 88ced5d2e1..29808be75a 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h @@ -16,28 +16,30 @@ License along with the GNU C Library; if not, see . */ - /* Classify given number. */ -__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __fpclassify,, (_Mdouble_ __value), fpclassify) __attribute__ ((__const__)); /* Test for negative number. */ -__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __signbit,, (_Mdouble_ __value), signbit) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ -__MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); /* Test equality. */ -__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHDECL_ALIAS (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y), iseqsig); /* Test for signaling NaN. */ -__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __issignaling,, (_Mdouble_ __value), issignaling) __attribute__ ((__const__)); \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls.h b/lib/libc/include/generic-glibc/bits/mathcalls.h index e6b009ff27..28d936113e 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls.h @@ -174,12 +174,14 @@ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); @@ -208,7 +210,8 @@ __MATHCALL (nan,, (const char *__tagb)); || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); # endif #endif diff --git a/lib/libc/include/generic-glibc/bits/mathinline.h b/lib/libc/include/generic-glibc/bits/mathinline.h deleted file mode 100644 index 76a37688ed..0000000000 --- a/lib/libc/include/generic-glibc/bits/mathinline.h +++ /dev/null @@ -1,12 +0,0 @@ -/* This file should provide inline versions of math functions. - - Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. - - This file should define __MATH_INLINES if functions are actually defined as - inlines. */ - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Here goes the real code. */ - -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mman-shared.h b/lib/libc/include/generic-glibc/bits/mman-shared.h index aa6c176fca..45862663e3 100644 --- a/lib/libc/include/generic-glibc/bits/mman-shared.h +++ b/lib/libc/include/generic-glibc/bits/mman-shared.h @@ -24,6 +24,7 @@ /* Flags for mremap. */ # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 +# define MREMAP_DONTUNMAP 4 /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC diff --git a/lib/libc/include/generic-glibc/bits/mman.h b/lib/libc/include/generic-glibc/bits/mman.h index dc24c1d773..4319c54436 100644 --- a/lib/libc/include/generic-glibc/bits/mman.h +++ b/lib/libc/include/generic-glibc/bits/mman.h @@ -1,5 +1,5 @@ -/* Definitions for POSIX memory map interface. Linux/generic version. - Copyright (C) 1997-2020 Free Software Foundation, Inc. +/* Definitions for POSIX memory map interface. Linux/x86_64 version. + Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,18 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif -/* These definitions are appropriate for architectures that, in the - Linux kernel, either have no uapi/asm/mman.h, or have one that - includes asm-generic/mman.h without any changes or additions - relevant to glibc. If there are additions relevant to glibc, an - architecture-specific bits/mman.h is needed. */ +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + +/* Other flags. */ +#ifdef __USE_MISC +# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */ +#endif #include diff --git a/lib/libc/include/generic-glibc/bits/msq-pad.h b/lib/libc/include/generic-glibc/bits/msq-pad.h deleted file mode 100644 index 5cc786f0d3..0000000000 --- a/lib/libc/include/generic-glibc/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being - 32-bit. */ - -#define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __MSQ_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/msq.h b/lib/libc/include/generic-glibc/bits/msq.h index 98efc613d1..7c8dba0eca 100644 --- a/lib/libc/include/generic-glibc/bits/msq.h +++ b/lib/libc/include/generic-glibc/bits/msq.h @@ -20,7 +20,12 @@ #endif #include -#include + +/* Types used in the MSQID_DS structure definition. */ +typedef __syscall_ulong_t msgqnum_t; +typedef __syscall_ulong_t msglen_t; + +#include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ @@ -29,38 +34,6 @@ # define MSG_COPY 040000 /* copy (not remove) all queue messages */ #endif -/* Types used in the structure definition. */ -typedef __syscall_ulong_t msgqnum_t; -typedef __syscall_ulong_t msglen_t; - -#if __MSQ_PAD_BEFORE_TIME -# define __MSQ_PAD_TIME(NAME, RES) \ - unsigned long int __glibc_reserved ## RES; __time_t NAME -#elif __MSQ_PAD_AFTER_TIME -# define __MSQ_PAD_TIME(NAME, RES) \ - __time_t NAME; unsigned long int __glibc_reserved ## RES -#else -# define __MSQ_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - -/* Structure of record for one message inside the kernel. - The type `struct msg' is opaque. */ -struct msqid_ds -{ - struct ipc_perm msg_perm; /* structure describing operation permission */ - __MSQ_PAD_TIME (msg_stime, 1); /* time of last msgsnd command */ - __MSQ_PAD_TIME (msg_rtime, 2); /* time of last msgrcv command */ - __MSQ_PAD_TIME (msg_ctime, 3); /* time of last change */ - __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ - msgqnum_t msg_qnum; /* number of messages currently on queue */ - msglen_t msg_qbytes; /* max number of bytes allowed on queue */ - __pid_t msg_lspid; /* pid of last msgsnd() */ - __pid_t msg_lrpid; /* pid of last msgrcv() */ - __syscall_ulong_t __glibc_reserved4; - __syscall_ulong_t __glibc_reserved5; -}; - #ifdef __USE_MISC # define msg_cbytes __msg_cbytes diff --git a/lib/libc/include/generic-glibc/bits/procfs-id.h b/lib/libc/include/generic-glibc/bits/procfs-id.h index 38906b6303..4f4cefeb4b 100644 --- a/lib/libc/include/generic-glibc/bits/procfs-id.h +++ b/lib/libc/include/generic-glibc/bits/procfs-id.h @@ -1,4 +1,4 @@ -/* Types of pr_uid and pr_gid in struct elf_prpsinfo. Generic Linux version. +/* Types of pr_uid and pr_gid in struct elf_prpsinfo. x86 version. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,5 +21,10 @@ # error "Never include directly; use instead." #endif +#if __WORDSIZE == 32 +typedef unsigned short int __pr_uid_t; +typedef unsigned short int __pr_gid_t; +#else typedef unsigned int __pr_uid_t; -typedef unsigned int __pr_gid_t; \ No newline at end of file +typedef unsigned int __pr_gid_t; +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/procfs.h b/lib/libc/include/generic-glibc/bits/procfs.h index 66a5f6726b..1f4ca5a0f0 100644 --- a/lib/libc/include/generic-glibc/bits/procfs.h +++ b/lib/libc/include/generic-glibc/bits/procfs.h @@ -1,5 +1,5 @@ -/* Types for registers for sys/procfs.h. MIPS version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Types for registers for sys/procfs.h. x86 version. + Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,25 +13,38 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -#include - -/* ELF register definitions */ -#define ELF_NGREG 45 -#define ELF_NFPREG 33 - -#if _MIPS_SIM == _ABIN32 +/* Type for a general-purpose register. */ +#ifdef __x86_64__ __extension__ typedef unsigned long long elf_greg_t; #else typedef unsigned long elf_greg_t; #endif + +/* And the whole bunch of them. We could have used `struct + user_regs_struct' directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -typedef double elf_fpreg_t; -typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; \ No newline at end of file +#ifndef __x86_64__ +/* Register set for the floating-point registers. */ +typedef struct user_fpregs_struct elf_fpregset_t; + +/* Register set for the extended floating-point registers. Includes + the Pentium III SSE registers in addition to the classic + floating-point stuff. */ +typedef struct user_fpxregs_struct elf_fpxregset_t; +#else +/* Register set for the extended floating-point registers. Includes + the Pentium III SSE registers in addition to the classic + floating-point stuff. */ +typedef struct user_fpregs_struct elf_fpregset_t; +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h b/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h index 549deac37b..147ce690db 100644 --- a/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h +++ b/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h @@ -1,6 +1,4 @@ -/* Machine-specific pthread type layouts. Generic version. - Copyright (C) 2019-2020 Free Software Foundation, Inc. - +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,31 +13,43 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ #ifndef _BITS_PTHREADTYPES_ARCH_H #define _BITS_PTHREADTYPES_ARCH_H 1 #include -#if __WORDSIZE == 64 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_BARRIER_T 32 +#ifdef __x86_64__ +# if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# else +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# endif #else -# define __SIZEOF_PTHREAD_ATTR_T 36 -# define __SIZEOF_PTHREAD_MUTEX_T 24 -# define __SIZEOF_PTHREAD_RWLOCK_T 32 -# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 #endif -#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#define __SIZEOF_PTHREAD_COND_T 48 -#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT +#ifndef __x86_64__ +/* Extra attributes for the cleanup functions. */ +# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) +#endif + #endif /* bits/pthreadtypes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/resource.h b/lib/libc/include/generic-glibc/bits/resource.h index 6f4ec334ac..f5b55f6a7c 100644 --- a/lib/libc/include/generic-glibc/bits/resource.h +++ b/lib/libc/include/generic-glibc/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/generic-glibc/bits/sem-pad.h b/lib/libc/include/generic-glibc/bits/sem-pad.h deleted file mode 100644 index 92c1bab60a..0000000000 --- a/lib/libc/include/generic-glibc/bits/sem-pad.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Define where padding goes in struct semid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being 32-bit, - or include it despite being 64-bit. This must match the layout - used for struct semid64_ds in , as glibc does not do - layout conversions for this structure. */ - -#define __SEM_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sem.h b/lib/libc/include/generic-glibc/bits/sem.h index b352aa0cbb..67c394015a 100644 --- a/lib/libc/include/generic-glibc/bits/sem.h +++ b/lib/libc/include/generic-glibc/bits/sem.h @@ -20,7 +20,8 @@ #endif #include -#include +#include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ @@ -34,29 +35,6 @@ #define SETVAL 16 /* set semval */ #define SETALL 17 /* set all semval's */ - -#if __SEM_PAD_BEFORE_TIME -# define __SEM_PAD_TIME(NAME, RES) \ - __syscall_ulong_t __glibc_reserved ## RES; __time_t NAME -#elif __SEM_PAD_AFTER_TIME -# define __SEM_PAD_TIME(NAME, RES) \ - __time_t NAME; __syscall_ulong_t __glibc_reserved ## RES -#else -# define __SEM_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __SEM_PAD_TIME (sem_otime, 1); /* last semop() time */ - __SEM_PAD_TIME (sem_ctime, 2); /* last time changed by semctl() */ - __syscall_ulong_t sem_nsems; /* number of semaphores in set */ - __syscall_ulong_t __glibc_reserved3; - __syscall_ulong_t __glibc_reserved4; -}; - /* The user should define a union like the following to use it for arguments for `semctl'. diff --git a/lib/libc/include/generic-glibc/bits/semaphore.h b/lib/libc/include/generic-glibc/bits/semaphore.h index e28b319eb5..97292723c8 100644 --- a/lib/libc/include/generic-glibc/bits/semaphore.h +++ b/lib/libc/include/generic-glibc/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,14 +13,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#if _MIPS_SIM == _ABI64 +#include + +#if __WORDSIZE == 64 # define __SIZEOF_SEM_T 32 #else # define __SIZEOF_SEM_T 16 diff --git a/lib/libc/include/generic-glibc/bits/setjmp.h b/lib/libc/include/generic-glibc/bits/setjmp.h index 7fefe88f62..18d620397d 100644 --- a/lib/libc/include/generic-glibc/bits/setjmp.h +++ b/lib/libc/include/generic-glibc/bits/setjmp.h @@ -1,5 +1,4 @@ -/* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,61 +12,29 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -#ifndef _MIPS_BITS_SETJMP_H -#define _MIPS_BITS_SETJMP_H 1 +/* Define the machine-dependent type `jmp_buf'. x86-64 version. */ +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H 1 -#if !defined(_SETJMP_H) && !defined(_PTHREAD_H) +#if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include directly; use instead." #endif -#include +#include -typedef struct __jmp_buf_internal_tag - { -#if _MIPS_SIM == _ABIO32 - /* Program counter. */ - void *__pc; +#ifndef _ASM - /* Stack pointer. */ - void *__sp; +# if __WORDSIZE == 64 +typedef long int __jmp_buf[8]; +# elif defined __x86_64__ +__extension__ typedef long long int __jmp_buf[8]; +# else +typedef int __jmp_buf[6]; +# endif - /* Callee-saved registers s0 through s7. */ - int __regs[8]; - - /* The frame pointer. */ - void *__fp; - - /* The global pointer. */ - void *__gp; -#else - /* Program counter. */ - __extension__ long long __pc; - - /* Stack pointer. */ - __extension__ long long __sp; - - /* Callee-saved registers s0 through s7. */ - __extension__ long long __regs[8]; - - /* The frame pointer. */ - __extension__ long long __fp; - - /* The global pointer. */ - __extension__ long long __gp; #endif - /* Unused (was floating point status register). */ - int __glibc_reserved1; - - /* Callee-saved floating point registers. */ -#if _MIPS_SIM == _ABI64 - double __fpregs[8]; -#else - double __fpregs[6]; -#endif - } __jmp_buf[1]; - -#endif /* _MIPS_BITS_SETJMP_H */ \ No newline at end of file +#endif /* bits/setjmp.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/shm-pad.h b/lib/libc/include/generic-glibc/bits/shm-pad.h deleted file mode 100644 index e214cd6e6b..0000000000 --- a/lib/libc/include/generic-glibc/bits/shm-pad.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Define where padding goes in struct shmid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being 32-bit, - or include it despite being 64-bit. Furthermore, some - architectures place shm_segsz after the time fields rather than - before them, with or without padding there. This must match the - layout used for struct shmid64_ds in , as glibc does - not do layout conversions for this structure. */ - -#define __SHM_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/shm.h b/lib/libc/include/generic-glibc/bits/shm.h index 97e4d577e0..e5de42e2ab 100644 --- a/lib/libc/include/generic-glibc/bits/shm.h +++ b/lib/libc/include/generic-glibc/bits/shm.h @@ -22,7 +22,6 @@ #include #include #include -#include /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from */ @@ -43,39 +42,7 @@ __BEGIN_DECLS /* Type to count number of attaches. */ typedef __syscall_ulong_t shmatt_t; -#if __SHM_PAD_BEFORE_TIME -# define __SHM_PAD_TIME(NAME, RES) \ - unsigned long int __glibc_reserved ## RES; __time_t NAME -#elif __SHM_PAD_AFTER_TIME -# define __SHM_PAD_TIME(NAME, RES) \ - __time_t NAME; unsigned long int __glibc_reserved ## RES -#else -# define __SHM_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - -/* Data structure describing a shared memory segment. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ -#if !__SHM_SEGSZ_AFTER_TIME - size_t shm_segsz; /* size of segment in bytes */ -#endif - __SHM_PAD_TIME (shm_atime, 1); /* time of last shmat() */ - __SHM_PAD_TIME (shm_dtime, 2); /* time of last shmdt() */ - __SHM_PAD_TIME (shm_ctime, 3); /* time of last change by shmctl() */ -#if __SHM_PAD_BETWEEN_TIME_AND_SEGSZ - unsigned long int __glibc_reserved4; -#endif -#if __SHM_SEGSZ_AFTER_TIME - size_t shm_segsz; /* size of segment in bytes */ -#endif - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ - __syscall_ulong_t __glibc_reserved5; - __syscall_ulong_t __glibc_reserved6; - }; +#include #ifdef __USE_MISC diff --git a/lib/libc/include/generic-glibc/bits/sigcontext.h b/lib/libc/include/generic-glibc/bits/sigcontext.h index 4496148619..7498f87f91 100644 --- a/lib/libc/include/generic-glibc/bits/sigcontext.h +++ b/lib/libc/include/generic-glibc/bits/sigcontext.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -8,7 +8,7 @@ The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -16,22 +16,181 @@ . */ #ifndef _BITS_SIGCONTEXT_H -#define _BITS_SIGCONTEXT_H 1 +#define _BITS_SIGCONTEXT_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use directly; include instead." #endif +#include + +#define FP_XSTATE_MAGIC1 0x46505853U +#define FP_XSTATE_MAGIC2 0x46505845U +#define FP_XSTATE_MAGIC2_SIZE sizeof (FP_XSTATE_MAGIC2) + +struct _fpx_sw_bytes +{ + __uint32_t magic1; + __uint32_t extended_size; + __uint64_t xstate_bv; + __uint32_t xstate_size; + __uint32_t __glibc_reserved1[7]; +}; + +struct _fpreg +{ + unsigned short significand[4]; + unsigned short exponent; +}; + +struct _fpxreg +{ + unsigned short significand[4]; + unsigned short exponent; + unsigned short __glibc_reserved1[3]; +}; + +struct _xmmreg +{ + __uint32_t element[4]; +}; + + + +#ifndef __x86_64__ + +struct _fpstate +{ + /* Regular FPU environment. */ + __uint32_t cw; + __uint32_t sw; + __uint32_t tag; + __uint32_t ipoff; + __uint32_t cssel; + __uint32_t dataoff; + __uint32_t datasel; + struct _fpreg _st[8]; + unsigned short status; + unsigned short magic; + + /* FXSR FPU environment. */ + __uint32_t _fxsr_env[6]; + __uint32_t mxcsr; + __uint32_t __glibc_reserved1; + struct _fpxreg _fxsr_st[8]; + struct _xmmreg _xmm[8]; + __uint32_t __glibc_reserved2[56]; +}; + #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. */ + we need sigcontext. Some packages have come to rely on + sigcontext_struct being defined on 32-bit x86, so define this for + their benefit. */ # define sigcontext_struct sigcontext - -# include - -/* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */ -# define __need_NULL -# include #endif -#endif /* bits/sigcontext.h */ \ No newline at end of file +#define X86_FXSR_MAGIC 0x0000 + +struct sigcontext +{ + unsigned short gs, __gsh; + unsigned short fs, __fsh; + unsigned short es, __esh; + unsigned short ds, __dsh; + unsigned long edi; + unsigned long esi; + unsigned long ebp; + unsigned long esp; + unsigned long ebx; + unsigned long edx; + unsigned long ecx; + unsigned long eax; + unsigned long trapno; + unsigned long err; + unsigned long eip; + unsigned short cs, __csh; + unsigned long eflags; + unsigned long esp_at_signal; + unsigned short ss, __ssh; + struct _fpstate * fpstate; + unsigned long oldmask; + unsigned long cr2; +}; + +#else /* __x86_64__ */ + +struct _fpstate +{ + /* FPU environment matching the 64-bit FXSAVE layout. */ + __uint16_t cwd; + __uint16_t swd; + __uint16_t ftw; + __uint16_t fop; + __uint64_t rip; + __uint64_t rdp; + __uint32_t mxcsr; + __uint32_t mxcr_mask; + struct _fpxreg _st[8]; + struct _xmmreg _xmm[16]; + __uint32_t __glibc_reserved1[24]; +}; + +struct sigcontext +{ + __uint64_t r8; + __uint64_t r9; + __uint64_t r10; + __uint64_t r11; + __uint64_t r12; + __uint64_t r13; + __uint64_t r14; + __uint64_t r15; + __uint64_t rdi; + __uint64_t rsi; + __uint64_t rbp; + __uint64_t rbx; + __uint64_t rdx; + __uint64_t rax; + __uint64_t rcx; + __uint64_t rsp; + __uint64_t rip; + __uint64_t eflags; + unsigned short cs; + unsigned short gs; + unsigned short fs; + unsigned short __pad0; + __uint64_t err; + __uint64_t trapno; + __uint64_t oldmask; + __uint64_t cr2; + __extension__ union + { + struct _fpstate * fpstate; + __uint64_t __fpstate_word; + }; + __uint64_t __reserved1 [8]; +}; + +#endif /* __x86_64__ */ + +struct _xsave_hdr +{ + __uint64_t xstate_bv; + __uint64_t __glibc_reserved1[2]; + __uint64_t __glibc_reserved2[5]; +}; + +struct _ymmh_state +{ + __uint32_t ymmh_space[64]; +}; + +struct _xstate +{ + struct _fpstate fpstate; + struct _xsave_hdr xstate_hdr; + struct _ymmh_state ymmh; +}; + +#endif /* _BITS_SIGCONTEXT_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/siginfo-arch.h b/lib/libc/include/generic-glibc/bits/siginfo-arch.h index 59cd9e3066..0f430f0772 100644 --- a/lib/libc/include/generic-glibc/bits/siginfo-arch.h +++ b/lib/libc/include/generic-glibc/bits/siginfo-arch.h @@ -1,7 +1,17 @@ -/* Architecture-specific adjustments to siginfo_t. */ +/* Architecture-specific adjustments to siginfo_t. x86 version. */ #ifndef _BITS_SIGINFO_ARCH_H #define _BITS_SIGINFO_ARCH_H 1 -/* This architecture has no adjustments to make to siginfo_t. */ +#if defined __x86_64__ && __WORDSIZE == 32 +/* si_utime and si_stime must be 4 byte aligned for x32 to match the + kernel. We align siginfo_t to 8 bytes so that si_utime and + si_stime are actually aligned to 8 bytes since their offsets are + multiple of 8 bytes. Note: with some compilers, the alignment + attribute would be ignored if it were put in __SI_CLOCK_T instead + of encapsulated in a typedef. */ +typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t; +# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) +# define __SI_CLOCK_T __sigchld_clock_t +#endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/signum-generic.h b/lib/libc/include/generic-glibc/bits/signum-generic.h index fc31cf9cff..eddb633837 100644 --- a/lib/libc/include/generic-glibc/bits/signum-generic.h +++ b/lib/libc/include/generic-glibc/bits/signum-generic.h @@ -57,31 +57,9 @@ #define SIGQUIT 3 /* Quit. */ #define SIGTRAP 5 /* Trace/breakpoint trap. */ #define SIGKILL 9 /* Killed. */ -#define SIGBUS 10 /* Bus error. */ -#define SIGSYS 12 /* Bad system call. */ #define SIGPIPE 13 /* Broken pipe. */ #define SIGALRM 14 /* Alarm clock. */ -/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ -#define SIGURG 16 /* Urgent data is available at a socket. */ -#define SIGSTOP 17 /* Stop, unblockable. */ -#define SIGTSTP 18 /* Keyboard stop. */ -#define SIGCONT 19 /* Continue. */ -#define SIGCHLD 20 /* Child terminated or stopped. */ -#define SIGTTIN 21 /* Background read from control terminal. */ -#define SIGTTOU 22 /* Background write to control terminal. */ -#define SIGPOLL 23 /* Pollable event occurred (System V). */ -#define SIGXCPU 24 /* CPU time limit exceeded. */ -#define SIGXFSZ 25 /* File size limit exceeded. */ -#define SIGVTALRM 26 /* Virtual timer expired. */ -#define SIGPROF 27 /* Profiling timer expired. */ -#define SIGUSR1 30 /* User-defined signal 1. */ -#define SIGUSR2 31 /* User-defined signal 2. */ - -/* Nonstandard signals found in all modern POSIX systems - (including both BSD and Linux). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ - /* Archaic names for compatibility. */ #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ @@ -93,8 +71,9 @@ but some real-time signals may be used internally by glibc. Do not use these constants in application code; use SIGRTMIN and SIGRTMAX (defined in signal.h) instead. */ -#define __SIGRTMIN 32 -#define __SIGRTMAX __SIGRTMIN + +/* Include system specific bits. */ +#include /* Biggest signal number + 1 (including real-time signals). */ #define _NSIG (__SIGRTMAX + 1) diff --git a/lib/libc/include/generic-glibc/bits/signum.h b/lib/libc/include/generic-glibc/bits/signum.h deleted file mode 100644 index a549ca0204..0000000000 --- a/lib/libc/include/generic-glibc/bits/signum.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Signal number definitions. Linux version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - most Linux systems. */ - -#define SIGSTKFLT 16 /* Stack fault (obsolete). */ -#define SIGPWR 30 /* Power failure imminent. */ - -#undef SIGBUS -#define SIGBUS 7 -#undef SIGUSR1 -#define SIGUSR1 10 -#undef SIGUSR2 -#define SIGUSR2 12 -#undef SIGCHLD -#define SIGCHLD 17 -#undef SIGCONT -#define SIGCONT 18 -#undef SIGSTOP -#define SIGSTOP 19 -#undef SIGTSTP -#define SIGTSTP 20 -#undef SIGURG -#define SIGURG 23 -#undef SIGPOLL -#define SIGPOLL 29 -#undef SIGSYS -#define SIGSYS 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/socket-constants.h b/lib/libc/include/generic-glibc/bits/socket-constants.h index 1781053c77..93fd5d7548 100644 --- a/lib/libc/include/generic-glibc/bits/socket-constants.h +++ b/lib/libc/include/generic-glibc/bits/socket-constants.h @@ -20,6 +20,8 @@ # error "Never include directly; use instead." #endif +#include + #define SOL_SOCKET 1 #define SO_ACCEPTCONN 30 #define SO_BROADCAST 6 @@ -30,9 +32,19 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 18 -#define SO_RCVTIMEO 20 +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_RCVTIMEO 66 +#else +# define SO_RCVTIMEO 20 +#endif #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 19 -#define SO_SNDTIMEO 21 +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_SNDTIMEO 67 +#else +# define SO_SNDTIMEO 21 +#endif #define SO_TYPE 3 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stat.h b/lib/libc/include/generic-glibc/bits/stat.h index b298b3f336..ab5378300a 100644 --- a/lib/libc/include/generic-glibc/bits/stat.h +++ b/lib/libc/include/generic-glibc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 1999-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,7 +12,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #if !defined _SYS_STAT_H && !defined _FCNTL_H @@ -22,90 +22,126 @@ #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 -#include - /* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ +#ifndef __x86_64__ +# define _STAT_VER_LINUX_OLD 1 +# define _STAT_VER_KERNEL 1 +# define _STAT_VER_SVR4 2 +# define _STAT_VER_LINUX 3 -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ +/* i386 versions of the `xmknod' interface. */ +# define _MKNOD_VER_LINUX 1 +# define _MKNOD_VER_SVR4 2 +# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ +#else +# define _STAT_VER_KERNEL 0 +# define _STAT_VER_LINUX 1 +/* x86-64 versions of the `xmknod' interface. */ +# define _MKNOD_VER_LINUX 0 +#endif + +#define _STAT_VER _STAT_VER_LINUX -#if _MIPS_SIM == _ABIO32 -/* Structure describing file characteristics. */ struct stat { - unsigned long int st_dev; - long int st_pad1[3]; -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -#else - __ino64_t st_ino; /* File serial number. */ + __dev_t st_dev; /* Device. */ +#ifndef __x86_64__ + unsigned short int __pad1; #endif - __mode_t st_mode; /* File mode. */ +#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +#else + __ino_t __st_ino; /* 32bit file serial number. */ +#endif +#ifndef __x86_64__ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ +#else __nlink_t st_nlink; /* Link count. */ + __mode_t st_mode; /* File mode. */ +#endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ -#ifndef __USE_FILE_OFFSET64 - long int st_pad2[2]; +#ifdef __x86_64__ + int __pad0; +#endif + __dev_t st_rdev; /* Device number, if device. */ +#ifndef __x86_64__ + unsigned short int __pad2; +#endif +#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 + __off_t st_size; /* Size of file, in bytes. */ +#else + __off64_t st_size; /* Size of file, in bytes. */ +#endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ +#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +#else + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +#endif +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ +#endif +#ifdef __x86_64__ + __syscall_slong_t __glibc_reserved[3]; +#else +# ifndef __USE_FILE_OFFSET64 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +# else + __ino64_t st_ino; /* File serial number. */ +# endif +#endif + }; + +#ifdef __USE_LARGEFILE64 +/* Note stat64 has the same shape as stat for x86-64. */ +struct stat64 + { + __dev_t st_dev; /* Device. */ +# ifdef __x86_64__ + __ino64_t st_ino; /* File serial number. */ + __nlink_t st_nlink; /* Link count. */ + __mode_t st_mode; /* File mode. */ +# else + unsigned int __pad1; + __ino_t __st_ino; /* 32bit file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ +# endif + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ +# ifdef __x86_64__ + int __pad0; + __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long int st_pad3; -#else - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ -#endif -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# else + __dev_t st_rdev; /* Device number, if device. */ + unsigned int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -#else - long int st_pad4; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -#endif - long int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - unsigned long int st_dev; - long int st_pad1[3]; - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used @@ -113,119 +149,30 @@ struct stat64 identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ # else __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ + __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ + __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ # endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ - long int st_pad3; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ - long int st_pad4[14]; - }; -#endif -#else -struct stat - { - __dev_t st_dev; - int st_pad1[3]; /* Reserved for st_dev expansion */ -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; -#else - __ino64_t st_ino; -#endif - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; -#if !defined __USE_FILE_OFFSET64 - unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ - __off_t st_size; - int st_pad3; -#else - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -#endif -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - __blksize_t st_blksize; - unsigned int st_pad4; -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; -#else - __blkcnt64_t st_blocks; -#endif - int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; - unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ - __ino64_t st_ino; - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ +# ifdef __x86_64__ + __syscall_slong_t __glibc_reserved[3]; # else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ + __ino64_t st_ino; /* File serial number. */ # endif - __blksize_t st_blksize; - unsigned int st_pad3; - __blkcnt64_t st_blocks; - int st_pad4[14]; -}; -#endif + }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC /* Encoding of the file mode. */ diff --git a/lib/libc/include/generic-glibc/bits/statx-generic.h b/lib/libc/include/generic-glibc/bits/statx-generic.h index e277c97c32..f0d8e4d846 100644 --- a/lib/libc/include/generic-glibc/bits/statx-generic.h +++ b/lib/libc/include/generic-glibc/bits/statx-generic.h @@ -48,6 +48,7 @@ # define STATX_ATTR_NODUMP 0x0040 # define STATX_ATTR_ENCRYPTED 0x0800 # define STATX_ATTR_AUTOMOUNT 0x1000 +# define STATX_ATTR_VERITY 0x100000 #endif /* !STATX_TYPE */ __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h index 1e6a0edf64..f74840c8b6 100644 --- a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h @@ -27,9 +27,17 @@ __LDBL_REDIR_DECL (vfprintf) __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) #if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128) +__LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128) +__LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif #else __LDBL_REDIR_DECL (fscanf) __LDBL_REDIR_DECL (scanf) @@ -43,9 +51,17 @@ __LDBL_REDIR_DECL (vsnprintf) #ifdef __USE_ISOC99 # if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128) +__LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128) +__LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (vfscanf) __LDBL_REDIR_DECL (vsscanf) @@ -60,33 +76,33 @@ __LDBL_REDIR_DECL (dprintf) #ifdef __USE_GNU __LDBL_REDIR_DECL (vasprintf) -__LDBL_REDIR_DECL (__asprintf) +__LDBL_REDIR2_DECL (asprintf) __LDBL_REDIR_DECL (asprintf) __LDBL_REDIR_DECL (obstack_printf) __LDBL_REDIR_DECL (obstack_vprintf) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__sprintf_chk) -__LDBL_REDIR_DECL (__vsprintf_chk) +__LDBL_REDIR2_DECL (sprintf_chk) +__LDBL_REDIR2_DECL (vsprintf_chk) # if defined __USE_ISOC99 || defined __USE_UNIX98 -__LDBL_REDIR_DECL (__snprintf_chk) -__LDBL_REDIR_DECL (__vsnprintf_chk) +__LDBL_REDIR2_DECL (snprintf_chk) +__LDBL_REDIR2_DECL (vsnprintf_chk) # endif # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR_DECL (__fprintf_chk) -__LDBL_REDIR_DECL (__printf_chk) -__LDBL_REDIR_DECL (__vfprintf_chk) -__LDBL_REDIR_DECL (__vprintf_chk) +__LDBL_REDIR2_DECL (fprintf_chk) +__LDBL_REDIR2_DECL (printf_chk) +__LDBL_REDIR2_DECL (vfprintf_chk) +__LDBL_REDIR2_DECL (vprintf_chk) # ifdef __USE_XOPEN2K8 -__LDBL_REDIR_DECL (__dprintf_chk) -__LDBL_REDIR_DECL (__vdprintf_chk) +__LDBL_REDIR2_DECL (dprintf_chk) +__LDBL_REDIR2_DECL (vdprintf_chk) # endif # ifdef __USE_GNU -__LDBL_REDIR_DECL (__asprintf_chk) -__LDBL_REDIR_DECL (__vasprintf_chk) -__LDBL_REDIR_DECL (__obstack_printf_chk) -__LDBL_REDIR_DECL (__obstack_vprintf_chk) +__LDBL_REDIR2_DECL (asprintf_chk) +__LDBL_REDIR2_DECL (vasprintf_chk) +__LDBL_REDIR2_DECL (obstack_printf_chk) +__LDBL_REDIR2_DECL (obstack_vprintf_chk) # endif # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stdio2.h b/lib/libc/include/generic-glibc/bits/stdio2.h index 32e4a4b64a..b6b568ad96 100644 --- a/lib/libc/include/generic-glibc/bits/stdio2.h +++ b/lib/libc/include/generic-glibc/bits/stdio2.h @@ -24,10 +24,12 @@ #endif extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, - const char *__restrict __format, ...) __THROW; + const char *__restrict __format, ...) __THROW + __attr_access ((__write_only__, 1, 3)); extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, - __gnuc_va_list __ap) __THROW; + __gnuc_va_list __ap) __THROW + __attr_access ((__write_only__, 1, 3)); #ifdef __va_arg_pack __fortify_function int @@ -54,7 +56,8 @@ __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, - ...) __THROW; + ...) __THROW + __attr_access ((__write_only__, 1, 2)); extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __THROW; @@ -241,17 +244,19 @@ gets (char *__str) #endif extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, - FILE *__restrict __stream) __wur; + FILE *__restrict __stream) + __wur __attr_access ((__write_only__, 1, 3)); extern char *__REDIRECT (__fgets_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets) __wur; + FILE *__restrict __stream), fgets) + __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT (__fgets_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_chk) __wur __warnattr ("fgets called with bigger size than length " "of destination buffer"); -__fortify_function __wur char * +__fortify_function __wur __attr_access ((__write_only__, 1, 2)) char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) != (size_t) -1) @@ -299,17 +304,19 @@ fread (void *__restrict __ptr, size_t __size, size_t __n, #ifdef __USE_GNU extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size, - int __n, FILE *__restrict __stream) __wur; + int __n, FILE *__restrict __stream) + __wur __attr_access ((__write_only__, 1, 3)); extern char *__REDIRECT (__fgets_unlocked_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets_unlocked) __wur; + FILE *__restrict __stream), fgets_unlocked) + __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT (__fgets_unlocked_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_unlocked_chk) __wur __warnattr ("fgets_unlocked called with bigger size than length " "of destination buffer"); -__fortify_function __wur char * +__fortify_function __wur __attr_access ((__write_only__, 1, 2)) char * fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) != (size_t) -1) diff --git a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h index b4c4abe997..185b83dde3 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h @@ -21,21 +21,43 @@ #endif #ifdef __USE_ISOC99 +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold, strtod) +# else +__LDBL_REDIR1_DECL (strtold, __strtoieee128) +# endif #endif #ifdef __USE_GNU +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold_l, strtod_l) +# else +__LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l) +# endif #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strfroml, strfromd) +# else +__LDBL_REDIR1_DECL (strfroml, __strfromieee128) +# endif #endif #ifdef __USE_MISC +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (qecvt, ecvt) __LDBL_REDIR1_DECL (qfcvt, fcvt) __LDBL_REDIR1_DECL (qgcvt, gcvt) __LDBL_REDIR1_DECL (qecvt_r, ecvt_r) __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (qecvt, __qecvtieee128) +__LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128) +__LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128) +__LDBL_REDIR1_DECL (qecvt_r, __qecvtieee128_r) +__LDBL_REDIR1_DECL (qfcvt_r, __qfcvtieee128_r) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stdlib.h b/lib/libc/include/generic-glibc/bits/stdlib.h index d6fb14eb32..92b27c5534 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib.h +++ b/lib/libc/include/generic-glibc/bits/stdlib.h @@ -50,10 +50,11 @@ __NTH (realpath (const char *__restrict __name, char *__restrict __resolved)) extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)); + size_t __nreal) __THROW __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, size_t __buflen), ptsname_r) - __nonnull ((2)); + __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ptsname_r_chk_warn, (int __fd, char *__buf, size_t __buflen, size_t __nreal), __ptsname_r_chk) @@ -97,11 +98,13 @@ __NTH (wctomb (char *__s, wchar_t __wchar)) extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len, size_t __dstlen) __THROW; + size_t __len, size_t __dstlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__mbstowcs_alias, (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len), mbstowcs); + size_t __len), mbstowcs) + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, (wchar_t *__restrict __dst, const char *__restrict __src, @@ -129,11 +132,13 @@ __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, extern size_t __wcstombs_chk (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len, size_t __dstlen) __THROW; + size_t __len, size_t __dstlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__wcstombs_alias, (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len), wcstombs); + size_t __len), wcstombs) + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__wcstombs_chk_warn, (char *__restrict __dst, const wchar_t *__restrict __src, diff --git a/lib/libc/include/generic-glibc/bits/string_fortified.h b/lib/libc/include/generic-glibc/bits/string_fortified.h index f516808da3..0ec88c36a4 100644 --- a/lib/libc/include/generic-glibc/bits/string_fortified.h +++ b/lib/libc/include/generic-glibc/bits/string_fortified.h @@ -75,7 +75,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len)) # include void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen) - __THROW __nonnull ((1)); + __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); __fortify_function void __NTH (explicit_bzero (void *__dest, size_t __len)) @@ -108,7 +108,8 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, /* XXX We have no corresponding builtin yet. */ extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, - size_t __destlen) __THROW; + size_t __destlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, size_t __n), stpncpy); diff --git a/lib/libc/include/generic-glibc/bits/struct_mutex.h b/lib/libc/include/generic-glibc/bits/struct_mutex.h index 092f4ee080..44273158be 100644 --- a/lib/libc/include/generic-glibc/bits/struct_mutex.h +++ b/lib/libc/include/generic-glibc/bits/struct_mutex.h @@ -1,4 +1,4 @@ -/* Default mutex implementation struct definitions. +/* x86 internal mutex struct definitions. Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -19,66 +19,45 @@ #ifndef _THREAD_MUTEX_INTERNAL_H #define _THREAD_MUTEX_INTERNAL_H 1 -/* Generic struct for both POSIX and C11 mutexes. New ports are expected - to use the default layout, however architecture can redefine it to - add arch-specific extension (such as lock-elision). The struct have - a size of 32 bytes on LP32 and 40 bytes on LP64 architectures. */ - struct __pthread_mutex_s { - int __lock __LOCK_ALIGNMENT; + int __lock; unsigned int __count; int __owner; -#if __WORDSIZE == 64 +#ifdef __x86_64__ unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility with static initializers. - - Concurrency notes: - The __kind of a mutex is initialized either by the static - PTHREAD_MUTEX_INITIALIZER or by a call to pthread_mutex_init. - - After a mutex has been initialized, the __kind of a mutex is usually not - changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can - be enabled. This is done concurrently in the pthread_mutex_*lock - functions by using the macro FORCE_ELISION. This macro is only defined - for architectures which supports lock elision. - - For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and - PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already - set type of a mutex. Before a mutex is initialized, only - PTHREAD_MUTEX_NO_ELISION_NP can be set with pthread_mutexattr_settype. - - After a mutex has been initialized, the functions pthread_mutex_*lock can - enable elision - if the mutex-type and the machine supports it - by - setting the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently. - Afterwards the lock / unlock functions are using specific elision - code-paths. */ + binary compatibility with static initializers. */ int __kind; -#if __WORDSIZE != 64 - unsigned int __nusers; -#endif -#if __WORDSIZE == 64 - int __spins; +#ifdef __x86_64__ + short __spins; + short __elision; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else + unsigned int __nusers; __extension__ union { - int __spins; + struct + { + short __espins; + short __eelision; +# define __spins __elision_data.__espins +# define __elision __elision_data.__eelision + } __elision_data; __pthread_slist_t __list; }; # define __PTHREAD_MUTEX_HAVE_PREV 0 #endif }; -#if __PTHREAD_MUTEX_HAVE_PREV == 1 +#ifdef __x86_64__ # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, 0, __kind, 0, { 0, 0 } + 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } #else # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, __kind, 0, { 0 } + 0, 0, 0, __kind, 0, { { 0, 0 } } #endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/struct_rwlock.h b/lib/libc/include/generic-glibc/bits/struct_rwlock.h index e1e54e75bb..863b185dc9 100644 --- a/lib/libc/include/generic-glibc/bits/struct_rwlock.h +++ b/lib/libc/include/generic-glibc/bits/struct_rwlock.h @@ -1,5 +1,6 @@ -/* MIPS internal rwlock struct definitions. +/* x86 internal rwlock struct definitions. Copyright (C) 2019-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,45 +28,38 @@ struct __pthread_rwlock_arch_t unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; -#if _MIPS_SIM == _ABI64 +#ifdef __x86_64__ int __cur_writer; int __shared; - unsigned long int __pad1; + signed char __rwelision; +# ifdef __ILP32__ + unsigned char __pad1[3]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } +# else + unsigned char __pad1[7]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } +# endif unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; -# else -# if __BYTE_ORDER == __BIG_ENDIAN - unsigned char __pad1; - unsigned char __pad2; - unsigned char __shared; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned char __flags; -# else +#else /* __x86_64__ */ /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; - unsigned char __pad1; + signed char __rwelision; unsigned char __pad2; -# endif int __cur_writer; #endif }; -#if _MIPS_SIM == _ABI64 +#ifdef __x86_64__ # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags + 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags #else -# if __BYTE_ORDER == __BIG_ENDIAN -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 -# else -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 -# endif #endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sys_errlist.h b/lib/libc/include/generic-glibc/bits/sys_errlist.h deleted file mode 100644 index ae30302397..0000000000 --- a/lib/libc/include/generic-glibc/bits/sys_errlist.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. - Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _STDIO_H -# error "Never include directly; use instead." -#endif - -/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ - -#ifdef __USE_MISC -extern int sys_nerr; -extern const char *const sys_errlist[]; -#endif -#ifdef __USE_GNU -extern int _sys_nerr; -extern const char *const _sys_errlist[]; -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syscall.h b/lib/libc/include/generic-glibc/bits/syscall.h index a1f9bcb306..561be5ac16 100644 --- a/lib/libc/include/generic-glibc/bits/syscall.h +++ b/lib/libc/include/generic-glibc/bits/syscall.h @@ -1,11 +1,11 @@ /* Generated at libc build time from syscall list. */ -/* The system call list corresponds to kernel 5.4. */ +/* The system call list corresponds to kernel 5.7. */ #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 328704 +#define __GLIBC_LINUX_VERSION_CODE 329472 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -75,6 +75,18 @@ # define SYS_alloc_hugepages __NR_alloc_hugepages #endif +#ifdef __NR_arc_gettls +# define SYS_arc_gettls __NR_arc_gettls +#endif + +#ifdef __NR_arc_settls +# define SYS_arc_settls __NR_arc_settls +#endif + +#ifdef __NR_arc_usr_cmpxchg +# define SYS_arc_usr_cmpxchg __NR_arc_usr_cmpxchg +#endif + #ifdef __NR_arch_prctl # define SYS_arch_prctl __NR_arch_prctl #endif @@ -1079,6 +1091,10 @@ # define SYS_openat __NR_openat #endif +#ifdef __NR_openat2 +# define SYS_openat2 __NR_openat2 +#endif + #ifdef __NR_osf_adjtime # define SYS_osf_adjtime __NR_osf_adjtime #endif @@ -1551,6 +1567,10 @@ # define SYS_personality __NR_personality #endif +#ifdef __NR_pidfd_getfd +# define SYS_pidfd_getfd __NR_pidfd_getfd +#endif + #ifdef __NR_pidfd_open # define SYS_pidfd_open __NR_pidfd_open #endif diff --git a/lib/libc/include/generic-glibc/bits/sysctl.h b/lib/libc/include/generic-glibc/bits/sysctl.h deleted file mode 100644 index d47dd78ea1..0000000000 --- a/lib/libc/include/generic-glibc/bits/sysctl.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty file. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syslog-ldbl.h b/lib/libc/include/generic-glibc/bits/syslog-ldbl.h index 8f46907bef..a6527d038f 100644 --- a/lib/libc/include/generic-glibc/bits/syslog-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/syslog-ldbl.h @@ -27,9 +27,9 @@ __LDBL_REDIR_DECL (vsyslog) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__syslog_chk) +__LDBL_REDIR2_DECL (syslog_chk) # ifdef __USE_MISC -__LDBL_REDIR_DECL (__vsyslog_chk) +__LDBL_REDIR2_DECL (vsyslog_chk) # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/thread-shared-types.h b/lib/libc/include/generic-glibc/bits/thread-shared-types.h index ac0c7f5370..43efbedb1b 100644 --- a/lib/libc/include/generic-glibc/bits/thread-shared-types.h +++ b/lib/libc/include/generic-glibc/bits/thread-shared-types.h @@ -116,4 +116,14 @@ struct __pthread_cond_s unsigned int __g_signals[2]; }; +typedef unsigned int __tss_t; +typedef unsigned long int __thrd_t; + +typedef struct +{ + int __data __ONCE_ALIGNMENT; +} __once_flag; + +#define __ONCE_FLAG_INIT { 0 } + #endif /* _THREAD_SHARED_TYPES_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/timesize.h b/lib/libc/include/generic-glibc/bits/timesize.h index 5260dbb5aa..ae0a502d0d 100644 --- a/lib/libc/include/generic-glibc/bits/timesize.h +++ b/lib/libc/include/generic-glibc/bits/timesize.h @@ -1,4 +1,4 @@ -/* Bit size of the time_t type at glibc build time, general case. +/* Bit size of the time_t type at glibc build time, x86-64 and x32 case. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE __WORDSIZE \ No newline at end of file +#if defined __x86_64__ && defined __ILP32__ +/* For x32, time is 64-bit even though word size is 32-bit. */ +# define __TIMESIZE 64 +#else +/* For others, time size is word size. */ +# define __TIMESIZE __WORDSIZE +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/types.h b/lib/libc/include/generic-glibc/bits/types.h index 26fbc0be67..1f37c9eec8 100644 --- a/lib/libc/include/generic-glibc/bits/types.h +++ b/lib/libc/include/generic-glibc/bits/types.h @@ -160,6 +160,7 @@ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ +__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ diff --git a/lib/libc/include/generic-glibc/bits/typesizes.h b/lib/libc/include/generic-glibc/bits/typesizes.h index 571d285ea0..53ae0bd5ef 100644 --- a/lib/libc/include/generic-glibc/bits/typesizes.h +++ b/lib/libc/include/generic-glibc/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. Generic version. - Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. + Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,42 +26,55 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +/* X32 kernel interface is 64-bit. */ +#if defined __x86_64__ && defined __ILP32__ +# define __SYSCALL_SLONG_TYPE __SQUAD_TYPE +# define __SYSCALL_ULONG_TYPE __UQUAD_TYPE +#else +# define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +# define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#endif + #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO_T_TYPE __SYSCALL_ULONG_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __UWORD_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE +#ifdef __x86_64__ +# define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE +# define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE +#else +# define __NLINK_T_TYPE __UWORD_TYPE +# define __FSWORD_T_TYPE __SWORD_TYPE +#endif +#define __OFF_T_TYPE __SYSCALL_SLONG_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -#define __FSFILCNT64_T_TYPE __UQUAD_TYPE -#define __FSWORD_T_TYPE __SWORD_TYPE -#define __ID_T_TYPE __U32_TYPE -#define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE +#define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE -#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE -#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE -#define __CPU_MASK_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __SYSCALL_ULONG_TYPE -#ifdef __LP64__ +#ifdef __x86_64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -70,19 +83,24 @@ /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 -/* And for rlim_t and rlim64_t. */ +/* And for __rlim_t and __rlim64_t. */ # define __RLIM_T_MATCHES_RLIM64_T 1 /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 +#define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/unistd.h b/lib/libc/include/generic-glibc/bits/unistd.h index 9cad6847f9..729afdf23e 100644 --- a/lib/libc/include/generic-glibc/bits/unistd.h +++ b/lib/libc/include/generic-glibc/bits/unistd.h @@ -21,9 +21,11 @@ #endif extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, - size_t __buflen) __wur; + size_t __buflen) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, - size_t __nbytes), read) __wur; + size_t __nbytes), read) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__read_chk_warn, (int __fd, void *__buf, size_t __nbytes, size_t __buflen), __read_chk) @@ -46,15 +48,19 @@ read (int __fd, void *__buf, size_t __nbytes) #ifdef __USE_UNIX98 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, - __off_t __offset, size_t __bufsize) __wur; + __off_t __offset, size_t __bufsize) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset, size_t __bufsize) __wur; + __off64_t __offset, size_t __bufsize) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread_alias, (int __fd, void *__buf, size_t __nbytes, - __off_t __offset), pread) __wur; + __off_t __offset), pread) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread64_alias, (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset), pread64) __wur; + __off64_t __offset), pread64) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread_chk_warn, (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize), __pread_chk) @@ -123,11 +129,11 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) extern ssize_t __readlink_chk (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((1, 2)) __wur; + __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT_NTH (__readlink_alias, (const char *__restrict __path, char *__restrict __buf, size_t __len), readlink) - __nonnull ((1, 2)) __wur; + __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT_NTH (__readlink_chk_warn, (const char *__restrict __path, char *__restrict __buf, size_t __len, @@ -155,12 +161,12 @@ __NTH (readlink (const char *__restrict __path, char *__restrict __buf, extern ssize_t __readlinkat_chk (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((2, 3)) __wur; + __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); extern ssize_t __REDIRECT_NTH (__readlinkat_alias, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len), readlinkat) - __nonnull ((2, 3)) __wur; + __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); extern ssize_t __REDIRECT_NTH (__readlinkat_chk_warn, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, @@ -187,9 +193,10 @@ __NTH (readlinkat (int __fd, const char *__restrict __path, #endif extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) - __THROW __wur; + __THROW __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getcwd_alias, - (char *__buf, size_t __size), getcwd) __wur; + (char *__buf, size_t __size), getcwd) + __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getcwd_chk_warn, (char *__buf, size_t __size, size_t __buflen), __getcwd_chk) @@ -212,7 +219,7 @@ __NTH (getcwd (char *__buf, size_t __size)) #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern char *__getwd_chk (char *__buf, size_t buflen) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd) __nonnull ((1)) __wur __warnattr ("please use getcwd instead, as getwd " "doesn't specify buffer size"); @@ -227,9 +234,11 @@ __NTH (getwd (char *__buf)) #endif extern size_t __confstr_chk (int __name, char *__buf, size_t __len, - size_t __buflen) __THROW; + size_t __buflen) __THROW + __attr_access ((__write_only__, 2, 3)); extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf, - size_t __len), confstr); + size_t __len), confstr) + __attr_access ((__write_only__, 2, 3)); extern size_t __REDIRECT_NTH (__confstr_chk_warn, (int __name, char *__buf, size_t __len, size_t __buflen), __confstr_chk) @@ -252,9 +261,9 @@ __NTH (confstr (int __name, char *__buf, size_t __len)) extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen) - __THROW __wur; + __THROW __wur __attr_access ((__write_only__, 2, 1)); extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]), - getgroups) __wur; + getgroups) __wur __attr_access ((__write_only__, 2, 1)); extern int __REDIRECT_NTH (__getgroups_chk_warn, (int __size, __gid_t __list[], size_t __listlen), __getgroups_chk) @@ -277,7 +286,8 @@ __NTH (getgroups (int __size, __gid_t __list[])) extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)); + size_t __nreal) __THROW __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf, size_t __buflen), ttyname_r) __nonnull ((2)); @@ -304,7 +314,7 @@ __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) #ifdef __USE_POSIX199506 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) - __nonnull ((1)); + __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen), getlogin_r) __nonnull ((1)); extern int __REDIRECT (__getlogin_r_chk_warn, @@ -331,9 +341,10 @@ getlogin_r (char *__buf, size_t __buflen) #if defined __USE_MISC || defined __USE_UNIX98 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)); + __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen), - gethostname) __nonnull ((1)); + gethostname) + __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__gethostname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __gethostname_chk) @@ -358,10 +369,11 @@ __NTH (gethostname (char *__buf, size_t __buflen)) #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf, size_t __buflen), - getdomainname) __nonnull ((1)) __wur; + getdomainname) __nonnull ((1)) + __wur __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__getdomainname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __getdomainname_chk) diff --git a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h index 3ded0fb11c..7067a9c3e3 100644 --- a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h @@ -28,9 +28,17 @@ __LDBL_REDIR_DECL (vfwprintf); __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); # if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128) +__LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128) +__LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (fwscanf); __LDBL_REDIR_DECL (wscanf); @@ -39,11 +47,23 @@ __LDBL_REDIR_DECL (swscanf); #endif #ifdef __USE_ISOC99 +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold, wcstod); +# else +__LDBL_REDIR1_DECL (wcstold, __wcstoieee128) +# endif # if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128) +__LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128) +__LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (vfwscanf); __LDBL_REDIR_DECL (vwscanf); @@ -52,16 +72,20 @@ __LDBL_REDIR_DECL (vswscanf); #endif #ifdef __USE_GNU +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold_l, wcstod_l); +# else +__LDBL_REDIR1_DECL (wcstold_l, __wcstoieee128_l) +# endif #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__swprintf_chk) -__LDBL_REDIR_DECL (__vswprintf_chk) +__LDBL_REDIR2_DECL (swprintf_chk) +__LDBL_REDIR2_DECL (vswprintf_chk) # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR_DECL (__fwprintf_chk) -__LDBL_REDIR_DECL (__wprintf_chk) -__LDBL_REDIR_DECL (__vfwprintf_chk) -__LDBL_REDIR_DECL (__vwprintf_chk) +__LDBL_REDIR2_DECL (fwprintf_chk) +__LDBL_REDIR2_DECL (wprintf_chk) +__LDBL_REDIR2_DECL (vfwprintf_chk) +__LDBL_REDIR2_DECL (vwprintf_chk) # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/wordsize.h b/lib/libc/include/generic-glibc/bits/wordsize.h index d5ed6b4522..0bf84a4e99 100644 --- a/lib/libc/include/generic-glibc/bits/wordsize.h +++ b/lib/libc/include/generic-glibc/bits/wordsize.h @@ -1,31 +1,17 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. +/* Determine the wordsize from the preprocessor defines. */ - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include - -#define __WORDSIZE _MIPS_SZPTR - -#if _MIPS_SIM == _ABI64 -# define __WORDSIZE_TIME64_COMPAT32 1 +#if defined __x86_64__ && !defined __ILP32__ +# define __WORDSIZE 64 #else -# define __WORDSIZE_TIME64_COMPAT32 0 -#endif - -#if __WORDSIZE == 32 +# define __WORDSIZE 32 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 +#endif + +#ifdef __x86_64__ +# define __WORDSIZE_TIME64_COMPAT32 1 +/* Both x86-64 and x32 use the 64-bit system call interface. */ +# define __SYSCALL_WORDSIZE 64 +#else +# define __WORDSIZE_TIME64_COMPAT32 0 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/complex.h b/lib/libc/include/generic-glibc/complex.h index 3a3de87d1e..9510f64101 100644 --- a/lib/libc/include/generic-glibc/complex.h +++ b/lib/libc/include/generic-glibc/complex.h @@ -95,11 +95,15 @@ __BEGIN_DECLS #define __MATHCALL(function, args) \ __MATHDECL (_Mdouble_complex_,function, args) -#define __MATHDECL(type, function, args) \ +#define __MATHDECL_IMPL(type, function, args) \ __MATHDECL_1(type, function, args); \ __MATHDECL_1(type, __CONCAT(__,function), args) -#define __MATHDECL_1(type, function, args) \ +#define __MATHDECL(type, function, args) \ + __MATHDECL_IMPL(type, function, args) +#define __MATHDECL_1_IMPL(type, function, args) \ extern type __MATH_PRECNAME(function) args __THROW +#define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) #define _Mdouble_ double #define __MATH_PRECNAME(name) name @@ -122,11 +126,31 @@ __BEGIN_DECLS # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# undef __MATHDECL_1 +# undef __MATHDECL +# define __REDIR_TO(function) \ + __ ## function ## ieee128 +# define __MATHDECL_1(type, function, alias, args) \ + extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, alias) +#define __MATHDECL(type, function, args) \ + __MATHDECL_1(type, function, __REDIR_TO(function), args); \ + __MATHDECL_1(type, __CONCAT(__,function), __REDIR_TO(function), args) # endif # define _Mdouble_ long double # define __MATH_PRECNAME(name) name##l # include +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# undef __REDIR_TO +# undef __MATHDECL_1 +# undef __MATHDECL +#define __MATHDECL(type, function, args) \ + __MATHDECL_IMPL(type, function, args) +# define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) +# endif #endif #undef _Mdouble_ #undef __MATH_PRECNAME @@ -215,6 +239,7 @@ __BEGIN_DECLS # undef _Mdouble_complex_ #endif +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL diff --git a/lib/libc/include/generic-glibc/elf.h b/lib/libc/include/generic-glibc/elf.h index de9cf6e57a..58b7bc8e2b 100644 --- a/lib/libc/include/generic-glibc/elf.h +++ b/lib/libc/include/generic-glibc/elf.h @@ -330,7 +330,7 @@ typedef struct #define EM_CLOUDSHIELD 192 /* CloudShield */ #define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */ #define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd gen. */ -#define EM_ARC_COMPACT2 195 /* Synopsys ARCompact V2 */ +#define EM_ARCV2 195 /* Synopsys ARCv2 ISA. */ #define EM_OPEN8 196 /* Open8 RISC */ #define EM_RL78 197 /* Renesas RL78 */ #define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */ @@ -721,6 +721,7 @@ typedef struct #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ +#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ @@ -1318,6 +1319,12 @@ typedef struct /* Application-specific semantics, hi */ #define GNU_PROPERTY_HIUSER 0xffffffff +/* AArch64 specific GNU properties. */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 + +#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) +#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) + /* The x86 instruction sets indicated by the corresponding bits are used in program. Their support in the hardware is optional. */ #define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 @@ -3946,8 +3953,9 @@ enum #define R_RISCV_SET16 55 #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 +#define R_RISCV_IRELATIVE 58 -#define R_RISCV_NUM 58 +#define R_RISCV_NUM 59 /* BPF specific declarations. */ @@ -4027,6 +4035,74 @@ enum #define R_NDS32_TLS_TPOFF 102 #define R_NDS32_TLS_DESC 119 +/* ARCompact/ARCv2 specific relocs. */ +#define R_ARC_NONE 0x0 +#define R_ARC_8 0x1 +#define R_ARC_16 0x2 +#define R_ARC_24 0x3 +#define R_ARC_32 0x4 +#define R_ARC_B26 0x5 +#define R_ARC_B22_PCREL 0x6 +#define R_ARC_H30 0x7 +#define R_ARC_N8 0x8 +#define R_ARC_N16 0x9 +#define R_ARC_N24 0xA +#define R_ARC_N32 0xB +#define R_ARC_SDA 0xC +#define R_ARC_SECTOFF 0xD +#define R_ARC_S21H_PCREL 0xE +#define R_ARC_S21W_PCREL 0xF +#define R_ARC_S25H_PCREL 0x10 +#define R_ARC_S25W_PCREL 0x11 +#define R_ARC_SDA32 0x12 +#define R_ARC_SDA_LDST 0x13 +#define R_ARC_SDA_LDST1 0x14 +#define R_ARC_SDA_LDST2 0x15 +#define R_ARC_SDA16_LD 0x16 +#define R_ARC_SDA16_LD1 0x17 +#define R_ARC_SDA16_LD2 0x18 +#define R_ARC_S13_PCREL 0x19 +#define R_ARC_W 0x1A +#define R_ARC_32_ME 0x1B +#define R_ARC_N32_ME 0x1C +#define R_ARC_SECTOFF_ME 0x1D +#define R_ARC_SDA32_ME 0x1E +#define R_ARC_W_ME 0x1F +#define R_ARC_H30_ME 0x20 +#define R_ARC_SECTOFF_U8 0x21 +#define R_ARC_SECTOFF_S9 0x22 +#define R_AC_SECTOFF_U8 0x23 +#define R_AC_SECTOFF_U8_1 0x24 +#define R_AC_SECTOFF_U8_2 0x25 +#define R_AC_SECTOFF_S9 0x26 +#define R_AC_SECTOFF_S9_1 0x27 +#define R_AC_SECTOFF_S9_2 0x28 +#define R_ARC_SECTOFF_ME_1 0x29 +#define R_ARC_SECTOFF_ME_2 0x2A +#define R_ARC_SECTOFF_1 0x2B +#define R_ARC_SECTOFF_2 0x2C +#define R_ARC_PC32 0x32 +#define R_ARC_GOTPC32 0x33 +#define R_ARC_PLT32 0x34 +#define R_ARC_COPY 0x35 +#define R_ARC_GLOB_DAT 0x36 +#define R_ARC_JUMP_SLOT 0x37 +#define R_ARC_RELATIVE 0x38 +#define R_ARC_GOTOFF 0x39 +#define R_ARC_GOTPC 0x3A +#define R_ARC_GOT32 0x3B + +#define R_ARC_TLS_DTPMOD 0x42 +#define R_ARC_TLS_DTPOFF 0x43 +#define R_ARC_TLS_TPOFF 0x44 +#define R_ARC_TLS_GD_GOT 0x45 +#define R_ARC_TLS_GD_LD 0x46 +#define R_ARC_TLS_GD_CALL 0x47 +#define R_ARC_TLS_IE_GOT 0x48 +#define R_ARC_TLS_DTPOFF_S9 0x4a +#define R_ARC_TLS_LE_S9 0x4a +#define R_ARC_TLS_LE_32 0x4b + __END_DECLS #endif /* elf.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/err.h b/lib/libc/include/generic-glibc/err.h index 90cb060734..f505f646b2 100644 --- a/lib/libc/include/generic-glibc/err.h +++ b/lib/libc/include/generic-glibc/err.h @@ -52,7 +52,8 @@ extern void errx (int __status, const char *__format, ...) extern void verrx (int __status, const char *, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/error.h b/lib/libc/include/generic-glibc/error.h index fa22157daf..dfd1623e1a 100644 --- a/lib/libc/include/generic-glibc/error.h +++ b/lib/libc/include/generic-glibc/error.h @@ -47,11 +47,13 @@ extern unsigned int error_message_count; variable controls whether this mode is selected or not. */ extern int error_one_per_line; -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #else /* Do not inline error and error_at_line when long double has the same - size of double, because that would invalidate the redirections to the + size of double, nor when long double reuses the float128 + implementation, because that would invalidate the redirections to the compatibility functions. */ # if defined __extern_always_inline && defined __va_arg_pack # include diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index 21e01848fa..ed3e1cd728 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -454,7 +454,7 @@ /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 -#define __GLIBC_MINOR__ 31 +#define __GLIBC_MINOR__ 32 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) diff --git a/lib/libc/include/generic-glibc/fenv.h b/lib/libc/include/generic-glibc/fenv.h index 0df8e06d17..833583f5b9 100644 --- a/lib/libc/include/generic-glibc/fenv.h +++ b/lib/libc/include/generic-glibc/fenv.h @@ -140,10 +140,6 @@ extern int fegetmode (femode_t *__modep) __THROW; extern int fesetmode (const femode_t *__modep) __THROW; #endif -/* Include optimization. */ -#ifdef __OPTIMIZE__ -# include -#endif /* NaN support. */ diff --git a/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h b/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h index d348de2ba8..c56f5fc16f 100644 --- a/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h +++ b/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h @@ -16,4 +16,28 @@ ! License along with the GNU C Library; if not, see ! . -! No SIMD math functions are available for this platform. \ No newline at end of file +!GCC$ builtin (cos) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sin) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sincos) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (log) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (logf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (exp) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (expf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (pow) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (powf) attributes simd (notinbranch) if('x86_64') + +!GCC$ builtin (cos) attributes simd (notinbranch) if('x32') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sin) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sincos) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (log) attributes simd (notinbranch) if('x32') +!GCC$ builtin (logf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (exp) attributes simd (notinbranch) if('x32') +!GCC$ builtin (expf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (pow) attributes simd (notinbranch) if('x32') +!GCC$ builtin (powf) attributes simd (notinbranch) if('x32') \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/fpu_control.h b/lib/libc/include/generic-glibc/fpu_control.h index d5aa21113b..fa0a861923 100644 --- a/lib/libc/include/generic-glibc/fpu_control.h +++ b/lib/libc/include/generic-glibc/fpu_control.h @@ -1,6 +1,7 @@ -/* FPU control word bits. Mips version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* FPU control word bits. x86 version. + Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Olaf Flebbe. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,120 +14,96 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H +#define _FPU_CONTROL_H 1 -/* MIPS FPU floating point control register bits. +/* Note that this file sets on x86-64 only the x87 FPU, it does not + touch the SSE unit. */ + +/* Here is the dirty part. Set up your 387 through the control word + * (cw) register. * - * 31-25 -> floating point conditions code bits 7-1. These bits are only - * available in MIPS IV. - * 24 -> flush denormalized results to zero instead of - * causing unimplemented operation exception. This bit is only - * available for MIPS III and newer. - * 23 -> Condition bit - * 22-21 -> reserved for architecture implementers - * 20 -> reserved (read as 0, write with 0) - * 19 -> IEEE 754-2008 non-arithmetic ABS.fmt and NEG.fmt enable - * 18 -> IEEE 754-2008 recommended NaN encoding enable - * 17 -> cause bit for unimplemented operation - * 16 -> cause bit for invalid exception - * 15 -> cause bit for division by zero exception - * 14 -> cause bit for overflow exception - * 13 -> cause bit for underflow exception - * 12 -> cause bit for inexact exception - * 11 -> enable exception for invalid exception - * 10 -> enable exception for division by zero exception - * 9 -> enable exception for overflow exception - * 8 -> enable exception for underflow exception - * 7 -> enable exception for inexact exception - * 6 -> flag invalid exception - * 5 -> flag division by zero exception - * 4 -> flag overflow exception - * 3 -> flag underflow exception - * 2 -> flag inexact exception - * 1-0 -> rounding control + * 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0 + * | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM * + * IM: Invalid operation mask + * DM: Denormalized operand mask + * ZM: Zero-divide mask + * OM: Overflow mask + * UM: Underflow mask + * PM: Precision (inexact result) mask * - * Rounding Control: - * 00 - rounding to nearest (RN) - * 01 - rounding toward zero (RZ) - * 10 - rounding (up) toward plus infinity (RP) - * 11 - rounding (down)toward minus infinity (RM) + * Mask bit is 1 means no interrupt. + * + * PC: Precision control + * 11 - round to extended precision + * 10 - round to double precision + * 00 - round to single precision + * + * RC: Rounding control + * 00 - rounding to nearest + * 01 - rounding down (toward - infinity) + * 10 - rounding up (toward + infinity) + * 11 - rounding toward zero + * + * IC: Infinity control + * That is for 8087 and 80287 only. + * + * The hardware default is 0x037f which we use. */ #include -#ifdef __mips_soft_float +/* masking of interrupts */ +#define _FPU_MASK_IM 0x01 +#define _FPU_MASK_DM 0x02 +#define _FPU_MASK_ZM 0x04 +#define _FPU_MASK_OM 0x08 +#define _FPU_MASK_UM 0x10 +#define _FPU_MASK_PM 0x20 -#define _FPU_RESERVED 0xffffffff -#define _FPU_DEFAULT 0x00000000 -typedef unsigned int fpu_control_t; -#define _FPU_GETCW(cw) (cw) = 0 -#define _FPU_SETCW(cw) (void) (cw) -extern fpu_control_t __fpu_control; +/* precision control */ +#define _FPU_EXTENDED 0x300 /* libm requires double extended precision. */ +#define _FPU_DOUBLE 0x200 +#define _FPU_SINGLE 0x0 -#else /* __mips_soft_float */ +/* rounding control */ +#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ +#define _FPU_RC_DOWN 0x400 +#define _FPU_RC_UP 0x800 +#define _FPU_RC_ZERO 0xC00 -/* Masks for interrupts. */ -#define _FPU_MASK_V 0x0800 /* Invalid operation */ -#define _FPU_MASK_Z 0x0400 /* Division by zero */ -#define _FPU_MASK_O 0x0200 /* Overflow */ -#define _FPU_MASK_U 0x0100 /* Underflow */ -#define _FPU_MASK_I 0x0080 /* Inexact operation */ - -/* Flush denormalized numbers to zero. */ -#define _FPU_FLUSH_TZ 0x1000000 - -/* IEEE 754-2008 compliance control. */ -#define _FPU_ABS2008 0x80000 -#define _FPU_NAN2008 0x40000 - -/* Rounding control. */ -#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ -#define _FPU_RC_ZERO 0x1 -#define _FPU_RC_UP 0x2 -#define _FPU_RC_DOWN 0x3 -/* Mask for rounding control. */ -#define _FPU_RC_MASK 0x3 - -#define _FPU_RESERVED 0xfe8c0000 /* Reserved bits in cw, incl ABS/NAN2008. */ +#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */ /* The fdlibm code requires strict IEEE double precision arithmetic, and no interrupts for exceptions, rounding to nearest. */ -#ifdef __mips_nan2008 -# define _FPU_DEFAULT 0x000C0000 -#else -# define _FPU_DEFAULT 0x00000000 -#endif -/* IEEE: same as above, but exceptions. */ -#ifdef __mips_nan2008 -# define _FPU_IEEE 0x000C0F80 -#else -# define _FPU_IEEE 0x00000F80 -#endif +#define _FPU_DEFAULT 0x037f + +/* IEEE: same as above. */ +#define _FPU_IEEE 0x037f /* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); +typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); -/* Macros for accessing the hardware control word. */ -extern fpu_control_t __mips_fpu_getcw (void) __THROW; -extern void __mips_fpu_setcw (fpu_control_t) __THROW; -#ifdef __mips16 -# define _FPU_GETCW(cw) do { (cw) = __mips_fpu_getcw (); } while (0) -# define _FPU_SETCW(cw) __mips_fpu_setcw (cw) -#else -# define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw)) -# define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw)) -#endif +/* Macros for accessing the hardware control word. "*&" is used to + work around a bug in older versions of GCC. __volatile__ is used + to support combination of writing the control register and reading + it back. Without __volatile__, the old value may be used for reading + back under compiler optimization. + + Note that the use of these macros is not sufficient anymore with + recent hardware nor on x86-64. Some floating point operations are + executed in the SSE/SSE2 engines which have their own control and + status register. */ +#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw)) +#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw)) /* Default control word set at startup. */ extern fpu_control_t __fpu_control; -#endif /* __mips_soft_float */ - #endif /* fpu_control.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-32.h b/lib/libc/include/generic-glibc/gnu/lib-names-32.h index 910a12d444..3e05ce280d 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-32.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-32.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h index 9c4e7c164e..dd2cb9fb78 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h index d6c1d96f7e..4ec7514060 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h index b5af4b1542..1f8eed349b 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h index 4746766acf..8a3a04cb2d 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h index 14dc0082b0..3c3e1769fa 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names.h b/lib/libc/include/generic-glibc/gnu/lib-names.h index fcfc96cef1..aafc03bf7e 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names.h @@ -4,43 +4,14 @@ #ifndef __GNU_LIB_NAMES_H #define __GNU_LIB_NAMES_H 1 -#include - -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if !defined __x86_64__ +# include #endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if defined __x86_64__ && defined __LP64__ +# include #endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include +#if defined __x86_64__ && defined __ILP32__ +# include #endif #endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-32.h b/lib/libc/include/generic-glibc/gnu/stubs-32.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-32.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-32.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-64.h b/lib/libc/include/generic-glibc/gnu/stubs-64.h deleted file mode 100644 index 12c0d956e8..0000000000 --- a/lib/libc/include/generic-glibc/gnu/stubs-64.h +++ /dev/null @@ -1,18 +0,0 @@ -/* This file is automatically generated. - It defines a symbol `__stub_FUNCTION' for each function - in the C library which is a stub, meaning it will fail - every time called, usually setting errno to ENOSYS. */ - -#ifdef _LIBC - #error Applications may not define the macro _LIBC -#endif - -#define __stub_chflags -#define __stub_fchflags -#define __stub_gtty -#define __stub_lchmod -#define __stub_revoke -#define __stub_setlogin -#define __stub_sigreturn -#define __stub_sstk -#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-hard.h b/lib/libc/include/generic-glibc/gnu/stubs-hard.h index add0d4871d..013aed511c 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-hard.h @@ -13,9 +13,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h index d4c69865ed..186070157a 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h @@ -12,9 +12,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h index d4c69865ed..186070157a 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h @@ -12,9 +12,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-soft.h b/lib/libc/include/generic-glibc/gnu/stubs-soft.h index add0d4871d..013aed511c 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-soft.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-soft.h @@ -13,9 +13,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs.h b/lib/libc/include/generic-glibc/gnu/stubs.h index 96ececfa31..a4c9b5f097 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs.h +++ b/lib/libc/include/generic-glibc/gnu/stubs.h @@ -2,41 +2,13 @@ This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ -#include -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if !defined __x86_64__ +# include #endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if defined __x86_64__ && defined __LP64__ +# include #endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include +#if defined __x86_64__ && defined __ILP32__ +# include #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/inttypes.h b/lib/libc/include/generic-glibc/inttypes.h index 61b4464bb3..7734ebce74 100644 --- a/lib/libc/include/generic-glibc/inttypes.h +++ b/lib/libc/include/generic-glibc/inttypes.h @@ -321,10 +321,10 @@ extern long int __strtol_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtol_internal (nptr, endptr, base, 0); + return __strtol_internal (__nptr, __endptr, __base, 0); } extern unsigned long int __strtoul_internal (const char *__restrict __nptr, @@ -333,10 +333,10 @@ extern unsigned long int __strtoul_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtoul_internal (nptr, endptr, base, 0); + return __strtoul_internal (__nptr, __endptr, __base, 0); } extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, @@ -345,10 +345,10 @@ extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoimax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstol_internal (nptr, endptr, base, 0); + return __wcstol_internal (__nptr, __endptr, __base, 0); } extern unsigned long int __wcstoul_internal (const __gwchar_t * @@ -359,10 +359,10 @@ extern unsigned long int __wcstoul_internal (const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoumax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstoul_internal (nptr, endptr, base, 0); + return __wcstoul_internal (__nptr, __endptr, __base, 0); } # else /* __WORDSIZE == 32 */ @@ -374,10 +374,10 @@ extern long long int __strtoll_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtoll_internal (nptr, endptr, base, 0); + return __strtoll_internal (__nptr, __endptr, __base, 0); } __extension__ @@ -390,10 +390,10 @@ extern unsigned long long int __strtoull_internal (const char * __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtoull_internal (nptr, endptr, base, 0); + return __strtoull_internal (__nptr, __endptr, __base, 0); } __extension__ @@ -403,10 +403,10 @@ extern long long int __wcstoll_internal (const __gwchar_t *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoimax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstoll_internal (nptr, endptr, base, 0); + return __wcstoll_internal (__nptr, __endptr, __base, 0); } @@ -420,10 +420,10 @@ extern unsigned long long int __wcstoull_internal (const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoumax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstoull_internal (nptr, endptr, base, 0); + return __wcstoull_internal (__nptr, __endptr, __base, 0); } # endif /* __WORDSIZE == 32 */ diff --git a/lib/libc/include/generic-glibc/malloc.h b/lib/libc/include/generic-glibc/malloc.h index ebddb55e58..fd73ea1c79 100644 --- a/lib/libc/include/generic-glibc/malloc.h +++ b/lib/libc/include/generic-glibc/malloc.h @@ -75,11 +75,11 @@ extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ -extern void *(*__morecore) (ptrdiff_t __size); +extern void *(*__morecore) (ptrdiff_t __size) __MALLOC_DEPRECATED; /* Default value of `__morecore'. */ extern void *__default_morecore (ptrdiff_t __size) -__THROW __attribute_malloc__; +__THROW __attribute_malloc__ __MALLOC_DEPRECATED; /* SVID2/XPG mallinfo structure */ @@ -156,7 +156,8 @@ extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment, size_t __size, const void *) __MALLOC_DEPRECATED; -extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); +extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void) + __MALLOC_DEPRECATED; __END_DECLS diff --git a/lib/libc/include/generic-glibc/math.h b/lib/libc/include/generic-glibc/math.h index 9b3f228199..1956311cb8 100644 --- a/lib/libc/include/generic-glibc/math.h +++ b/lib/libc/include/generic-glibc/math.h @@ -279,8 +279,17 @@ enum #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) -#define __MATHDECL_1(type, function,suffix, args) \ +#define __MATHDECL_1_IMPL(type, function, suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW +#define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) +/* Ignore the alias by default. The alias is only useful with + redirections. */ +#define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHDECL_1(type, function, suffix, args) + +#define __MATHREDIR(type, function, suffix, args, to) \ + extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -331,11 +340,37 @@ extern long double __REDIRECT_NTH (nexttowardl, # endif # undef __MATHDECL_1 -# define __MATHDECL_2(type, function,suffix, args, alias) \ - extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ - args, alias) # define __MATHDECL_1(type, function,suffix, args) \ - __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) + __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) + +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT_NTH +# ifdef __USE_ISOC99 +extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), + __nexttowardf_to_ieee128) + __attribute__ ((__const__)); +extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), + __nexttoward_to_ieee128) + __attribute__ ((__const__)); + +#define __dremieee128 __remainderieee128 +#define __gammaieee128 __lgammaieee128 + +# endif +# endif + +# undef __MATHDECL_1 +# undef __MATHDECL_ALIAS + +# define __REDIRTO(function, suffix) \ + __ ## function ## ieee128 ## suffix +# define __REDIRTO_ALT(function, suffix) \ + __ ## function ## f128 ## suffix + +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHREDIR (type, function, suffix, args, __REDIRTO (function, suffix)) +# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHREDIR (type, function, suffix, args, __REDIRTO_ALT (alias, suffix)) # endif /* Include the file of declarations again, this time using `long double' @@ -348,11 +383,23 @@ extern long double __REDIRECT_NTH (nexttowardl, # define __MATH_DECLARE_LDOUBLE 1 # include # include + # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# undef __REDIRTO +# undef __REDIRTO_ALT +# undef __MATHDECL_1 +# undef __MATHDECL_ALIAS +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) +# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHDECL_1(type, function, suffix, args) +# endif # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ @@ -479,7 +526,9 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 +#undef __MATHDECL_ALIAS #undef __MATHDECL #undef __MATHCALL @@ -511,6 +560,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) f ## name # undef __MATHCALL_NARROW +# define __MATHCALL_NARROW(func, redir, nargs) \ + __MATHCALL_NARROW_REDIR (func, redir, nargs) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# define __MATHCALL_REDIR_NAME(name) __ ## f32 ## name ## ieee128 +# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -518,7 +572,8 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# ifdef __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -531,6 +586,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) __nldbl_d ## name ## l # undef __MATHCALL_NARROW +# define __MATHCALL_NARROW(func, redir, nargs) \ + __MATHCALL_NARROW_REDIR (func, redir, nargs) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# define __MATHCALL_REDIR_NAME(name) __ ## f64 ## name ## ieee128 +# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -538,7 +598,8 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# ifdef __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -1196,13 +1257,6 @@ iszero (__T __val) # error "M_* values needed for _Float128x" #endif -/* When compiling in strict ISO C compatible mode we must not use the - inline functions since they, among other things, do not set the - `errno' variable correctly. */ -#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES -# define __NO_MATH_INLINES 1 -#endif - #ifdef __USE_ISOC99 # if __GNUC_PREREQ (3, 1) /* ISO C99 defines some macros to compare number while taking care for @@ -1240,12 +1294,6 @@ iszero (__T __val) # endif #endif -/* Get machine-dependent inline versions (if there are any). */ -#ifdef __USE_EXTERN_INLINES -# include -#endif - - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ diff --git a/lib/libc/include/generic-glibc/monetary.h b/lib/libc/include/generic-glibc/monetary.h index d7789d087a..e8142d7b07 100644 --- a/lib/libc/include/generic-glibc/monetary.h +++ b/lib/libc/include/generic-glibc/monetary.h @@ -50,7 +50,8 @@ extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize, __THROW __attribute_format_strfmon__ (4, 5); #endif -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/netinet/icmp6.h b/lib/libc/include/generic-glibc/netinet/icmp6.h index 0d1da5d26c..8f030dd8f9 100644 --- a/lib/libc/include/generic-glibc/netinet/icmp6.h +++ b/lib/libc/include/generic-glibc/netinet/icmp6.h @@ -85,16 +85,16 @@ struct icmp6_hdr #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized IPv6 option */ #define ICMP6_FILTER_WILLPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) + ((((filterp)->icmp6_filt[(type) >> 5]) & (1U << ((type) & 31))) == 0) #define ICMP6_FILTER_WILLBLOCK(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) + ((((filterp)->icmp6_filt[(type) >> 5]) & (1U << ((type) & 31))) != 0) #define ICMP6_FILTER_SETPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))) + ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1U << ((type) & 31)))) #define ICMP6_FILTER_SETBLOCK(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))) + ((((filterp)->icmp6_filt[(type) >> 5]) |= (1U << ((type) & 31)))) #define ICMP6_FILTER_SETPASSALL(filterp) \ memset (filterp, 0, sizeof (struct icmp6_filter)); diff --git a/lib/libc/include/generic-glibc/netinet/in.h b/lib/libc/include/generic-glibc/netinet/in.h index bcca1ad51e..ae09a54121 100644 --- a/lib/libc/include/generic-glibc/netinet/in.h +++ b/lib/libc/include/generic-glibc/netinet/in.h @@ -87,8 +87,12 @@ enum #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_MPLS = 137, /* MPLS in IP. */ #define IPPROTO_MPLS IPPROTO_MPLS + IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation. */ +#define IPPROTO_ETHERNET IPPROTO_ETHERNET IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW + IPPROTO_MPTCP = 262, /* Multipath TCP connection. */ +#define IPPROTO_MPTCP IPPROTO_MPTCP IPPROTO_MAX }; diff --git a/lib/libc/include/generic-glibc/nss.h b/lib/libc/include/generic-glibc/nss.h index d24028cc4f..f17defc30f 100644 --- a/lib/libc/include/generic-glibc/nss.h +++ b/lib/libc/include/generic-glibc/nss.h @@ -19,10 +19,12 @@ and for implementors of new services. */ #ifndef _NSS_H -#define _NSS_H 1 +#define _NSS_H 1 #include +#include #include +#include __BEGIN_DECLS @@ -56,7 +58,204 @@ struct gaih_addrtuple Attention: Using this function repeatedly will slowly eat up the whole memory since previous selection data cannot be freed. */ extern int __nss_configure_lookup (const char *__dbname, - const char *__string) __THROW; + const char *__string) __THROW; + +/* NSS-related types. */ +struct __netgrent; +struct aliasent; +struct ether_addr; +struct etherent; +struct group; +struct hostent; +struct netent; +struct passwd; +struct protoent; +struct rpcent; +struct servent; +struct sgrp; +struct spwd; +struct traced_file; + +/* Types of functions exported from NSS service modules. */ +typedef enum nss_status nss_endaliasent (void); +typedef enum nss_status nss_endetherent (void); +typedef enum nss_status nss_endgrent (void); +typedef enum nss_status nss_endhostent (void); +typedef enum nss_status nss_endnetent (void); +typedef enum nss_status nss_endnetgrent (struct __netgrent *); +typedef enum nss_status nss_endprotoent (void); +typedef enum nss_status nss_endpwent (void); +typedef enum nss_status nss_endrpcent (void); +typedef enum nss_status nss_endservent (void); +typedef enum nss_status nss_endsgent (void); +typedef enum nss_status nss_endspent (void); +typedef enum nss_status nss_getaliasbyname_r (const char *, struct aliasent *, + char *, size_t, int *); +typedef enum nss_status nss_getaliasent_r (struct aliasent *, + char *, size_t, int *); +typedef enum nss_status nss_getcanonname_r (const char *, char *, size_t, + char **, int *, int *); +typedef enum nss_status nss_getetherent_r (struct etherent *, + char *, size_t, int *); +typedef enum nss_status nss_getgrent_r (struct group *, char *, size_t, int *); +typedef enum nss_status nss_getgrgid_r (__gid_t, struct group *, + char *, size_t, int *); +typedef enum nss_status nss_getgrnam_r (const char *, struct group *, + char *, size_t, int *); +typedef enum nss_status nss_gethostbyaddr2_r (const void *, __socklen_t, int, + struct hostent *, char *, size_t, + int *, int *, int32_t *); +typedef enum nss_status nss_gethostbyaddr_r (const void *, __socklen_t, int, + struct hostent *, char *, size_t, + int *, int *); +typedef enum nss_status nss_gethostbyname2_r (const char *, int, + struct hostent *, char *, size_t, + int *, int *); +typedef enum nss_status nss_gethostbyname3_r (const char *, int, + struct hostent *, char *, size_t, + int *, int *, int32_t *, + char **); +typedef enum nss_status nss_gethostbyname4_r (const char *, + struct gaih_addrtuple **, + char *, size_t, + int *, int *, int32_t *); +typedef enum nss_status nss_gethostbyname_r (const char *, struct hostent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_gethostent_r (struct hostent *, char *, size_t, + int *, int *); +typedef enum nss_status nss_gethostton_r (const char *, struct etherent *, + char *, size_t, int *); +typedef enum nss_status nss_getnetbyaddr_r (uint32_t, int, struct netent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_getnetbyname_r (const char *, struct netent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_getnetent_r (struct netent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_getnetgrent_r (struct __netgrent *, + char *, size_t, int *); +typedef enum nss_status nss_getntohost_r (const struct ether_addr *, + struct etherent *, char *, size_t, + int *); +typedef enum nss_status nss_getprotobyname_r (const char *, struct protoent *, + char *, size_t, int *); +typedef enum nss_status nss_getprotobynumber_r (int, struct protoent *, + char *, size_t, int *); +typedef enum nss_status nss_getprotoent_r (struct protoent *, + char *, size_t, int *); +typedef enum nss_status nss_getpublickey (const char *, char *, int *); +typedef enum nss_status nss_getpwent_r (struct passwd *, + char *, size_t, int *); +typedef enum nss_status nss_getpwnam_r (const char *, struct passwd *, + char *, size_t, int *); +typedef enum nss_status nss_getpwuid_r (__uid_t, struct passwd *, + char *, size_t, int *); +typedef enum nss_status nss_getrpcbyname_r (const char *, struct rpcent *, + char *, size_t, int *); +typedef enum nss_status nss_getrpcbynumber_r (int, struct rpcent *, + char *, size_t, int *); +typedef enum nss_status nss_getrpcent_r (struct rpcent *, + char *, size_t, int *); +typedef enum nss_status nss_getsecretkey (const char *, char *, char *, int *); +typedef enum nss_status nss_getservbyname_r (const char *, const char *, + struct servent *, char *, size_t, + int *); +typedef enum nss_status nss_getservbyport_r (int, const char *, + struct servent *, char *, size_t, + int *); +typedef enum nss_status nss_getservent_r (struct servent *, char *, size_t, + int *); +typedef enum nss_status nss_getsgent_r (struct sgrp *, char *, size_t, int *); +typedef enum nss_status nss_getsgnam_r (const char *, struct sgrp *, + char *, size_t, int *); +typedef enum nss_status nss_getspent_r (struct spwd *, char *, size_t, int *); +typedef enum nss_status nss_getspnam_r (const char *, struct spwd *, + char *, size_t, int *); +typedef void nss_init (void (*) (size_t, struct traced_file *)); +typedef enum nss_status nss_initgroups_dyn (const char *, __gid_t, long int *, + long int *, __gid_t **, long int, + int *); +typedef enum nss_status nss_netname2user (char [], __uid_t *, __gid_t *, + int *, __gid_t *, int *); +typedef enum nss_status nss_setaliasent (void); +typedef enum nss_status nss_setetherent (int); +typedef enum nss_status nss_setgrent (int); +typedef enum nss_status nss_sethostent (int); +typedef enum nss_status nss_setnetent (int); +typedef enum nss_status nss_setnetgrent (const char *, struct __netgrent *); +typedef enum nss_status nss_setprotoent (int); +typedef enum nss_status nss_setpwent (int); +typedef enum nss_status nss_setrpcent (int); +typedef enum nss_status nss_setservent (int); +typedef enum nss_status nss_setsgent (int); +typedef enum nss_status nss_setspent (int); + +/* Declare all NSS functions for MODULE. */ +#define NSS_DECLARE_MODULE_FUNCTIONS(module) \ + extern nss_endaliasent _nss_##module##_endaliasent; \ + extern nss_endetherent _nss_##module##_endetherent; \ + extern nss_endgrent _nss_##module##_endgrent; \ + extern nss_endhostent _nss_##module##_endhostent; \ + extern nss_endnetent _nss_##module##_endnetent; \ + extern nss_endnetgrent _nss_##module##__endnetgrent; \ + extern nss_endprotoent _nss_##module##_endprotoent; \ + extern nss_endpwent _nss_##module##_endpwent; \ + extern nss_endrpcent _nss_##module##_endrpcent; \ + extern nss_endservent _nss_##module##_endservent; \ + extern nss_endsgent _nss_##module##_endsgent; \ + extern nss_endspent _nss_##module##_endspent; \ + extern nss_getaliasbyname_r _nss_##module##_getaliasbyname_r; \ + extern nss_getaliasent_r _nss_##module##_getaliasent_r; \ + extern nss_getcanonname_r _nss_##module##_getcanonname_r; \ + extern nss_getetherent_r _nss_##module##_getetherent_r; \ + extern nss_getgrent_r _nss_##module##_getgrent_r; \ + extern nss_getgrgid_r _nss_##module##_getgrgid_r; \ + extern nss_getgrnam_r _nss_##module##_getgrnam_r; \ + extern nss_gethostbyaddr2_r _nss_##module##_gethostbyaddr2_r; \ + extern nss_gethostbyaddr_r _nss_##module##_gethostbyaddr_r; \ + extern nss_gethostbyname2_r _nss_##module##_gethostbyname2_r; \ + extern nss_gethostbyname3_r _nss_##module##_gethostbyname3_r; \ + extern nss_gethostbyname4_r _nss_##module##_gethostbyname4_r; \ + extern nss_gethostbyname_r _nss_##module##_gethostbyname_r; \ + extern nss_gethostent_r _nss_##module##_gethostent_r; \ + extern nss_gethostton_r _nss_##module##_gethostton_r; \ + extern nss_getnetbyaddr_r _nss_##module##_getnetbyaddr_r; \ + extern nss_getnetbyname_r _nss_##module##_getnetbyname_r; \ + extern nss_getnetent_r _nss_##module##_getnetent_r; \ + extern nss_getnetgrent_r _nss_##module##_getnetgrent_r; \ + extern nss_getntohost_r _nss_##module##_getntohost_r; \ + extern nss_getprotobyname_r _nss_##module##_getprotobyname_r; \ + extern nss_getprotobynumber_r _nss_##module##_getprotobynumber_r; \ + extern nss_getprotoent_r _nss_##module##_getprotoent_r; \ + extern nss_getpublickey _nss_##module##_getpublickey; \ + extern nss_getpwent_r _nss_##module##_getpwent_r; \ + extern nss_getpwnam_r _nss_##module##_getpwnam_r; \ + extern nss_getpwuid_r _nss_##module##_getpwuid_r; \ + extern nss_getrpcbyname_r _nss_##module##_getrpcbyname_r; \ + extern nss_getrpcbynumber_r _nss_##module##_getrpcbynumber_r; \ + extern nss_getrpcent_r _nss_##module##_getrpcent_r; \ + extern nss_getsecretkey _nss_##module##_getsecretkey; \ + extern nss_getservbyname_r _nss_##module##_getservbyname_r; \ + extern nss_getservbyport_r _nss_##module##_getservbyport_r; \ + extern nss_getservent_r _nss_##module##_getservent_r; \ + extern nss_getsgent_r _nss_##module##_getsgent_r; \ + extern nss_getsgnam_r _nss_##module##_getsgnam_r; \ + extern nss_getspent_r _nss_##module##_getspent_r; \ + extern nss_getspnam_r _nss_##module##_getspnam_r; \ + extern nss_init _nss_##module##_init; \ + extern nss_initgroups_dyn _nss_##module##_initgroups_dyn; \ + extern nss_netname2user _nss_##module##_netname2user; \ + extern nss_setaliasent _nss_##module##_setaliasent; \ + extern nss_setetherent _nss_##module##_setetherent; \ + extern nss_setgrent _nss_##module##_setgrent; \ + extern nss_sethostent _nss_##module##_sethostent; \ + extern nss_setnetent _nss_##module##_setnetent; \ + extern nss_setnetgrent _nss_##module##_setnetgrent; \ + extern nss_setprotoent _nss_##module##_setprotoent; \ + extern nss_setpwent _nss_##module##_setpwent; \ + extern nss_setrpcent _nss_##module##_setrpcent; \ + extern nss_setservent _nss_##module##_setservent; \ + extern nss_setsgent _nss_##module##_setsgent; \ + extern nss_setspent _nss_##module##_setspent; \ __END_DECLS diff --git a/lib/libc/include/generic-glibc/printf.h b/lib/libc/include/generic-glibc/printf.h index eaf489649e..ac8ae173af 100644 --- a/lib/libc/include/generic-glibc/printf.h +++ b/lib/libc/include/generic-glibc/printf.h @@ -182,7 +182,8 @@ extern int printf_size_info (const struct printf_info *__restrict __info, size_t __n, int *__restrict __argtypes) __THROW; -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/pthread.h b/lib/libc/include/generic-glibc/pthread.h index b9914a0d45..efa17507b6 100644 --- a/lib/libc/include/generic-glibc/pthread.h +++ b/lib/libc/include/generic-glibc/pthread.h @@ -27,6 +27,7 @@ #include #include #include +#include /* Detach state. */ @@ -385,6 +386,20 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, extern int pthread_getattr_default_np (pthread_attr_t *__attr) __THROW __nonnull ((1)); +/* Store *SIGMASK as the signal mask for the new thread in *ATTR. */ +extern int pthread_attr_setsigmask_np (pthread_attr_t *__attr, + const __sigset_t *sigmask); + +/* Store the signal mask of *ATTR in *SIGMASK. If there is no signal + mask stored, return PTHREAD_ATTR_NOSIGMASK_NP. Return zero on + success. */ +extern int pthread_attr_getsigmask_np (const pthread_attr_t *__attr, + __sigset_t *sigmask); + +/* Special return value from pthread_attr_getsigmask_np if the signal + mask has not been set. */ +#define PTHREAD_ATTR_NO_SIGMASK_NP (-1) + /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np (const pthread_attr_t *__attr) diff --git a/lib/libc/include/generic-glibc/signal.h b/lib/libc/include/generic-glibc/signal.h index 7fa19ea215..91b7be3621 100644 --- a/lib/libc/include/generic-glibc/signal.h +++ b/lib/libc/include/generic-glibc/signal.h @@ -27,7 +27,7 @@ __BEGIN_DECLS #include -#include +#include #include @@ -148,7 +148,8 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s); #ifdef __USE_XOPEN_EXTENDED # ifdef __GNUC__ -extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); +extern int sigpause (int __sig) __asm__ ("__xpg_sigpause") + __attribute_deprecated_msg__ ("Use the sigsuspend function instead"); # else extern int __sigpause (int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ @@ -164,7 +165,9 @@ extern int __sigpause (int __sig_or_mask, int __is_sig); simply do not work in many situations. Use `sigprocmask' instead. */ /* Compute mask for signal SIG. */ -# define sigmask(sig) ((int)(1u << ((sig) - 1))) +# define sigmask(sig) \ + __glibc_macro_warning ("sigmask is deprecated") \ + ((int)(1u << ((sig) - 1))) /* Block signals in MASK, returning the old mask. */ extern int sigblock (int __mask) __THROW __attribute_deprecated__; @@ -281,12 +284,6 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) #ifdef __USE_MISC -/* Names of the signals. This variable exists only for compatibility. - Use `strsignal' instead (see ). */ -extern const char *const _sys_siglist[_NSIG]; -extern const char *const sys_siglist[_NSIG]; - - /* Get machine-dependent `struct sigcontext' and signal subcodes. */ # include @@ -311,7 +308,8 @@ extern int sigreturn (struct sigcontext *__scp) __THROW; /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ -extern int siginterrupt (int __sig, int __interrupt) __THROW; +extern int siginterrupt (int __sig, int __interrupt) __THROW + __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead"); # include # include @@ -340,16 +338,21 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ -extern int sighold (int __sig) __THROW; +extern int sighold (int __sig) __THROW + __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); /* Remove SIG from the calling process' signal mask. */ -extern int sigrelse (int __sig) __THROW; +extern int sigrelse (int __sig) __THROW + __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); /* Set the disposition of SIG to SIG_IGN. */ -extern int sigignore (int __sig) __THROW; +extern int sigignore (int __sig) __THROW + __attribute_deprecated_msg__ ("Use the signal function instead"); /* Set the disposition of SIG. */ -extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW; +extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW + __attribute_deprecated_msg__ + ("Use the signal and sigprocmask functions instead"); #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 diff --git a/lib/libc/include/generic-glibc/stdio.h b/lib/libc/include/generic-glibc/stdio.h index 7b5485826b..f83759406f 100644 --- a/lib/libc/include/generic-glibc/stdio.h +++ b/lib/libc/include/generic-glibc/stdio.h @@ -400,9 +400,12 @@ extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; /* For historical reasons, the C99-compliant versions of the scanf - functions are at alternative names. When __LDBL_COMPAT is in - effect, this is handled in bits/stdio-ldbl.h. */ -#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT + functions are at alternative names. When __LDBL_COMPAT or + __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in + bits/stdio-ldbl.h. */ +#include +#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), @@ -447,7 +450,8 @@ extern int vsscanf (const char *__restrict __s, /* Same redirection as above for the v*scanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __REDIRECT && !defined __LDBL_COMPAT +# if defined __REDIRECT && !defined __LDBL_COMPAT \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 extern int __REDIRECT (vfscanf, (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg), @@ -562,7 +566,7 @@ extern int putw (int __w, FILE *__stream); This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) - __wur; + __wur __attr_access ((__write_only__, 1, 2)); #if __GLIBC_USE (DEPRECATED_GETS) /* Get a newline-terminated string from stdin, removing the newline. @@ -585,7 +589,8 @@ extern char *gets (char *__s) __wur __attribute_deprecated__; or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked (char *__restrict __s, int __n, - FILE *__restrict __stream) __wur; + FILE *__restrict __stream) __wur + __attr_access ((__write_only__, 1, 2)); #endif @@ -774,12 +779,6 @@ extern int ferror_unlocked (FILE *__stream) __THROW __wur; marked with __THROW. */ extern void perror (const char *__s); -/* Provide the declarations for `sys_errlist' and `sys_nerr' if they - are available on this system. Even if available, these variables - should not be used directly. The `strerror' function provides - all the necessary functionality. */ -#include - #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ @@ -866,7 +865,9 @@ extern int __overflow (FILE *, int); #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif -#ifdef __LDBL_COMPAT + +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/stdlib.h b/lib/libc/include/generic-glibc/stdlib.h index 115bcee92d..3ffc3703d4 100644 --- a/lib/libc/include/generic-glibc/stdlib.h +++ b/lib/libc/include/generic-glibc/stdlib.h @@ -397,7 +397,7 @@ extern long int a64l (const char *__s) `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ -/* Return a random long integer between 0 and RAND_MAX inclusive. */ +/* Return a random long integer between 0 and 2^31-1 inclusive. */ extern long int random (void) __THROW; /* Seed the random number generator with the given number. */ @@ -931,12 +931,13 @@ extern int wctomb (char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs (wchar_t *__restrict __pwcs, - const char *__restrict __s, size_t __n) __THROW; + const char *__restrict __s, size_t __n) __THROW + __attr_access ((__read_only__, 2)); /* Convert a wide char string to multibyte string. */ extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) - __THROW; - + __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation @@ -990,7 +991,7 @@ extern char *ptsname (int __fd) __THROW __wur; terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)); + __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt (void); @@ -1016,7 +1017,9 @@ extern int ttyslot (void) __THROW; #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif -#ifdef __LDBL_COMPAT + +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/string.h b/lib/libc/include/generic-glibc/string.h index 423cc537ed..99d5158b5a 100644 --- a/lib/libc/include/generic-glibc/string.h +++ b/lib/libc/include/generic-glibc/string.h @@ -53,7 +53,7 @@ extern void *memmove (void *__dest, const void *__src, size_t __n) #if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC2X) extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) - __THROW __nonnull ((1, 2)); + __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4)); #endif /* Misc || X/Open. */ @@ -108,12 +108,15 @@ extern void *rawmemchr (const void *__s, int __c) /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr (void *__s, int __c, size_t __n) - __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); + __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)) + __attr_access ((__read_only__, 1, 3)); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) - __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); + __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)) + __attr_access ((__read_only__, 1, 3)); # else extern void *memrchr (const void *__s, int __c, size_t __n) - __THROW __attribute_pure__ __nonnull ((1)); + __THROW __attribute_pure__ __nonnull ((1)) + __attr_access ((__read_only__, 1, 3)); # endif #endif @@ -146,7 +149,7 @@ extern int strcoll (const char *__s1, const char *__s2) /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) - __THROW __nonnull ((2)); + __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3)); #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ @@ -158,7 +161,8 @@ extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) /* Put a transformation of SRC into no more than N bytes of DEST, using sorting rules from L. */ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, - locale_t __l) __THROW __nonnull ((2, 4)); + locale_t __l) __THROW __nonnull ((2, 4)) + __attr_access ((__write_only__, 1, 3)); #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ @@ -368,7 +372,9 @@ extern char *strcasestr (const char *__haystack, const char *__needle) HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) - __THROW __attribute_pure__ __nonnull ((1, 3)); + __THROW __attribute_pure__ __nonnull ((1, 3)) + __attr_access ((__read_only__, 1, 2)) + __attr_access ((__read_only__, 3, 4)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ @@ -409,17 +415,25 @@ extern char *strerror (int __errnum) __THROW; # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), - __xpg_strerror_r) __nonnull ((2)); + __xpg_strerror_r) __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); # else extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)); + __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); # define strerror_r __xpg_strerror_r # endif # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur; + __THROW __nonnull ((2)) __wur __attr_access ((__write_only__, 2, 3)); +# endif + +# ifdef __USE_GNU +/* Return a string describing the meaning of tthe error in ERR. */ +extern const char *strerrordesc_np (int __err) __THROW; +/* Return a string with the error name in ERR. */ +extern const char *strerrorname_np (int __err) __THROW; # endif #endif @@ -433,7 +447,8 @@ extern char *strerror_l (int __errnum, locale_t __l) __THROW; /* Set N bytes of S to 0. The compiler will not delete a call to this function, even if S is dead after the call. */ -extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)); +extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ @@ -446,6 +461,14 @@ extern char *strsep (char **__restrict __stringp, /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; +# ifdef __USE_GNU +/* Return an abbreviation string for the signal number SIG. */ +extern const char *sigabbrev_np (int __sig) __THROW; +/* Return a string describing the meaning of the signal number in SIG, + the result is not translated. */ +extern const char *sigdescr_np (int __sig) __THROW; +# endif + /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); @@ -471,7 +494,8 @@ extern int strverscmp (const char *__s1, const char *__s2) extern char *strfry (char *__string) __THROW __nonnull ((1)); /* Frobnicate N bytes of S. */ -extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)); +extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); # ifndef basename /* Return the file name within directory of FILENAME. We don't diff --git a/lib/libc/include/generic-glibc/sys/asm.h b/lib/libc/include/generic-glibc/sys/asm.h deleted file mode 100644 index b87759216a..0000000000 --- a/lib/libc/include/generic-glibc/sys/asm.h +++ /dev/null @@ -1,497 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _SYS_ASM_H -#define _SYS_ASM_H - -#include - -#ifndef CAT -# define __CAT(str1,str2) str1##str2 -# define CAT(str1,str2) __CAT(str1,str2) -#endif - -/* Redefined as nonempty in the internal header. */ -#define __mips_cfi_startproc /* Empty. */ -#define __mips_cfi_endproc /* Empty. */ - -/* - * Macros to handle different pointer/register sizes for 32/64-bit code - * - * 64 bit address space isn't used yet, so we may use the R3000 32 bit - * defines for now. - */ -#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 -# define PTR .word -# define PTRSIZE 4 -# define PTRLOG 2 -#elif _MIPS_SIM == _ABI64 -# define PTR .dword -# define PTRSIZE 8 -# define PTRLOG 3 -#endif - -/* - * PIC specific declarations - */ -#if _MIPS_SIM == _ABIO32 -# ifdef __PIC__ -# define CPRESTORE(register) \ - .cprestore register -# define CPLOAD(register) \ - .cpload register -# else -# define CPRESTORE(register) -# define CPLOAD(register) -# endif - -# define CPADD(register) \ - .cpadd register - -/* - * Set gp when at 1st instruction - */ -# define SETUP_GP \ - .set noreorder; \ - .cpload $25; \ - .set reorder -/* Set gp when not at 1st instruction */ -# define SETUP_GPX(r) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal 10f; /* Find addr of cpload. */ \ - nop; \ -10: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SETUP_GPX_L(r, l) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal l; /* Find addr of cpload. */ \ - nop; \ -l: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SAVE_GP(x) \ - .cprestore x /* Save gp trigger t9/jalr conversion. */ -# define SETUP_GP64(a, b) -# define SETUP_GPX64(a, b) -# define SETUP_GPX64_L(cp_reg, ra_save, l) -# define RESTORE_GP64 -# define USE_ALT_CP(a) -#else /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */ -/* - * For callee-saved gp calling convention: - */ -# define SETUP_GP -# define SETUP_GPX(r) -# define SETUP_GPX_L(r, l) -# define SAVE_GP(x) - -# define SETUP_GP64(gpoffset, proc) \ - .cpsetup $25, gpoffset, proc -# define SETUP_GPX64(cp_reg, ra_save) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal 10f; /* Find addr of .cpsetup. */ \ - nop; \ -10: \ - .set reorder; \ - .cpsetup $31, cp_reg, 10b; \ - move $31, ra_save -# define SETUP_GPX64_L(cp_reg, ra_save, l) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal l; /* Find addr of .cpsetup. */ \ - nop; \ -l: \ - .set reorder; \ - .cpsetup $31, cp_reg, l; \ - move $31, ra_save -# define RESTORE_GP64 \ - .cpreturn -/* Use alternate register for context pointer. */ -# define USE_ALT_CP(reg) \ - .cplocal reg -#endif /* _MIPS_SIM != _ABIO32 */ - -/* - * Stack Frame Definitions - */ -#if _MIPS_SIM == _ABIO32 -# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */ -#endif -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define NARGSAVE 0 /* No caller responsibilities. */ -#endif - - -/* - * LEAF - declare leaf routine - */ -#define LEAF(symbol) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp,0,ra; \ - __mips_cfi_startproc - -/* - * NESTED - declare nested routine entry point - */ -#define NESTED(symbol, framesize, rpc) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp, framesize, rpc; \ - __mips_cfi_startproc - -/* - * END - mark end of function - */ -#ifndef END -# define END(function) \ - __mips_cfi_endproc; \ - .end function; \ - .size function,.-function -#endif - -/* - * EXPORT - export definition of symbol - */ -#define EXPORT(symbol) \ - .globl symbol; \ -symbol: __mips_cfi_startproc - -/* - * ABS - export absolute symbol - */ -#define ABS(symbol,value) \ - .globl symbol; \ -symbol = value - -#define PANIC(msg) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal panic; \ -9: b 9b; \ - .set pop; \ - TEXT(msg) - -/* - * Print formated string - */ -#define PRINT(string) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal printk; \ - .set pop; \ - TEXT(string) - -#define TEXT(msg) \ - .data; \ -8: .asciiz msg; \ - .previous; - -/* - * Build text tables - */ -#define TTABLE(string) \ - .text; \ - .word 1f; \ - .previous; \ - .data; \ -1: .asciz string; \ - .previous - -/* - * MIPS IV pref instruction. - * Use with .set noreorder only! - * - * MIPS IV implementations are free to treat this as a nop. The R5000 - * is one of them. So we should have an option not to use this instruction. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define PREF(hint,addr) \ - pref hint,addr -# define PREFX(hint,addr) \ - prefx hint,addr -#else -# define PREF(hint,addr) -# define PREFX(hint,addr) -#endif - -/* - * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. - */ -#if _MIPS_ISA == _MIPS_ISA_MIPS1 -# define MOVN(rd,rs,rt) \ - .set push; \ - .set reorder; \ - beqz rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set reorder; \ - bnez rt,9f; \ - move rd,rt; \ - .set pop; \ -9: -#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) -# define MOVN(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - bnezl rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - beqzl rt,9f; \ - movz rd,rs; \ - .set pop; \ -9: -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MOVN(rd,rs,rt) \ - movn rd,rs,rt -# define MOVZ(rd,rs,rt) \ - movz rd,rs,rt -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */ - -/* - * Stack alignment - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define ALSZ 15 -# define ALMASK ~15 -#else -# define ALSZ 7 -# define ALMASK ~7 -#endif - -/* - * Size of a register - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define SZREG 8 -#else -# define SZREG 4 -#endif - -/* - * Use the following macros in assemblercode to load/store registers, - * pointers etc. - */ -#if (SZREG == 4) -# define REG_S sw -# define REG_L lw -#else -# define REG_S sd -# define REG_L ld -#endif - -/* - * How to add/sub/load/store/shift C int variables. - */ -#if (_MIPS_SZINT == 32) -# define INT_ADD add -# define INT_ADDI addi -# define INT_ADDU addu -# define INT_ADDIU addiu -# define INT_SUB sub -# define INT_SUBI subi -# define INT_SUBU subu -# define INT_SUBIU subu -# define INT_L lw -# define INT_S sw -#endif - -#if (_MIPS_SZINT == 64) -# define INT_ADD dadd -# define INT_ADDI daddi -# define INT_ADDU daddu -# define INT_ADDIU daddiu -# define INT_SUB dsub -# define INT_SUBI dsubi -# define INT_SUBU dsubu -# define INT_SUBIU dsubu -# define INT_L ld -# define INT_S sd -#endif - -/* - * How to add/sub/load/store/shift C long variables. - */ -#if (_MIPS_SZLONG == 32) -# define LONG_ADD add -# define LONG_ADDI addi -# define LONG_ADDU addu -# define LONG_ADDIU addiu -# define LONG_SUB sub -# define LONG_SUBI subi -# define LONG_SUBU subu -# define LONG_SUBIU subu -# define LONG_L lw -# define LONG_S sw -# define LONG_SLL sll -# define LONG_SLLV sllv -# define LONG_SRL srl -# define LONG_SRLV srlv -# define LONG_SRA sra -# define LONG_SRAV srav -#endif - -#if (_MIPS_SZLONG == 64) -# define LONG_ADD dadd -# define LONG_ADDI daddi -# define LONG_ADDU daddu -# define LONG_ADDIU daddiu -# define LONG_SUB dsub -# define LONG_SUBI dsubi -# define LONG_SUBU dsubu -# define LONG_SUBIU dsubu -# define LONG_L ld -# define LONG_S sd -# define LONG_SLL dsll -# define LONG_SLLV dsllv -# define LONG_SRL dsrl -# define LONG_SRLV dsrlv -# define LONG_SRA dsra -# define LONG_SRAV dsrav -#endif - -/* - * How to add/sub/load/store/shift pointers. - */ -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 32) -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_ADDU addu -# define PTR_ADDIU addiu -# define PTR_SUB sub -# define PTR_SUBI subi -# define PTR_SUBU subu -# define PTR_SUBIU subu -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if _MIPS_SIM == _ABIN32 -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_SUB sub -# define PTR_SUBI subi -#if !defined __mips_isa_rev || __mips_isa_rev < 6 -# define PTR_ADDU add /* no u */ -# define PTR_ADDIU addi /* no u */ -# define PTR_SUBU sub /* no u */ -# define PTR_SUBIU sub /* no u */ -#else -# define PTR_ADDU addu -# define PTR_ADDIU addiu -# define PTR_SUBU subu -# define PTR_SUBIU subu -#endif -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 64 /* o64??? */) \ - || _MIPS_SIM == _ABI64 -# define PTR_ADD dadd -# define PTR_ADDI daddi -# define PTR_ADDU daddu -# define PTR_ADDIU daddiu -# define PTR_SUB dsub -# define PTR_SUBI dsubi -# define PTR_SUBU dsubu -# define PTR_SUBIU dsubu -# define PTR_L ld -# define PTR_LA dla -# define PTR_S sd -# define PTR_SLL dsll -# define PTR_SLLV dsllv -# define PTR_SRL dsrl -# define PTR_SRLV dsrlv -# define PTR_SRA dsra -# define PTR_SRAV dsrav - -# define PTR_SCALESHIFT 3 -#endif - -/* - * Some cp0 registers were extended to 64bit for MIPS III. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS32) -# define MFC0 mfc0 -# define MTC0 mtc0 -#endif -#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MFC0 dmfc0 -# define MTC0 dmtc0 -#endif - -/* The MIPS architectures do not have a uniform memory model. Particular - platforms may provide additional guarantees - for instance, the R4000 - LL and SC instructions implicitly perform a SYNC, and the 4K promises - strong ordering. - - However, in the absence of those guarantees, we must assume weak ordering - and SYNC explicitly where necessary. - - Some obsolete MIPS processors may not support the SYNC instruction. This - applies to "true" MIPS I processors; most of the processors which compile - using MIPS I implement parts of MIPS II. */ - -#ifndef MIPS_SYNC -# define MIPS_SYNC sync -#endif - -#endif /* sys/asm.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/cachectl.h b/lib/libc/include/generic-glibc/sys/cachectl.h deleted file mode 100644 index 798a6819da..0000000000 --- a/lib/libc/include/generic-glibc/sys/cachectl.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _SYS_CACHECTL_H -#define _SYS_CACHECTL_H 1 - -#include - -/* - * Get the kernel definition for the op bits. - */ -#include - -__BEGIN_DECLS - -#ifdef __USE_MISC -extern int cachectl (void *__addr, const int __nbytes, const int __op) __THROW; -#endif -extern int __cachectl (void *__addr, const int __nbytes, const int __op) __THROW; -#ifdef __USE_MISC -extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW; -#endif -extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW; - -__END_DECLS - -#endif /* sys/cachectl.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/cdefs.h b/lib/libc/include/generic-glibc/sys/cdefs.h index 8d82b634bd..cee62de938 100644 --- a/lib/libc/include/generic-glibc/sys/cdefs.h +++ b/lib/libc/include/generic-glibc/sys/cdefs.h @@ -452,7 +452,37 @@ #include #include -#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT + +/* Alias name defined automatically. */ +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined automatically, with leading underscores. */ +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name \ + __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined manually. */ +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); + +# define __LDBL_REDIR1_NTH(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) + +/* Unused. */ +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth + +# else +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); +# endif +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) @@ -461,6 +491,8 @@ # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ @@ -471,11 +503,13 @@ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if !defined __LDBL_COMPAT || !defined __REDIRECT +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ + || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR2_DECL(name) # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) @@ -514,4 +548,15 @@ # define __HAVE_GENERIC_SELECTION 0 #endif +#if __GNUC_PREREQ (10, 0) +/* Designates a 1-based positional argument ref-index of pointer type + that can be used to access size-index elements of the pointed-to + array according to access mode, or at least one element when + size-index is not provided: + access (access-mode, [, ]) */ +#define __attr_access(x) __attribute__ ((__access__ x)) +#else +# define __attr_access(x) +#endif + #endif /* sys/cdefs.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/elf.h b/lib/libc/include/generic-glibc/sys/elf.h index 134b815f4c..d37502689d 100644 --- a/lib/libc/include/generic-glibc/sys/elf.h +++ b/lib/libc/include/generic-glibc/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,14 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_ELF_H #define _SYS_ELF_H 1 -#warning "This header is obsolete; use instead." +#ifdef __x86_64__ +# error This header is unsupported on x86-64. +#else +# warning "This header is obsolete; use instead." -#include +# include +#endif -#endif /* sys/elf.h */ \ No newline at end of file +#endif /* _SYS_ELF_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/ptrace.h b/lib/libc/include/generic-glibc/sys/ptrace.h index b420fa1cbc..0977a402d7 100644 --- a/lib/libc/include/generic-glibc/sys/ptrace.h +++ b/lib/libc/include/generic-glibc/sys/ptrace.h @@ -1,4 +1,4 @@ -/* `ptrace' debugger support interface. Linux version. +/* `ptrace' debugger support interface. Linux/x86 version. Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -70,23 +70,19 @@ enum __ptrace_request PTRACE_SINGLESTEP = 9, #define PT_STEP PTRACE_SINGLESTEP - /* Get all general purpose registers used by a processes. - This is not supported on all machines. */ + /* Get all general purpose registers used by a processes. */ PTRACE_GETREGS = 12, #define PT_GETREGS PTRACE_GETREGS - /* Set all general purpose registers used by a processes. - This is not supported on all machines. */ + /* Set all general purpose registers used by a processes. */ PTRACE_SETREGS = 13, #define PT_SETREGS PTRACE_SETREGS - /* Get all floating point registers used by a processes. - This is not supported on all machines. */ + /* Get all floating point registers used by a processes. */ PTRACE_GETFPREGS = 14, #define PT_GETFPREGS PTRACE_GETFPREGS - /* Set all floating point registers used by a processes. - This is not supported on all machines. */ + /* Set all floating point registers used by a processes. */ PTRACE_SETFPREGS = 15, #define PT_SETFPREGS PTRACE_SETFPREGS @@ -98,13 +94,11 @@ enum __ptrace_request PTRACE_DETACH = 17, #define PT_DETACH PTRACE_DETACH - /* Get all extended floating point registers used by a processes. - This is not supported on all machines. */ + /* Get all extended floating point registers used by a processes. */ PTRACE_GETFPXREGS = 18, #define PT_GETFPXREGS PTRACE_GETFPXREGS - /* Set all extended floating point registers used by a processes. - This is not supported on all machines. */ + /* Set all extended floating point registers used by a processes. */ PTRACE_SETFPXREGS = 19, #define PT_SETFPXREGS PTRACE_SETFPXREGS @@ -112,6 +106,32 @@ enum __ptrace_request PTRACE_SYSCALL = 24, #define PT_SYSCALL PTRACE_SYSCALL + /* Get a TLS entry in the GDT. */ + PTRACE_GET_THREAD_AREA = 25, +#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA + + /* Change a TLS entry in the GDT. */ + PTRACE_SET_THREAD_AREA = 26, +#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA + +#ifdef __x86_64__ + /* Access TLS data. */ + PTRACE_ARCH_PRCTL = 30, +# define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL +#endif + + /* Continue and stop at the next syscall, it will not be executed. */ + PTRACE_SYSEMU = 31, +#define PT_SYSEMU PTRACE_SYSEMU + + /* Single step the process, the next syscall will not be executed. */ + PTRACE_SYSEMU_SINGLESTEP = 32, +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP + + /* Execute process until next taken branch. */ + PTRACE_SINGLEBLOCK = 33, +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK + /* Set ptrace filter options. */ PTRACE_SETOPTIONS = 0x4200, #define PT_SETOPTIONS PTRACE_SETOPTIONS diff --git a/lib/libc/include/generic-glibc/sys/random.h b/lib/libc/include/generic-glibc/sys/random.h index 1ef7b160db..690a5234cf 100644 --- a/lib/libc/include/generic-glibc/sys/random.h +++ b/lib/libc/include/generic-glibc/sys/random.h @@ -25,6 +25,7 @@ /* Flags for use with getrandom. */ #define GRND_NONBLOCK 0x01 #define GRND_RANDOM 0x02 +#define GRND_INSECURE 0x04 __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/sys/sysctl.h b/lib/libc/include/generic-glibc/sys/sysctl.h deleted file mode 100644 index e8def66c88..0000000000 --- a/lib/libc/include/generic-glibc/sys/sysctl.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SYSCTL_H -#define _SYS_SYSCTL_H 1 - -#warning "The header is deprecated and will be removed." - -#include -#define __need_size_t -#include -/* Prevent more kernel headers than necessary to be included. */ -#ifndef _LINUX_KERNEL_H -# define _LINUX_KERNEL_H 1 -# define __undef_LINUX_KERNEL_H -#endif -#ifndef _LINUX_TYPES_H -# define _LINUX_TYPES_H 1 -# define __undef_LINUX_TYPES_H -#endif -#ifndef _LINUX_LIST_H -# define _LINUX_LIST_H 1 -# define __undef_LINUX_LIST_H -#endif -#ifndef __LINUX_COMPILER_H -# define __LINUX_COMPILER_H 1 -# define __user -# define __undef__LINUX_COMPILER_H -#endif - -#include - -#ifdef __undef_LINUX_KERNEL_H -# undef _LINUX_KERNEL_H -# undef __undef_LINUX_KERNEL_H -#endif -#ifdef __undef_LINUX_TYPES_H -# undef _LINUX_TYPES_H -# undef __undef_LINUX_TYPES_H -#endif -#ifdef __undef_LINUX_LIST_H -# undef _LINUX_LIST_H -# undef __undef_LINUX_LIST_H -#endif -#ifdef __undef__LINUX_COMPILER_H -# undef __LINUX_COMPILER_H -# undef __user -# undef __undef__LINUX_COMPILER_H -#endif - -#include - -__BEGIN_DECLS - -/* Read or write system parameters. */ -extern int sysctl (int *__name, int __nlen, void *__oldval, - size_t *__oldlenp, void *__newval, size_t __newlen) __THROW - __attribute_deprecated__; - -__END_DECLS - -#endif /* _SYS_SYSCTL_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/syslog.h b/lib/libc/include/generic-glibc/sys/syslog.h index 05b95a4bf1..3c249a2789 100644 --- a/lib/libc/include/generic-glibc/sys/syslog.h +++ b/lib/libc/include/generic-glibc/sys/syslog.h @@ -206,7 +206,9 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif -#ifdef __LDBL_COMPAT + +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/sys/ucontext.h b/lib/libc/include/generic-glibc/sys/ucontext.h index dfd6641750..3244eab7c8 100644 --- a/lib/libc/include/generic-glibc/sys/ucontext.h +++ b/lib/libc/include/generic-glibc/sys/ucontext.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. +/* Copyright (C) 2001-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -11,36 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -/* Don't rely on this, the interface is currently messed up and may need to - be broken to be fixed. */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include +#include #include #include -#include - - -/* Type for general register. Even in o32 we assume 64-bit registers, - like the kernel. */ -__extension__ typedef unsigned long long int greg_t; - -/* Number of general registers. */ -#define __NGREG 32 -#define __NFPREG 32 -#ifdef __USE_MISC -# define NGREG __NGREG -# define NFPREG __NFPREG -#endif - -/* Container for all general registers. */ -typedef greg_t gregset_t[__NGREG]; #ifdef __USE_MISC # define __ctx(fld) fld @@ -48,66 +31,112 @@ typedef greg_t gregset_t[__NGREG]; # define __ctx(fld) __ ## fld #endif -/* Container for all FPU registers. */ -typedef struct { - union { - double __ctx(fp_dregs)[__NFPREG]; - struct { - float _fp_fregs; - unsigned int _fp_pad; - } __ctx(fp_fregs)[__NFPREG]; - } __ctx(fp_r); -} fpregset_t; +#ifdef __x86_64__ +/* Type for general register. */ +__extension__ typedef long long int greg_t; + +/* Number of general registers. */ +#define __NGREG 23 +#ifdef __USE_MISC +# define NGREG __NGREG +#endif + +/* Container for all general registers. */ +typedef greg_t gregset_t[__NGREG]; + +#ifdef __USE_GNU +/* Number of each register in the `gregset_t' array. */ +enum +{ + REG_R8 = 0, +# define REG_R8 REG_R8 + REG_R9, +# define REG_R9 REG_R9 + REG_R10, +# define REG_R10 REG_R10 + REG_R11, +# define REG_R11 REG_R11 + REG_R12, +# define REG_R12 REG_R12 + REG_R13, +# define REG_R13 REG_R13 + REG_R14, +# define REG_R14 REG_R14 + REG_R15, +# define REG_R15 REG_R15 + REG_RDI, +# define REG_RDI REG_RDI + REG_RSI, +# define REG_RSI REG_RSI + REG_RBP, +# define REG_RBP REG_RBP + REG_RBX, +# define REG_RBX REG_RBX + REG_RDX, +# define REG_RDX REG_RDX + REG_RAX, +# define REG_RAX REG_RAX + REG_RCX, +# define REG_RCX REG_RCX + REG_RSP, +# define REG_RSP REG_RSP + REG_RIP, +# define REG_RIP REG_RIP + REG_EFL, +# define REG_EFL REG_EFL + REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ +# define REG_CSGSFS REG_CSGSFS + REG_ERR, +# define REG_ERR REG_ERR + REG_TRAPNO, +# define REG_TRAPNO REG_TRAPNO + REG_OLDMASK, +# define REG_OLDMASK REG_OLDMASK + REG_CR2 +# define REG_CR2 REG_CR2 +}; +#endif + +struct _libc_fpxreg +{ + unsigned short int __ctx(significand)[4]; + unsigned short int __ctx(exponent); + unsigned short int __glibc_reserved1[3]; +}; + +struct _libc_xmmreg +{ + __uint32_t __ctx(element)[4]; +}; + +struct _libc_fpstate +{ + /* 64-bit FXSAVE format. */ + __uint16_t __ctx(cwd); + __uint16_t __ctx(swd); + __uint16_t __ctx(ftw); + __uint16_t __ctx(fop); + __uint64_t __ctx(rip); + __uint64_t __ctx(rdp); + __uint32_t __ctx(mxcsr); + __uint32_t __ctx(mxcr_mask); + struct _libc_fpxreg _st[8]; + struct _libc_xmmreg _xmm[16]; + __uint32_t __glibc_reserved1[24]; +}; + +/* Structure to describe FPU registers. */ +typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ -#if _MIPS_SIM == _ABIO32 -/* Earlier versions of glibc for mips had an entirely different - definition of mcontext_t, that didn't even resemble the - corresponding kernel data structure. Fortunately, makecontext, - [gs]etcontext et all were not implemented back then, so this can - still be rectified. */ -typedef struct - { - unsigned int __ctx(regmask); - unsigned int __ctx(status); - greg_t __ctx(pc); - gregset_t __ctx(gregs); - fpregset_t __ctx(fpregs); - unsigned int __ctx(fp_owned); - unsigned int __ctx(fpc_csr); - unsigned int __ctx(fpc_eir); - unsigned int __ctx(used_math); - unsigned int __ctx(dsp); - greg_t __ctx(mdhi); - greg_t __ctx(mdlo); - unsigned long __ctx(hi1); - unsigned long __ctx(lo1); - unsigned long __ctx(hi2); - unsigned long __ctx(lo2); - unsigned long __ctx(hi3); - unsigned long __ctx(lo3); - } mcontext_t; -#else typedef struct { gregset_t __ctx(gregs); + /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); - greg_t __ctx(mdhi); - greg_t __ctx(hi1); - greg_t __ctx(hi2); - greg_t __ctx(hi3); - greg_t __ctx(mdlo); - greg_t __ctx(lo1); - greg_t __ctx(lo2); - greg_t __ctx(lo3); - greg_t __ctx(pc); - unsigned int __ctx(fpc_csr); - unsigned int __ctx(used_math); - unsigned int __ctx(dsp); - unsigned int __glibc_reserved1; - } mcontext_t; -#endif + __extension__ unsigned long long __reserved1 [8]; +} mcontext_t; /* Userlevel context. */ typedef struct ucontext_t @@ -117,8 +146,117 @@ typedef struct ucontext_t stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; + struct _libc_fpstate __fpregs_mem; + __extension__ unsigned long long int __ssp[4]; } ucontext_t; +#else /* !__x86_64__ */ + +/* Type for general register. */ +typedef int greg_t; + +/* Number of general registers. */ +#define __NGREG 19 +#ifdef __USE_MISC +# define NGREG __NGREG +#endif + +/* Container for all general registers. */ +typedef greg_t gregset_t[__NGREG]; + +#ifdef __USE_GNU +/* Number of each register is the `gregset_t' array. */ +enum +{ + REG_GS = 0, +# define REG_GS REG_GS + REG_FS, +# define REG_FS REG_FS + REG_ES, +# define REG_ES REG_ES + REG_DS, +# define REG_DS REG_DS + REG_EDI, +# define REG_EDI REG_EDI + REG_ESI, +# define REG_ESI REG_ESI + REG_EBP, +# define REG_EBP REG_EBP + REG_ESP, +# define REG_ESP REG_ESP + REG_EBX, +# define REG_EBX REG_EBX + REG_EDX, +# define REG_EDX REG_EDX + REG_ECX, +# define REG_ECX REG_ECX + REG_EAX, +# define REG_EAX REG_EAX + REG_TRAPNO, +# define REG_TRAPNO REG_TRAPNO + REG_ERR, +# define REG_ERR REG_ERR + REG_EIP, +# define REG_EIP REG_EIP + REG_CS, +# define REG_CS REG_CS + REG_EFL, +# define REG_EFL REG_EFL + REG_UESP, +# define REG_UESP REG_UESP + REG_SS +# define REG_SS REG_SS +}; +#endif + +/* Definitions taken from the kernel headers. */ +struct _libc_fpreg +{ + unsigned short int __ctx(significand)[4]; + unsigned short int __ctx(exponent); +}; + +struct _libc_fpstate +{ + unsigned long int __ctx(cw); + unsigned long int __ctx(sw); + unsigned long int __ctx(tag); + unsigned long int __ctx(ipoff); + unsigned long int __ctx(cssel); + unsigned long int __ctx(dataoff); + unsigned long int __ctx(datasel); + struct _libc_fpreg _st[8]; + unsigned long int __ctx(status); +}; + +/* Structure to describe FPU registers. */ +typedef struct _libc_fpstate *fpregset_t; + +/* Context to describe whole processor state. */ +typedef struct + { + gregset_t __ctx(gregs); + /* Due to Linux's history we have to use a pointer here. The SysV/i386 + ABI requires a struct with the values. */ + fpregset_t __ctx(fpregs); + unsigned long int __ctx(oldmask); + unsigned long int __ctx(cr2); + } mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext_t + { + unsigned long int __ctx(uc_flags); + struct ucontext_t *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + struct _libc_fpstate __fpregs_mem; + unsigned long int __ssp[4]; + } ucontext_t; + +#endif /* !__x86_64__ */ + #undef __ctx #endif /* sys/ucontext.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/user.h b/lib/libc/include/generic-glibc/sys/user.h index bfe83781cd..fe9d875789 100644 --- a/lib/libc/include/generic-glibc/sys/user.h +++ b/lib/libc/include/generic-glibc/sys/user.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,199 +12,169 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_USER_H #define _SYS_USER_H 1 -#include -#include - /* The whole purpose of this file is for GDB and GDB only. Don't read too much into it. Don't use it for anything other than GDB unless you know what you are doing. */ -/* #include */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste its - contents here. Note that the fact that the file is inline here, - instead of included separately, doesn't change in any way the - licensing status of a program that includes user.h. Since this is - for gdb alone, and gdb is GPLed, no surprises here. */ -#if _MIPS_SIM == _ABIO32 -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 by Ralf Baechle - */ -#ifndef __ASM_MIPS_REG_H -#define __ASM_MIPS_REG_H +#ifdef __x86_64__ -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 6 -#define EF_REG1 7 -#define EF_REG2 8 -#define EF_REG3 9 -#define EF_REG4 10 -#define EF_REG5 11 -#define EF_REG6 12 -#define EF_REG7 13 -#define EF_REG8 14 -#define EF_REG9 15 -#define EF_REG10 16 -#define EF_REG11 17 -#define EF_REG12 18 -#define EF_REG13 19 -#define EF_REG14 20 -#define EF_REG15 21 -#define EF_REG16 22 -#define EF_REG17 23 -#define EF_REG18 24 -#define EF_REG19 25 -#define EF_REG20 26 -#define EF_REG21 27 -#define EF_REG22 28 -#define EF_REG23 29 -#define EF_REG24 30 -#define EF_REG25 31 -/* - * k0/k1 unsaved - */ -#define EF_REG28 34 -#define EF_REG29 35 -#define EF_REG30 36 -#define EF_REG31 37 +struct user_fpregs_struct +{ + unsigned short int cwd; + unsigned short int swd; + unsigned short int ftw; + unsigned short int fop; + __extension__ unsigned long long int rip; + __extension__ unsigned long long int rdp; + unsigned int mxcsr; + unsigned int mxcr_mask; + unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ + unsigned int padding[24]; +}; -/* - * Saved special registers - */ -#define EF_LO 38 -#define EF_HI 39 - -#define EF_CP0_EPC 40 -#define EF_CP0_BADVADDR 41 -#define EF_CP0_STATUS 42 -#define EF_CP0_CAUSE 43 - -#define EF_SIZE 180 /* size in bytes */ - -#endif /* __ASM_MIPS_REG_H */ - -#else /* _MIPS_SIM != _ABIO32 */ - -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 Ralf Baechle - * Copyright (C) 1995, 1999 Silicon Graphics - */ -#ifndef _ASM_REG_H -#define _ASM_REG_H - -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 0 -#define EF_REG1 1 -#define EF_REG2 2 -#define EF_REG3 3 -#define EF_REG4 4 -#define EF_REG5 5 -#define EF_REG6 6 -#define EF_REG7 7 -#define EF_REG8 8 -#define EF_REG9 9 -#define EF_REG10 10 -#define EF_REG11 11 -#define EF_REG12 12 -#define EF_REG13 13 -#define EF_REG14 14 -#define EF_REG15 15 -#define EF_REG16 16 -#define EF_REG17 17 -#define EF_REG18 18 -#define EF_REG19 19 -#define EF_REG20 20 -#define EF_REG21 21 -#define EF_REG22 22 -#define EF_REG23 23 -#define EF_REG24 24 -#define EF_REG25 25 -/* - * k0/k1 unsaved - */ -#define EF_REG28 28 -#define EF_REG29 29 -#define EF_REG30 30 -#define EF_REG31 31 - -/* - * Saved special registers - */ -#define EF_LO 32 -#define EF_HI 33 - -#define EF_CP0_EPC 34 -#define EF_CP0_BADVADDR 35 -#define EF_CP0_STATUS 36 -#define EF_CP0_CAUSE 37 - -#define EF_SIZE 304 /* size in bytes */ - -#endif /* _ASM_REG_H */ - -#endif /* _MIPS_SIM != _ABIO32 */ - -#if _MIPS_SIM == _ABIO32 +struct user_regs_struct +{ + __extension__ unsigned long long int r15; + __extension__ unsigned long long int r14; + __extension__ unsigned long long int r13; + __extension__ unsigned long long int r12; + __extension__ unsigned long long int rbp; + __extension__ unsigned long long int rbx; + __extension__ unsigned long long int r11; + __extension__ unsigned long long int r10; + __extension__ unsigned long long int r9; + __extension__ unsigned long long int r8; + __extension__ unsigned long long int rax; + __extension__ unsigned long long int rcx; + __extension__ unsigned long long int rdx; + __extension__ unsigned long long int rsi; + __extension__ unsigned long long int rdi; + __extension__ unsigned long long int orig_rax; + __extension__ unsigned long long int rip; + __extension__ unsigned long long int cs; + __extension__ unsigned long long int eflags; + __extension__ unsigned long long int rsp; + __extension__ unsigned long long int ss; + __extension__ unsigned long long int fs_base; + __extension__ unsigned long long int gs_base; + __extension__ unsigned long long int ds; + __extension__ unsigned long long int es; + __extension__ unsigned long long int fs; + __extension__ unsigned long long int gs; +}; struct user { - unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - void* u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ + struct user_regs_struct regs; + int u_fpvalid; + struct user_fpregs_struct i387; + __extension__ unsigned long long int u_tsize; + __extension__ unsigned long long int u_dsize; + __extension__ unsigned long long int u_ssize; + __extension__ unsigned long long int start_code; + __extension__ unsigned long long int start_stack; + __extension__ long long int signal; + int reserved; + __extension__ union + { + struct user_regs_struct* u_ar0; + __extension__ unsigned long long int __u_ar0_word; + }; + __extension__ union + { + struct user_fpregs_struct* u_fpstate; + __extension__ unsigned long long int __u_fpstate_word; + }; + __extension__ unsigned long long int magic; + char u_comm [32]; + __extension__ unsigned long long int u_debugreg [8]; }; #else - -struct user { - __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */ - __extension__ unsigned long u_tsize; /* text size (pages) */ - __extension__ unsigned long u_dsize; /* data size (pages) */ - __extension__ unsigned long u_ssize; /* stack size (pages) */ - __extension__ unsigned long long start_code; /* text starting address */ - __extension__ unsigned long long start_data; /* data starting address */ - __extension__ unsigned long long start_stack; /* stack starting address */ - __extension__ long long signal; /* signal causing core dump */ - __extension__ unsigned long long u_ar0; /* help gdb find registers */ - __extension__ unsigned long long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ +/* These are the 32-bit x86 structures. */ +struct user_fpregs_struct +{ + long int cwd; + long int swd; + long int twd; + long int fip; + long int fcs; + long int foo; + long int fos; + long int st_space [20]; }; -#endif +struct user_fpxregs_struct +{ + unsigned short int cwd; + unsigned short int swd; + unsigned short int twd; + unsigned short int fop; + long int fip; + long int fcs; + long int foo; + long int fos; + long int mxcsr; + long int reserved; + long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ + long int padding[56]; +}; + +struct user_regs_struct +{ + long int ebx; + long int ecx; + long int edx; + long int esi; + long int edi; + long int ebp; + long int eax; + long int xds; + long int xes; + long int xfs; + long int xgs; + long int orig_eax; + long int eip; + long int xcs; + long int eflags; + long int esp; + long int xss; +}; + +struct user +{ + struct user_regs_struct regs; + int u_fpvalid; + struct user_fpregs_struct i387; + unsigned long int u_tsize; + unsigned long int u_dsize; + unsigned long int u_ssize; + unsigned long int start_code; + unsigned long int start_stack; + long int signal; + int reserved; + struct user_regs_struct* u_ar0; + struct user_fpregs_struct* u_fpstate; + unsigned long int magic; + char u_comm [32]; + int u_debugreg [8]; +}; +#endif /* __x86_64__ */ + +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) #endif /* _SYS_USER_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/threads.h b/lib/libc/include/generic-glibc/threads.h index 212eac67ef..a176ad32cc 100644 --- a/lib/libc/include/generic-glibc/threads.h +++ b/lib/libc/include/generic-glibc/threads.h @@ -24,7 +24,7 @@ __BEGIN_DECLS -#include +#include #include #ifndef __cplusplus @@ -32,10 +32,10 @@ __BEGIN_DECLS #endif #define TSS_DTOR_ITERATIONS 4 -typedef unsigned int tss_t; +typedef __tss_t tss_t; typedef void (*tss_dtor_t) (void*); -typedef unsigned long int thrd_t; +typedef __thrd_t thrd_t; typedef int (*thrd_start_t) (void*); /* Exit and error codes. */ @@ -56,11 +56,8 @@ enum mtx_timed = 2 }; -typedef struct -{ - int __data __ONCE_ALIGNMENT; -} once_flag; -#define ONCE_FLAG_INIT { 0 } +typedef __once_flag once_flag; +#define ONCE_FLAG_INIT __ONCE_FLAG_INIT typedef union { diff --git a/lib/libc/include/generic-glibc/unistd.h b/lib/libc/include/generic-glibc/unistd.h index 2decd11b88..83a83213c0 100644 --- a/lib/libc/include/generic-glibc/unistd.h +++ b/lib/libc/include/generic-glibc/unistd.h @@ -357,13 +357,15 @@ extern int close (int __fd); This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur; +extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur + __attr_access ((__write_only__, 2, 3)); /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur; +extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur + __attr_access ((__read_only__, 2, 3)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 @@ -374,7 +376,8 @@ extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur; This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, - __off_t __offset) __wur; + __off_t __offset) __wur + __attr_access ((__write_only__, 2, 3)); /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. @@ -382,15 +385,19 @@ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, - __off_t __offset) __wur; + __off_t __offset) __wur + __attr_access ((__read_only__, 2, 3)); + # else # ifdef __REDIRECT extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), - pread64) __wur; + pread64) __wur + __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), - pwrite64) __wur; + pwrite64) __wur + __attr_access ((__read_only__, 2, 3)); # else # define pread pread64 # define pwrite pwrite64 @@ -402,11 +409,13 @@ extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset) __wur; + __off64_t __offset) __wur + __attr_access ((__write_only__, 2, 3)); /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n, - __off64_t __offset) __wur; + __off64_t __offset) __wur + __attr_access ((__read_only__, 2, 3)); # endif #endif @@ -508,7 +517,8 @@ extern int fchdir (int __fd) __THROW __wur; an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ -extern char *getcwd (char *__buf, size_t __size) __THROW __wur; +extern char *getcwd (char *__buf, size_t __size) __THROW __wur + __attr_access ((__write_only__, 1, 2)); #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. @@ -523,7 +533,8 @@ extern char *get_current_dir_name (void) __THROW; If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd (char *__buf) - __THROW __nonnull ((1)) __attribute_deprecated__ __wur; + __THROW __nonnull ((1)) __attribute_deprecated__ __wur + __attr_access ((__write_only__, 1)); #endif @@ -620,7 +631,8 @@ extern long int sysconf (int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ -extern size_t confstr (int __name, char *__buf, size_t __len) __THROW; +extern size_t confstr (int __name, char *__buf, size_t __len) __THROW + __attr_access ((__write_only__, 2, 3)); #endif @@ -686,8 +698,8 @@ extern __gid_t getegid (void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ -extern int getgroups (int __size, __gid_t __list[]) __THROW __wur; - +extern int getgroups (int __size, __gid_t __list[]) __THROW __wur + __attr_access ((__write_only__, 2, 1)); #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member (__gid_t __gid) __THROW; @@ -772,7 +784,7 @@ extern char *ttyname (int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur; + __THROW __nonnull ((2)) __wur __attr_access ((__write_only__, 2, 3)); /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ @@ -807,7 +819,8 @@ extern int symlink (const char *__from, const char *__to) Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((1, 2)) __wur; + __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); + #endif /* Use POSIX.1-2001. */ #ifdef __USE_ATFILE @@ -818,7 +831,7 @@ extern int symlinkat (const char *__from, int __tofd, /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((2, 3)) __wur; + __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4)); #endif /* Remove the link NAME. */ @@ -853,7 +866,8 @@ extern char *getlogin (void); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)); +extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); #endif #ifdef __USE_MISC @@ -874,7 +888,8 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1)); /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ -extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); +extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); #endif @@ -882,7 +897,7 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname (const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__read_only__, 1, 2)); /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ @@ -893,10 +908,9 @@ extern int sethostid (long int __id) __THROW __wur; Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern int setdomainname (const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; - + __THROW __nonnull ((1)) __wur __attr_access ((__read_only__, 1, 2)); /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process @@ -1131,7 +1145,9 @@ extern char *crypt (const char *__key, const char *__salt) range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab (const void *__restrict __from, void *__restrict __to, - ssize_t __n) __THROW __nonnull ((1, 2)); + ssize_t __n) __THROW __nonnull ((1, 2)) + __attr_access ((__read_only__, 1, 3)) + __attr_access ((__write_only__, 2, 3)); #endif @@ -1158,7 +1174,8 @@ extern int pthread_atfork (void (*__prepare) (void), #ifdef __USE_MISC /* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error. */ -int getentropy (void *__buffer, size_t __length) __wur; +int getentropy (void *__buffer, size_t __length) __wur + __attr_access ((__write_only__, 1, 2)); #endif /* Define some macros helping to catch buffer overflows. */ diff --git a/lib/libc/include/generic-glibc/wchar.h b/lib/libc/include/generic-glibc/wchar.h index f358a1400f..f92623639b 100644 --- a/lib/libc/include/generic-glibc/wchar.h +++ b/lib/libc/include/generic-glibc/wchar.h @@ -633,9 +633,11 @@ extern int swscanf (const wchar_t *__restrict __s, __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* For historical reasons, the C99-compliant versions of the scanf - functions are at alternative names. When __LDBL_COMPAT is in - effect, this is handled in bits/wchar-ldbl.h. */ -#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT + functions are at alternative names. When __LDBL_COMPAT or + __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in + bits/wchar-ldbl.h. */ +#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), @@ -688,7 +690,8 @@ extern int vswscanf (const wchar_t *__restrict __s, /* Same redirection as above for the v*wscanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) + && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, @@ -849,7 +852,8 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, # include #endif -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/i386-linux-gnu/bits/fenv.h b/lib/libc/include/i386-linux-gnu/bits/fenv.h index 3164b63556..b504e27b15 100644 --- a/lib/libc/include/i386-linux-gnu/bits/fenv.h +++ b/lib/libc/include/i386-linux-gnu/bits/fenv.h @@ -113,58 +113,4 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif - - -#ifdef __USE_EXTERN_INLINES -__BEGIN_DECLS - -/* Optimized versions. */ -#ifndef _LIBC -extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); -#endif -__extern_always_inline void -__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) -{ - if ((FE_INVALID & __excepts) != 0) - { - /* One example of an invalid operation is 0.0 / 0.0. */ - float __f = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); -# else - __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" - : "=t" (__f) : "0" (__f)); -# endif - (void) &__f; - } - if ((FE_DIVBYZERO & __excepts) != 0) - { - float __f = 1.0; - float __g = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); -# else - __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" - : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); -# endif - (void) &__f; - } -} -__extern_inline int -__NTH (feraiseexcept (int __excepts)) -{ - if (__builtin_constant_p (__excepts) - && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) - { - __feraiseexcept_invalid_divbyzero (__excepts); - return 0; - } - - return __feraiseexcept_renamed (__excepts); -} - -__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/long-double.h b/lib/libc/include/i386-linux-gnu/bits/long-double.h index a7bd8fb163..75bc1fcce4 100644 --- a/lib/libc/include/i386-linux-gnu/bits/long-double.h +++ b/lib/libc/include/i386-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/select.h b/lib/libc/include/i386-linux-gnu/bits/select.h index 959d998266..d71b5e4ce2 100644 --- a/lib/libc/include/i386-linux-gnu/bits/select.h +++ b/lib/libc/include/i386-linux-gnu/bits/select.h @@ -19,45 +19,19 @@ # error "Never use directly; include instead." #endif -#include - - -#if defined __GNUC__ && __GNUC__ >= 2 - -# if __WORDSIZE == 64 -# define __FD_ZERO_STOS "stosq" -# else -# define __FD_ZERO_STOS "stosl" -# endif - -# define __FD_ZERO(fdsp) \ - do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ - : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (fd_set) \ - / sizeof (__fd_mask)), \ - "1" (&__FDS_BITS (fdsp)[0]) \ - : "memory"); \ - } while (0) - -#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -# define __FD_ZERO(set) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ - fd_set *__arr = (set); \ + fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) - -#endif /* GNU CC */ - -#define __FD_SET(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) -#define __FD_CLR(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) -#define __FD_ISSET(d, set) \ - ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/sem-pad.h b/lib/libc/include/i386-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 10534c61cf..0000000000 --- a/lib/libc/include/i386-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. x86 version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 1 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/semaphore.h b/lib/libc/include/i386-linux-gnu/bits/semaphore.h index 7f41d9a880..97292723c8 100644 --- a/lib/libc/include/i386-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/i386-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ # define __SIZEOF_SEM_T 16 #endif - /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/i386-linux-gnu/bits/sysctl.h b/lib/libc/include/i386-linux-gnu/bits/sysctl.h deleted file mode 100644 index 5e2b946cdf..0000000000 --- a/lib/libc/include/i386-linux-gnu/bits/sysctl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __x86_64__ && defined __ILP32__ -# error "sysctl system call is unsupported in x32 kernel" -#endif \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/typesizes.h b/lib/libc/include/i386-linux-gnu/bits/typesizes.h index 7ad60c3f43..53ae0bd5ef 100644 --- a/lib/libc/include/i386-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/i386-linux-gnu/bits/typesizes.h @@ -64,6 +64,7 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -87,10 +88,15 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/mips-linux-gnu/bits/msq-pad.h b/lib/libc/include/mips-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/resource.h b/lib/libc/include/mips-linux-gnu/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips-linux-gnu/bits/resource.h +++ b/lib/libc/include/mips-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips-linux-gnu/bits/sem-pad.h b/lib/libc/include/mips-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/shm-pad.h b/lib/libc/include/mips-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/signum.h b/lib/libc/include/mips-linux-gnu/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h b/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h b/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h b/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h b/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/resource.h b/lib/libc/include/mipsel-linux-gnu/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mipsel-linux-gnu/bits/resource.h +++ b/lib/libc/include/mipsel-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/signum.h b/lib/libc/include/mipsel-linux-gnu/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h deleted file mode 100644 index 695d3a395d..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Inline floating-point environment handling functions for powerpc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ - -/* Inline definitions for fegetround. */ -# define __fegetround_ISA300() \ - (__extension__ ({ \ - union { double __d; unsigned long long __ll; } __u; \ - __asm__ __volatile__ ( \ - ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ - : "=f" (__u.__d)); \ - __u.__ll & 0x0000000000000003LL; \ - })) - -# define __fegetround_ISA2() \ - (__extension__ ({ \ - int __fegetround_result; \ - __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ - : "=r"(__fegetround_result) : : "cr7"); \ - __fegetround_result & 3; \ - })) - -# ifdef _ARCH_PWR9 -# define __fegetround() __fegetround_ISA300() -# elif defined __BUILTIN_CPU_SUPPORTS__ -# define __fegetround() \ - (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ - ? __fegetround_ISA300() \ - : __fegetround_ISA2() \ - ) -# else -# define __fegetround() __fegetround_ISA2() -# endif - -# define fegetround() __fegetround () - -# ifndef __NO_MATH_INLINES -/* The weird 'i#*X' constraints on the following suppress a gcc - warning when __excepts is not a constant. Otherwise, they mean the - same as just plain 'i'. */ - -# if __GNUC_PREREQ(3, 4) - -/* Inline definition for feraiseexcept. */ -# define feraiseexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb1 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feraiseexcept (__e); \ - __ret; \ - })) - -/* Inline definition for feclearexcept. */ -# define feclearexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb0 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feclearexcept (__e); \ - __ret; \ - })) - -# endif /* __GNUC_PREREQ(3, 4). */ - -# endif /* !__NO_MATH_INLINES. */ - -#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h index 335efbd0aa..5719e16ac2 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h @@ -73,4 +73,6 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ \ No newline at end of file + state. */ +#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ +#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h index 8818d6fa08..c94a446c49 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h index 391f7d62fe..b37f1929bd 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h deleted file mode 100644 index c72a8507da..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h deleted file mode 100644 index e6aca78279..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h index d8dd45053b..97292723c8 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. PowerPC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 950fc7d5b5..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h index 762a5673fb..f4db4285af 100644 --- a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h +++ b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc-linux-gnu/ieee754.h b/lib/libc/include/powerpc-linux-gnu/ieee754.h index dcdca2eb78..9f9206f008 100644 --- a/lib/libc/include/powerpc-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc-linux-gnu/ieee754.h @@ -21,6 +21,7 @@ #include #include +#include __BEGIN_DECLS @@ -111,6 +112,65 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +/* long double is IEEE 128 bit */ +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ +#endif + + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -121,12 +181,16 @@ union ieee754_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ - union ibm_extended_long_double { - long double ld; +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) + __ibm128 ld; +# else + long double ld; +# endif union ieee754_double d[2]; }; +#endif __END_DECLS diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h deleted file mode 100644 index 695d3a395d..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Inline floating-point environment handling functions for powerpc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ - -/* Inline definitions for fegetround. */ -# define __fegetround_ISA300() \ - (__extension__ ({ \ - union { double __d; unsigned long long __ll; } __u; \ - __asm__ __volatile__ ( \ - ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ - : "=f" (__u.__d)); \ - __u.__ll & 0x0000000000000003LL; \ - })) - -# define __fegetround_ISA2() \ - (__extension__ ({ \ - int __fegetround_result; \ - __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ - : "=r"(__fegetround_result) : : "cr7"); \ - __fegetround_result & 3; \ - })) - -# ifdef _ARCH_PWR9 -# define __fegetround() __fegetround_ISA300() -# elif defined __BUILTIN_CPU_SUPPORTS__ -# define __fegetround() \ - (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ - ? __fegetround_ISA300() \ - : __fegetround_ISA2() \ - ) -# else -# define __fegetround() __fegetround_ISA2() -# endif - -# define fegetround() __fegetround () - -# ifndef __NO_MATH_INLINES -/* The weird 'i#*X' constraints on the following suppress a gcc - warning when __excepts is not a constant. Otherwise, they mean the - same as just plain 'i'. */ - -# if __GNUC_PREREQ(3, 4) - -/* Inline definition for feraiseexcept. */ -# define feraiseexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb1 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feraiseexcept (__e); \ - __ret; \ - })) - -/* Inline definition for feclearexcept. */ -# define feclearexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb0 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feclearexcept (__e); \ - __ret; \ - })) - -# endif /* __GNUC_PREREQ(3, 4). */ - -# endif /* !__NO_MATH_INLINES. */ - -#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h index 335efbd0aa..5719e16ac2 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h @@ -73,4 +73,6 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ \ No newline at end of file + state. */ +#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ +#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h index 8818d6fa08..c94a446c49 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h index 391f7d62fe..b37f1929bd 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h deleted file mode 100644 index c72a8507da..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h deleted file mode 100644 index e6aca78279..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h index d8dd45053b..97292723c8 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. PowerPC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 950fc7d5b5..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h b/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h index 143f904e09..22c0732548 100644 --- a/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h +++ b/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h b/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h +++ b/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/ieee754.h b/lib/libc/include/powerpc64-linux-gnu/ieee754.h index dcdca2eb78..9f9206f008 100644 --- a/lib/libc/include/powerpc64-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc64-linux-gnu/ieee754.h @@ -21,6 +21,7 @@ #include #include +#include __BEGIN_DECLS @@ -111,6 +112,65 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +/* long double is IEEE 128 bit */ +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ +#endif + + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -121,12 +181,16 @@ union ieee754_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ - union ibm_extended_long_double { - long double ld; +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) + __ibm128 ld; +# else + long double ld; +# endif union ieee754_double d[2]; }; +#endif __END_DECLS diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h deleted file mode 100644 index 695d3a395d..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Inline floating-point environment handling functions for powerpc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ - -/* Inline definitions for fegetround. */ -# define __fegetround_ISA300() \ - (__extension__ ({ \ - union { double __d; unsigned long long __ll; } __u; \ - __asm__ __volatile__ ( \ - ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ - : "=f" (__u.__d)); \ - __u.__ll & 0x0000000000000003LL; \ - })) - -# define __fegetround_ISA2() \ - (__extension__ ({ \ - int __fegetround_result; \ - __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ - : "=r"(__fegetround_result) : : "cr7"); \ - __fegetround_result & 3; \ - })) - -# ifdef _ARCH_PWR9 -# define __fegetround() __fegetround_ISA300() -# elif defined __BUILTIN_CPU_SUPPORTS__ -# define __fegetround() \ - (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ - ? __fegetround_ISA300() \ - : __fegetround_ISA2() \ - ) -# else -# define __fegetround() __fegetround_ISA2() -# endif - -# define fegetround() __fegetround () - -# ifndef __NO_MATH_INLINES -/* The weird 'i#*X' constraints on the following suppress a gcc - warning when __excepts is not a constant. Otherwise, they mean the - same as just plain 'i'. */ - -# if __GNUC_PREREQ(3, 4) - -/* Inline definition for feraiseexcept. */ -# define feraiseexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb1 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feraiseexcept (__e); \ - __ret; \ - })) - -/* Inline definition for feclearexcept. */ -# define feclearexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb0 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feclearexcept (__e); \ - __ret; \ - })) - -# endif /* __GNUC_PREREQ(3, 4). */ - -# endif /* !__NO_MATH_INLINES. */ - -#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h index 335efbd0aa..5719e16ac2 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h @@ -73,4 +73,6 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ \ No newline at end of file + state. */ +#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ +#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h index 8818d6fa08..c94a446c49 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h index 391f7d62fe..bfeb899917 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h @@ -1,5 +1,5 @@ /* Properties of long double type. ldbl-opt version. - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,4 +22,5 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI (__LDBL_MANT_DIG__ == 113) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h deleted file mode 100644 index c72a8507da..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h deleted file mode 100644 index e6aca78279..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h index d8dd45053b..97292723c8 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. PowerPC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 950fc7d5b5..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h b/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h index c26da6b2cd..b8e68b6c89 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h +++ b/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h b/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h +++ b/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/ieee754.h b/lib/libc/include/powerpc64le-linux-gnu/ieee754.h index dcdca2eb78..9f9206f008 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc64le-linux-gnu/ieee754.h @@ -21,6 +21,7 @@ #include #include +#include __BEGIN_DECLS @@ -111,6 +112,65 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +/* long double is IEEE 128 bit */ +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ +#endif + + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -121,12 +181,16 @@ union ieee754_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ - union ibm_extended_long_double { - long double ld; +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) + __ibm128 ld; +# else + long double ld; +# endif union ieee754_double d[2]; }; +#endif __END_DECLS diff --git a/lib/libc/include/riscv64-linux-gnu/bits/long-double.h b/lib/libc/include/riscv64-linux-gnu/bits/long-double.h index ce06962796..f95b24f8e7 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h b/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h index 7277c658e8..97292723c8 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h @@ -1,5 +1,5 @@ -/* Machine-specific POSIX semaphore type layouts. RISC-V version. - Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,14 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#define __SIZEOF_SEM_T (4 * __SIZEOF_POINTER__) +#include + +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h index d9e9b274ac..a5f4c78b94 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h @@ -26,31 +26,45 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -76,11 +90,17 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h index 7e92db0ded..c157deb8cf 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h index 6ac6614fb7..6ce02418e6 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h @@ -32,10 +32,7 @@ #define __stub_fetestexcept #define __stub_feupdateenv #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk -#define __stub_stty -#define __stub_sysctl \ No newline at end of file +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/fenv.h b/lib/libc/include/s390x-linux-gnu/bits/fenv.h index 281e760819..5bf167975e 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/fenv.h +++ b/lib/libc/include/s390x-linux-gnu/bits/fenv.h @@ -73,14 +73,14 @@ typedef unsigned int fexcept_t; /* size of fpc */ /* Type representing floating-point environment. This function corresponds - to the layout of the block written by the `fstenv'. */ + to the layout of the block used by fegetenv and fesetenv. */ typedef struct { fexcept_t __fpc; void *__unused; /* The field __unused (formerly __ieee_instruction_pointer) is a relict from commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59) - and isn´t used anymore. */ + and isn't used anymore. */ } fenv_t; /* If the default argument is used we use this value. */ diff --git a/lib/libc/include/s390x-linux-gnu/bits/long-double.h b/lib/libc/include/s390x-linux-gnu/bits/long-double.h index 391f7d62fe..b37f1929bd 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/long-double.h +++ b/lib/libc/include/s390x-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/semaphore.h b/lib/libc/include/s390x-linux-gnu/bits/semaphore.h index d99eca3d90..97292723c8 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/s390x-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Martin Schwidefsky , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h index d31219c155..fecd80e33a 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h @@ -50,6 +50,7 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -81,10 +82,16 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h index 268b163638..1f26b2ab53 100644 --- a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/sparc-linux-gnu/bits/fenv.h b/lib/libc/include/sparc-linux-gnu/bits/fenv.h index 408a29f7b6..7eba346aa7 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparc-linux-gnu/bits/fenv.h @@ -83,15 +83,6 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -/* For internal use only: access the fp state register. */ -#if __WORDSIZE == 64 -# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X)) -#else -# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X)) -#endif - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparc-linux-gnu/bits/long-double.h b/lib/libc/include/sparc-linux-gnu/bits/long-double.h index e32f6ad721..de5e60beb8 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/sparc-linux-gnu/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h b/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 6e05183c93..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/resource.h b/lib/libc/include/sparc-linux-gnu/bits/resource.h index 34605679a3..3cfbfd381c 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/resource.h +++ b/lib/libc/include/sparc-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h b/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 75a0a010c9..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/semaphore.h b/lib/libc/include/sparc-linux-gnu/bits/semaphore.h index ee2f8e0ca5..97292723c8 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/sparc-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. SPARC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h b/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 6f9480247f..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/signum.h b/lib/libc/include/sparc-linux-gnu/bits/signum.h deleted file mode 100644 index 2890ba7808..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/signum.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Signal number definitions. Linux/SPARC version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/SPARC systems. Signal values on this platform were chosen - for SunOS binary compatibility. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */ -#define SIGPWR SIGLOST /* Power failure imminent (SysV). */ - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/typesizes.h b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h index 123acf7d25..ebff4bdbcc 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h @@ -50,6 +50,7 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -75,10 +76,16 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h index 08e73abcba..0f86fee604 100644 --- a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h b/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h index 408a29f7b6..7eba346aa7 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h @@ -83,15 +83,6 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -/* For internal use only: access the fp state register. */ -#if __WORDSIZE == 64 -# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X)) -#else -# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X)) -#endif - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h b/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h index e32f6ad721..de5e60beb8 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 6e05183c93..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/resource.h b/lib/libc/include/sparcv9-linux-gnu/bits/resource.h index 34605679a3..3cfbfd381c 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/resource.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 75a0a010c9..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h b/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h index ee2f8e0ca5..97292723c8 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. SPARC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 6f9480247f..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/signum.h b/lib/libc/include/sparcv9-linux-gnu/bits/signum.h deleted file mode 100644 index 2890ba7808..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/signum.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Signal number definitions. Linux/SPARC version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/SPARC systems. Signal values on this platform were chosen - for SunOS binary compatibility. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */ -#define SIGPWR SIGLOST /* Power failure imminent (SysV). */ - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h b/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h index 123acf7d25..ebff4bdbcc 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h @@ -50,6 +50,7 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -75,10 +76,16 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h index 3164b63556..b504e27b15 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h @@ -113,58 +113,4 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif - - -#ifdef __USE_EXTERN_INLINES -__BEGIN_DECLS - -/* Optimized versions. */ -#ifndef _LIBC -extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); -#endif -__extern_always_inline void -__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) -{ - if ((FE_INVALID & __excepts) != 0) - { - /* One example of an invalid operation is 0.0 / 0.0. */ - float __f = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); -# else - __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" - : "=t" (__f) : "0" (__f)); -# endif - (void) &__f; - } - if ((FE_DIVBYZERO & __excepts) != 0) - { - float __f = 1.0; - float __g = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); -# else - __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" - : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); -# endif - (void) &__f; - } -} -__extern_inline int -__NTH (feraiseexcept (int __excepts)) -{ - if (__builtin_constant_p (__excepts) - && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) - { - __feraiseexcept_invalid_divbyzero (__excepts); - return 0; - } - - return __feraiseexcept_renamed (__excepts); -} - -__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/long-double.h b/lib/libc/include/x86_64-linux-gnu/bits/long-double.h index a7bd8fb163..75bc1fcce4 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/select.h b/lib/libc/include/x86_64-linux-gnu/bits/select.h index 959d998266..d71b5e4ce2 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/select.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/select.h @@ -19,45 +19,19 @@ # error "Never use directly; include instead." #endif -#include - - -#if defined __GNUC__ && __GNUC__ >= 2 - -# if __WORDSIZE == 64 -# define __FD_ZERO_STOS "stosq" -# else -# define __FD_ZERO_STOS "stosl" -# endif - -# define __FD_ZERO(fdsp) \ - do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ - : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (fd_set) \ - / sizeof (__fd_mask)), \ - "1" (&__FDS_BITS (fdsp)[0]) \ - : "memory"); \ - } while (0) - -#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -# define __FD_ZERO(set) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ - fd_set *__arr = (set); \ + fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) - -#endif /* GNU CC */ - -#define __FD_SET(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) -#define __FD_CLR(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) -#define __FD_ISSET(d, set) \ - ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h b/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 10534c61cf..0000000000 --- a/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. x86 version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 1 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h b/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h index 7f41d9a880..97292723c8 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ # define __SIZEOF_SEM_T 16 #endif - /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h b/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h deleted file mode 100644 index 5e2b946cdf..0000000000 --- a/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __x86_64__ && defined __ILP32__ -# error "sysctl system call is unsupported in x32 kernel" -#endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h b/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h index 7ad60c3f43..53ae0bd5ef 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h @@ -64,6 +64,7 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -87,10 +88,15 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h index 3d707eaca3..03d0df5edf 100644 --- a/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h b/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h index 5ce8c64bba..d4b87af1a5 100644 --- a/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h +++ b/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h @@ -11,9 +11,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h index 3164b63556..b504e27b15 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h @@ -113,58 +113,4 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif - - -#ifdef __USE_EXTERN_INLINES -__BEGIN_DECLS - -/* Optimized versions. */ -#ifndef _LIBC -extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); -#endif -__extern_always_inline void -__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) -{ - if ((FE_INVALID & __excepts) != 0) - { - /* One example of an invalid operation is 0.0 / 0.0. */ - float __f = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); -# else - __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" - : "=t" (__f) : "0" (__f)); -# endif - (void) &__f; - } - if ((FE_DIVBYZERO & __excepts) != 0) - { - float __f = 1.0; - float __g = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); -# else - __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" - : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); -# endif - (void) &__f; - } -} -__extern_inline int -__NTH (feraiseexcept (int __excepts)) -{ - if (__builtin_constant_p (__excepts) - && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) - { - __feraiseexcept_invalid_divbyzero (__excepts); - return 0; - } - - return __feraiseexcept_renamed (__excepts); -} - -__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h b/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h index a7bd8fb163..75bc1fcce4 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/select.h b/lib/libc/include/x86_64-linux-gnux32/bits/select.h index 959d998266..d71b5e4ce2 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/select.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/select.h @@ -19,45 +19,19 @@ # error "Never use directly; include instead." #endif -#include - - -#if defined __GNUC__ && __GNUC__ >= 2 - -# if __WORDSIZE == 64 -# define __FD_ZERO_STOS "stosq" -# else -# define __FD_ZERO_STOS "stosl" -# endif - -# define __FD_ZERO(fdsp) \ - do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ - : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (fd_set) \ - / sizeof (__fd_mask)), \ - "1" (&__FDS_BITS (fdsp)[0]) \ - : "memory"); \ - } while (0) - -#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -# define __FD_ZERO(set) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ - fd_set *__arr = (set); \ + fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) - -#endif /* GNU CC */ - -#define __FD_SET(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) -#define __FD_CLR(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) -#define __FD_ISSET(d, set) \ - ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h b/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h deleted file mode 100644 index 10534c61cf..0000000000 --- a/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. x86 version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 1 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h b/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h index 7f41d9a880..97292723c8 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ # define __SIZEOF_SEM_T 16 #endif - /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h b/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h deleted file mode 100644 index 5e2b946cdf..0000000000 --- a/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __x86_64__ && defined __ILP32__ -# error "sysctl system call is unsupported in x32 kernel" -#endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h b/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h index 7ad60c3f43..53ae0bd5ef 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h @@ -64,6 +64,7 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -87,10 +88,15 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h b/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h index e9ea9cb4be..cdc4ac90f9 100644 --- a/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h +++ b/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h b/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h index 9f943854b0..b3af77d56c 100644 --- a/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h +++ b/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h @@ -16,9 +16,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file From 53a2431713afc5e442479b5d8a3108e29eb8124b Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 22 Aug 2020 15:53:59 +0200 Subject: [PATCH 30/55] update glibc abi list for 2.32 --- lib/libc/glibc/abi.txt | 4175 ++++++++++++++++++++++++++++++++++----- lib/libc/glibc/fns.txt | 225 ++- lib/libc/glibc/vers.txt | 1 + 3 files changed, 3937 insertions(+), 464 deletions(-) diff --git a/lib/libc/glibc/abi.txt b/lib/libc/glibc/abi.txt index 4832449214..13053a9417 100644 --- a/lib/libc/glibc/abi.txt +++ b/lib/libc/glibc/abi.txt @@ -200,7 +200,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 + 29 @@ -229,6 +231,8 @@ aarch64-linux-gnu aarch64_be-linux-gnu + + 29 29 29 @@ -237,44 +241,80 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + + 29 29 29 + + 29 29 29 29 29 + 29 29 29 + 29 + 29 29 29 29 29 -29 -29 -29 -29 -29 + + + + + + + + + + + + + + 29 29 29 29 + +29 + 29 29 29 29 +29 + +29 + +29 + +29 + + + + + + + + + + @@ -301,29 +341,50 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 + + 29 29 29 29 + + + 29 + + + +29 + 29 29 29 + 29 -29 29 29 29 + 29 35 + + + + + + + + + + 29 29 29 @@ -334,6 +395,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu + 29 29 29 @@ -361,9 +423,16 @@ aarch64-linux-gnu aarch64_be-linux-gnu + + + + + + 29 29 + 29 29 29 @@ -372,6 +441,8 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + + 29 29 @@ -381,10 +452,17 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + + + + 29 29 + + 29 29 + 29 29 29 @@ -404,6 +482,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + 29 29 29 @@ -419,7 +498,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 + 29 29 29 @@ -443,17 +524,29 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 + 29 + 29 + 29 + 29 + 29 + 29 + 29 + 29 + 29 + 29 + 29 29 30 @@ -481,23 +574,29 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 29 29 + 29 29 29 + 29 29 29 29 + 29 29 + + 29 29 29 @@ -513,23 +612,34 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 +42 29 29 29 + + + 29 29 + 29 + 29 29 + 29 29 + 29 + 29 29 + + 29 @@ -568,17 +678,26 @@ aarch64-linux-gnu aarch64_be-linux-gnu + 29 29 29 + 29 + 29 + + + + + + 29 @@ -691,7 +810,11 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + + 29 + + 29 29 29 @@ -707,6 +830,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 29 @@ -714,7 +838,10 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + 29 + + 29 29 29 @@ -745,6 +872,11 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + + + + + 29 29 29 @@ -763,12 +895,17 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 + 29 29 29 29 29 + + + 29 29 29 @@ -776,7 +913,11 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + 29 + + + 29 29 29 @@ -790,6 +931,8 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + + 29 29 29 @@ -800,24 +943,34 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 33 + 29 29 29 + 29 29 + 29 -29 -29 + 29 29 + + 29 + +29 + +29 + + 29 29 29 @@ -850,6 +1003,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 + + + 29 29 @@ -884,6 +1040,8 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + + 29 29 29 @@ -903,10 +1061,22 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 + + + 29 29 + + 29 + + + +29 +29 + + 29 29 @@ -916,8 +1086,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -29 -29 + 29 29 @@ -925,6 +1094,57 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 + + +29 + + +29 +29 + + +29 + + + + +29 +29 + + +29 + +29 + + + +29 + + + +29 +29 + + +29 + + +29 + +29 + + + +29 + + + + +29 + + + +29 29 @@ -939,6 +1159,15 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 +29 +29 +29 +29 + +29 +29 + + 29 29 29 @@ -961,30 +1190,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 + 29 29 29 @@ -997,14 +1205,17 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 + 29 29 29 + 29 29 29 + 29 29 29 @@ -1602,7 +1813,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 39 29 -29 +29 42 37 37 37 @@ -2728,17 +2939,19 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 +42 +29 +29 +29 +29 +29 42 29 29 29 29 29 29 -29 -29 -29 -29 -29 +42 29 29 29 @@ -2768,9 +2981,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -29 +29 42 30 -29 +29 42 29 29 29 @@ -2836,7 +3049,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -29 +29 42 29 29 29 @@ -3141,12 +3354,14 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 +42 29 29 29 29 29 29 +42 29 29 29 @@ -3252,6 +3467,8 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 +42 +42 29 29 35 @@ -3942,7 +4159,9 @@ s390x-linux-gnu 27 27 + 27 + 27 @@ -3971,6 +4190,8 @@ s390x-linux-gnu + + 5 5 5 @@ -3979,43 +4200,79 @@ s390x-linux-gnu 27 27 + + 27 5 16 20 + + 5 5 5 27 27 + 27 27 27 + 27 + 5 5 5 5 5 + + + + + + + + + + + + + + 5 15 + 5 5 + 5 16 + 5 5 5 16 + 5 + 27 27 + 27 + + + + + + + + + 5 5 5 @@ -4043,29 +4300,50 @@ s390x-linux-gnu 20 + + 5 5 5 5 + + + 5 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + + + + + + + + + + 5 5 27 @@ -4075,6 +4353,7 @@ s390x-linux-gnu + 39 5 16 @@ -4103,9 +4382,16 @@ s390x-linux-gnu + + + + + + 27 27 + 27 5 5 @@ -4114,6 +4400,8 @@ s390x-linux-gnu 16 5 15 16 + + 5 5 5 @@ -4123,10 +4411,17 @@ s390x-linux-gnu 5 5 5 + + + + 5 16 + + 5 5 + 5 5 16 @@ -4146,6 +4441,7 @@ s390x-linux-gnu 16 5 5 + 5 5 15 @@ -4161,7 +4457,9 @@ s390x-linux-gnu 27 27 + 27 + 5 5 5 @@ -4185,17 +4483,29 @@ s390x-linux-gnu 5 16 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 5 5 30 @@ -4223,55 +4533,72 @@ s390x-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 5 5 5 + +27 + +27 + + +27 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +42 +5 +5 +5 +8 11 + + + +27 + +27 + +27 + +27 + 27 27 27 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -11 -27 -27 -27 + 27 -27 -27 -27 - -27 27 23 31 + + 5 @@ -4310,17 +4637,26 @@ s390x-linux-gnu + 5 5 19 + 11 + 5 + + + + + + 5 16 16 @@ -4433,7 +4769,11 @@ s390x-linux-gnu 5 5 20 + + 20 + + 5 5 19 @@ -4449,6 +4789,7 @@ s390x-linux-gnu 27 27 + 27 28 @@ -4456,7 +4797,10 @@ s390x-linux-gnu 16 16 15 16 + 5 16 + + 5 5 5 @@ -4487,6 +4831,11 @@ s390x-linux-gnu 14 16 5 + + + + + 5 5 5 @@ -4505,12 +4854,17 @@ s390x-linux-gnu 27 27 + 27 + 5 5 5 5 5 + + + 8 8 8 @@ -4518,7 +4872,11 @@ s390x-linux-gnu 5 27 27 + 27 + + + 19 18 19 @@ -4532,6 +4890,8 @@ s390x-linux-gnu 5 5 5 + + 5 5 5 @@ -4542,24 +4902,34 @@ s390x-linux-gnu 16 33 + 5 31 5 5 + 27 27 + 27 + 15 16 + + 15 16 + + 27 27 + 27 + 16 5 @@ -4592,6 +4962,9 @@ s390x-linux-gnu 5 5 5 16 + + + 12 5 @@ -4626,6 +4999,8 @@ s390x-linux-gnu 5 5 + + 5 5 5 @@ -4645,48 +5020,93 @@ s390x-linux-gnu 16 + + + 5 5 16 + + 5 + + + 5 12 5 5 + + 5 5 5 5 5 + 16 5 5 + + 5 12 20 + + 20 + + + + 5 15 16 + + 5 16 + 16 + + + 15 16 + + + 5 16 15 16 + + 15 16 + + 5 16 + 16 + + + 16 + + + + 16 + + + 5 5 + + 16 16 16 @@ -4705,6 +5125,8 @@ s390x-linux-gnu 5 5 + + 5 5 5 16 @@ -4726,7 +5148,10 @@ s390x-linux-gnu 16 5 16 + + 5 + 5 5 5 @@ -4739,14 +5164,17 @@ s390x-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 5 5 @@ -5344,7 +5772,7 @@ s390x-linux-gnu 5 5 39 5 -5 +5 42 37 37 37 @@ -6470,17 +6898,19 @@ s390x-linux-gnu 5 5 5 +42 5 5 5 5 -14 15 +14 15 42 5 5 5 5 5 5 +42 5 5 5 @@ -6510,9 +6940,9 @@ s390x-linux-gnu 5 5 5 -14 15 +14 15 42 30 -8 +8 42 5 5 24 @@ -6578,7 +7008,7 @@ s390x-linux-gnu 5 15 5 -5 +5 42 23 5 5 @@ -6883,12 +7313,14 @@ s390x-linux-gnu 5 5 5 +42 5 5 5 5 5 5 +42 5 5 5 @@ -6994,6 +7426,8 @@ s390x-linux-gnu 5 18 5 +42 +42 5 16 12 16 35 @@ -7688,6 +8122,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf + + 16 16 16 @@ -7713,6 +8149,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf + + 16 16 16 @@ -7722,8 +8160,12 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 + + 16 20 + + 16 16 16 @@ -7731,6 +8173,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 + 27 27 @@ -7738,22 +8181,43 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf -16 -16 -16 -16 -16 -16 -16 + + 16 16 16 16 16 + + + + + + + + + + + + + 16 16 + 16 +16 + +16 + +16 +16 + +16 +16 + +16 + 27 27 @@ -7762,6 +8226,16 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf + + + + + + + + + + 16 16 @@ -7785,29 +8259,50 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 20 -16 -16 -16 -16 16 -27 +16 +16 +16 + + + + + +16 + + 27 27 -27 27 27 +27 + +27 + + + 35 + + + + + + + + + + 16 16 27 @@ -7818,6 +8313,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf + 16 16 16 @@ -7845,10 +8341,17 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf + + + + + + 27 27 + 16 16 16 @@ -7856,6 +8359,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 + + 16 16 @@ -7865,10 +8370,17 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 + + + + 16 16 + + 16 16 + 16 16 16 @@ -7888,6 +8400,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 + 16 16 16 @@ -7904,6 +8417,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 + + 16 16 16 @@ -7927,17 +8442,29 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 16 16 30 @@ -7966,54 +8493,71 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 -27 27 27 -27 - -16 -16 -16 - 27 27 + 16 16 16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 + + 27 27 -27 + + +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +42 +16 +16 +16 + + + 27 27 + + 27 +27 + + +27 + + +27 + + 23 + + 16 @@ -8052,17 +8596,26 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf + 16 16 19 + +16 + + + + + 16 -16 + + 16 @@ -8175,7 +8728,11 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 20 + + 20 + + 16 16 19 @@ -8193,11 +8750,16 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 + 28 16 16 16 16 + +16 + + 16 16 16 @@ -8228,7 +8790,11 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -16 + + + + + 16 16 16 @@ -8248,11 +8814,16 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 + + 16 16 16 16 16 + + + 16 16 16 @@ -8261,6 +8832,10 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 27 + + + + 19 18 19 @@ -8274,6 +8849,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 + + 16 16 16 @@ -8284,24 +8861,34 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 33 + 16 16 16 + 27 27 + + 16 + + 16 + + 27 27 + + 16 16 16 @@ -8334,6 +8921,9 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 + + + 16 16 @@ -8368,6 +8958,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 + + 16 16 16 @@ -8387,10 +8979,22 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 + + + 16 16 16 + + 16 + + + +16 +16 + + 16 16 @@ -8400,8 +9004,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -16 -16 + 16 16 @@ -8409,12 +9012,60 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 + + 16 16 20 + + 20 + + + + +16 +16 + + +16 + +16 + + + +16 + + + +16 +16 + + +16 + + +16 + +16 + + + +16 + + + + +16 + + + +16 +16 + + 16 16 16 @@ -8430,20 +9081,10 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 + 16 16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 + 16 16 @@ -8466,9 +9107,10 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 + + 16 -16 -16 + 16 16 16 @@ -8482,14 +9124,17 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 -27 27 27 + 27 +27 + + 16 16 16 @@ -9086,7 +9731,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 39 16 16 -16 +42 16 37 37 @@ -10212,17 +10857,19 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 +42 +16 +16 +16 +16 +42 16 16 16 16 16 16 16 -16 -16 -16 -16 -16 +42 16 16 16 @@ -10252,9 +10899,9 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -16 +42 16 30 -16 +42 16 16 16 24 @@ -10320,7 +10967,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -16 +42 16 23 16 16 @@ -10625,12 +11272,14 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 +42 16 16 16 16 16 16 +42 16 16 16 @@ -10736,6 +11385,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 18 16 +42 +42 16 16 35 @@ -11426,7 +12077,9 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + 27 + 27 @@ -11455,6 +12108,8 @@ sparc-linux-gnu sparcel-linux-gnu + + 0 0 0 @@ -11463,43 +12118,79 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + + 27 1 16 20 + + 5 0 0 27 27 + 27 27 27 + 27 + 1 1 1 0 0 + + + + + + + + + + + + + + 0 15 + 1 1 + 1 16 + 0 0 0 16 + 0 + 27 27 + 27 + + + + + + + + + 0 5 5 @@ -11527,29 +12218,50 @@ sparc-linux-gnu sparcel-linux-gnu 20 + + 0 1 5 0 + + + 0 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + + + + + + + + + + 5 0 27 @@ -11560,6 +12272,7 @@ sparc-linux-gnu sparcel-linux-gnu + 0 16 16 @@ -11587,9 +12300,16 @@ sparc-linux-gnu sparcel-linux-gnu + + + + + + 27 27 + 27 0 1 @@ -11598,6 +12318,8 @@ sparc-linux-gnu sparcel-linux-gnu 16 5 15 16 + + 0 5 0 @@ -11607,10 +12329,17 @@ sparc-linux-gnu sparcel-linux-gnu 5 0 1 + + + + 5 16 + + 5 5 + 0 1 5 16 @@ -11630,6 +12359,7 @@ sparc-linux-gnu sparcel-linux-gnu 16 5 0 + 0 0 15 @@ -11645,7 +12375,9 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + 27 + 1 1 1 @@ -11669,17 +12401,29 @@ sparc-linux-gnu sparcel-linux-gnu 0 16 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 1 1 30 @@ -11707,55 +12451,72 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 1 1 1 + +27 + +27 + + +27 +1 +0 +1 +1 +0 +1 +0 +0 +0 +0 +0 +0 +0 +1 +42 +1 +0 +0 +3 8 11 + + + +27 + +27 + +27 + +27 + 27 27 27 -1 -0 -1 -1 -0 -1 -0 -0 -0 -0 -0 -0 -0 -1 -1 -0 -0 -3 11 -27 -27 -27 + 27 -27 -27 -27 - -27 27 23 + + 0 @@ -11794,17 +12555,26 @@ sparc-linux-gnu sparcel-linux-gnu + 0 0 19 + 11 + 1 + + + + + + 5 16 16 @@ -11917,7 +12687,11 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 20 + + 20 + + 0 5 19 @@ -11933,6 +12707,7 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + 27 28 @@ -11940,7 +12715,10 @@ sparc-linux-gnu sparcel-linux-gnu 16 16 15 16 + 0 16 + + 0 0 0 @@ -11971,6 +12749,11 @@ sparc-linux-gnu sparcel-linux-gnu 14 16 1 5 + + + + + 1 0 0 @@ -11989,12 +12772,17 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + 27 + 5 5 5 0 5 + + + 8 8 8 @@ -12002,7 +12790,11 @@ sparc-linux-gnu sparcel-linux-gnu 0 27 27 + 27 + + + 19 18 19 @@ -12016,6 +12808,8 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 5 + + 0 0 0 @@ -12026,24 +12820,34 @@ sparc-linux-gnu sparcel-linux-gnu 16 33 + 0 0 4 + 27 27 + 27 + 15 16 + + 15 16 + + 27 27 + 33 + 16 5 @@ -12076,6 +12880,9 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 1 16 + + + 12 1 @@ -12110,6 +12917,8 @@ sparc-linux-gnu sparcel-linux-gnu 0 1 + + 0 2 0 @@ -12129,48 +12938,93 @@ sparc-linux-gnu sparcel-linux-gnu 16 + + + 5 5 16 + + 0 + + + 0 12 1 1 + + 1 1 1 1 1 + 16 0 0 + + 0 12 20 + + 20 + + + + 3 15 16 + + 0 16 + 16 + + + 15 16 + + + 0 16 15 16 + + 15 16 + + 0 16 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -12189,6 +13043,8 @@ sparc-linux-gnu sparcel-linux-gnu 0 1 + + 0 1 0 16 @@ -12210,7 +13066,10 @@ sparc-linux-gnu sparcel-linux-gnu 16 5 16 + + 0 + 5 5 0 @@ -12223,14 +13082,17 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 1 1 @@ -12828,7 +13690,7 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 39 1 -1 +1 42 37 37 37 @@ -13954,17 +14816,19 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 0 +42 5 1 1 0 1 -14 15 +14 15 42 0 1 0 0 0 0 +42 5 14 1 1 14 @@ -13994,9 +14858,9 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 0 -14 15 +14 15 42 30 -8 +8 42 1 5 24 @@ -14062,7 +14926,7 @@ sparc-linux-gnu sparcel-linux-gnu 0 15 0 -0 +0 42 23 5 5 @@ -14367,12 +15231,14 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -14478,6 +15344,8 @@ sparc-linux-gnu sparcel-linux-gnu 0 18 0 +42 +42 0 16 12 16 35 @@ -15168,7 +16036,9 @@ sparcv9-linux-gnu 27 27 + 27 + 27 @@ -15197,6 +16067,8 @@ sparcv9-linux-gnu 5 5 + + 5 5 5 @@ -15205,43 +16077,79 @@ sparcv9-linux-gnu 27 27 + + 27 5 20 + + 5 5 5 27 27 + 27 27 27 + 27 + 5 5 5 5 5 + + + + + + + + + + + + + + 5 15 + 5 5 + 5 + 5 5 5 16 + 5 + 27 27 + 27 + + + + + + + + + 5 5 5 @@ -15269,29 +16177,50 @@ sparcv9-linux-gnu 20 + + 5 5 5 5 + + + 5 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + + + + + + + + + + 5 5 27 @@ -15302,6 +16231,7 @@ sparcv9-linux-gnu + 5 16 16 @@ -15329,9 +16259,16 @@ sparcv9-linux-gnu + + + + + + 27 27 + 27 5 5 @@ -15340,6 +16277,8 @@ sparcv9-linux-gnu 5 5 15 + + 5 5 5 @@ -15349,10 +16288,17 @@ sparcv9-linux-gnu 5 5 5 + + + + 5 16 + + 5 5 + 5 5 16 @@ -15372,6 +16318,7 @@ sparcv9-linux-gnu 16 5 5 + 5 5 15 @@ -15387,7 +16334,9 @@ sparcv9-linux-gnu 27 27 + 27 + 5 5 5 @@ -15411,17 +16360,29 @@ sparcv9-linux-gnu 5 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 5 5 30 @@ -15449,55 +16410,72 @@ sparcv9-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 5 5 5 + +27 + +27 + + +27 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +42 +5 +5 +5 +8 11 + + + +27 + +27 + +27 + +27 + 27 27 27 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -11 -27 -27 -27 + 27 -27 -27 -27 - -27 27 23 + + 5 @@ -15536,17 +16514,26 @@ sparcv9-linux-gnu + 5 5 19 + 11 + 5 + + + + + + 5 @@ -15659,7 +16646,11 @@ sparcv9-linux-gnu 5 5 20 + + 20 + + 5 5 19 @@ -15675,6 +16666,7 @@ sparcv9-linux-gnu 27 27 + 27 28 @@ -15682,7 +16674,10 @@ sparcv9-linux-gnu 16 16 15 + 5 + + 5 5 5 @@ -15713,6 +16708,11 @@ sparcv9-linux-gnu 14 16 5 + + + + + 5 5 5 @@ -15731,12 +16731,17 @@ sparcv9-linux-gnu 27 27 + 27 + 5 5 5 5 5 + + + 8 8 8 @@ -15744,7 +16749,11 @@ sparcv9-linux-gnu 5 27 27 + 27 + + + 19 18 19 @@ -15758,6 +16767,8 @@ sparcv9-linux-gnu 5 5 5 + + 5 5 5 @@ -15768,24 +16779,34 @@ sparcv9-linux-gnu 5 33 + 5 5 5 + 27 27 + 27 + 15 + + 15 + + 27 27 + 27 + 16 5 @@ -15818,6 +16839,9 @@ sparcv9-linux-gnu 5 5 5 + + + 12 5 @@ -15852,6 +16876,8 @@ sparcv9-linux-gnu 5 5 + + 5 5 5 @@ -15871,48 +16897,93 @@ sparcv9-linux-gnu 16 + + + 5 5 16 + + 5 + + + 5 12 5 5 + + 5 5 5 5 5 + 16 5 5 + + 5 12 20 + + 20 + + + + 5 15 + + 5 + 16 + + + 15 + + + 5 15 + + 15 + + 5 + 16 + + + 16 + + + + 16 + + + 5 5 + + 16 16 16 @@ -15931,6 +17002,8 @@ sparcv9-linux-gnu 5 5 + + 5 5 5 @@ -15952,7 +17025,10 @@ sparcv9-linux-gnu 16 5 16 + + 5 + 5 5 5 @@ -15965,14 +17041,17 @@ sparcv9-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 5 5 @@ -16570,7 +17649,7 @@ sparcv9-linux-gnu 5 5 39 5 -5 +5 42 37 37 37 @@ -17696,17 +18775,19 @@ sparcv9-linux-gnu 5 5 5 +42 5 5 5 5 -14 15 +14 15 42 5 5 5 5 5 5 +42 5 14 5 5 14 @@ -17736,9 +18817,9 @@ sparcv9-linux-gnu 5 5 5 -14 15 +14 15 42 30 -8 +8 42 5 5 24 @@ -17804,7 +18885,7 @@ sparcv9-linux-gnu 5 15 5 -5 +5 42 23 5 5 @@ -18109,12 +19190,14 @@ sparcv9-linux-gnu 5 5 5 +42 5 5 5 5 5 5 +42 5 5 5 @@ -18220,6 +19303,8 @@ sparcv9-linux-gnu 5 18 5 +42 +42 5 12 35 @@ -18910,7 +19995,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + 27 + 27 @@ -18939,6 +20026,8 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 + + 0 0 0 @@ -18947,43 +20036,79 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + + 27 5 20 + + 5 0 0 27 27 + 27 27 27 + 27 + 5 5 5 0 0 + + + + + + + + + + + + + + 0 15 + 5 5 + 5 + 0 0 0 16 + 0 + 27 27 + 27 + + + + + + + + + 0 5 5 @@ -19011,29 +20136,50 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 20 + + 0 5 5 0 + + + 0 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + + + + + + + + + + 5 0 27 @@ -19044,6 +20190,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 + 0 16 16 @@ -19071,9 +20218,16 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 + + + + + + 27 27 + 27 0 5 @@ -19082,6 +20236,8 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 5 5 15 + + 0 5 0 @@ -19091,10 +20247,17 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 5 0 5 + + + + 5 16 + + 5 5 + 0 5 16 @@ -19114,6 +20277,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 5 0 + 0 0 15 @@ -19129,7 +20293,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + 27 + 5 5 5 @@ -19153,17 +20319,29 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 5 5 30 @@ -19191,55 +20369,72 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + 27 27 27 + 27 27 27 + 27 5 5 5 + +27 + +27 + + +27 +5 +0 +5 +5 +0 +5 +0 +0 +0 +0 +0 +0 +0 +5 +42 +5 +0 +0 +8 11 + + + +27 + +27 + +27 + +27 + 27 27 27 -5 -0 -5 -5 -0 -5 -0 -0 -0 -0 -0 -0 -0 -5 -5 -0 -0 -11 -27 -27 -27 + 27 -27 -27 -27 - -27 27 23 + + 0 @@ -19278,17 +20473,26 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 + 0 0 19 + 11 + 5 + + + + + + 5 @@ -19401,7 +20605,11 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 20 + + 20 + + 0 5 19 @@ -19417,6 +20625,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + 27 28 @@ -19424,7 +20633,10 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 16 15 + 0 + + 0 0 0 @@ -19455,6 +20667,11 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 14 16 5 + + + + + 5 0 0 @@ -19473,12 +20690,17 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + 27 + 5 5 5 0 5 + + + 8 8 8 @@ -19486,7 +20708,11 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 27 27 + 27 + + + 19 18 19 @@ -19500,6 +20726,8 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 5 + + 0 0 0 @@ -19510,24 +20738,34 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 5 33 + 0 0 5 + 27 27 + 27 + 15 + + 15 + + 27 27 + 27 + 16 16 5 @@ -19560,6 +20798,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 5 + + + 12 5 @@ -19594,6 +20835,8 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 5 + + 0 5 0 @@ -19613,48 +20856,93 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 + + + 5 5 16 + + 0 + + + 0 12 5 5 + + 5 5 5 5 5 + 16 0 0 + + 0 12 20 + + 20 + + + + 5 15 + + 0 + 16 + + + 15 + + + 0 15 + + 15 + + 0 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -19673,6 +20961,8 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 5 + + 0 5 0 @@ -19694,7 +20984,10 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 5 16 + + 0 + 5 5 0 @@ -19707,14 +21000,17 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 + 27 27 27 + 27 27 27 + 27 5 5 @@ -20312,7 +21608,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 39 5 -5 +5 42 37 37 37 @@ -21438,17 +22734,19 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 0 +42 5 5 5 0 5 -14 15 +14 15 42 0 5 0 0 0 0 +42 5 14 5 5 14 @@ -21478,9 +22776,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 0 -14 15 +14 15 42 30 -8 +8 42 5 5 24 @@ -21546,7 +22844,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 15 0 -0 +0 42 23 5 5 @@ -21851,12 +23149,14 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -21962,6 +23262,8 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 18 0 +42 +42 0 12 35 @@ -22652,7 +23954,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + 27 + 27 @@ -22681,6 +23985,8 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 + + 0 0 0 @@ -22689,43 +23995,79 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + + 27 5 20 + + 5 0 0 27 27 + 27 27 27 + 27 + 5 5 5 0 0 + + + + + + + + + + + + + + 0 15 + 5 5 + 5 + 0 0 0 16 + 0 + 27 27 + 27 + + + + + + + + + 0 5 5 @@ -22753,29 +24095,50 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 20 + + 0 5 5 0 + + + 0 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + + + + + + + + + + 5 0 27 @@ -22786,6 +24149,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 + 0 16 16 @@ -22813,9 +24177,16 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 + + + + + + 27 27 + 27 0 5 @@ -22824,6 +24195,8 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 5 5 15 + + 0 5 0 @@ -22833,10 +24206,17 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 5 0 5 + + + + 5 16 + + 5 5 + 0 5 16 @@ -22856,6 +24236,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 5 0 + 0 0 15 @@ -22871,7 +24252,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + 27 + 5 5 5 @@ -22895,17 +24278,29 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 5 5 30 @@ -22933,55 +24328,72 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + 27 27 27 + 27 27 27 + 27 5 5 5 + +27 + +27 + + +27 +5 +0 +5 +5 +0 +5 +0 +0 +0 +0 +0 +0 +0 +5 +42 +5 +0 +0 +8 11 + + + +27 + +27 + +27 + +27 + 27 27 27 -5 -0 -5 -5 -0 -5 -0 -0 -0 -0 -0 -0 -0 -5 -5 -0 -0 -11 -27 -27 -27 + 27 -27 -27 -27 - -27 27 23 + + 0 @@ -23020,17 +24432,26 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 + 0 0 19 + 11 + 5 + + + + + + 5 @@ -23143,7 +24564,11 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 20 + + 20 + + 0 5 19 @@ -23159,6 +24584,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + 27 28 @@ -23166,7 +24592,10 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 16 15 + 0 + + 0 0 0 @@ -23197,6 +24626,11 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 14 16 5 + + + + + 5 0 0 @@ -23215,12 +24649,17 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + 27 + 5 5 5 0 5 + + + 8 8 8 @@ -23228,7 +24667,11 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 27 27 + 27 + + + 19 18 19 @@ -23242,6 +24685,8 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 5 + + 0 0 0 @@ -23252,24 +24697,34 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 5 33 + 0 0 5 + 27 27 + 27 + 15 + + 15 + + 27 27 + 27 + 16 16 5 @@ -23302,6 +24757,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 5 + + + 12 5 @@ -23336,6 +24794,8 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 5 + + 0 5 0 @@ -23355,48 +24815,93 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 + + + 5 5 16 + + 0 + + + 0 12 5 5 + + 5 5 5 5 5 + 16 0 0 + + 0 12 20 + + 20 + + + + 5 15 + + 0 + 16 + + + 15 + + + 0 15 + + 15 + + 0 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -23415,6 +24920,8 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 5 + + 0 5 0 @@ -23436,7 +24943,10 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 5 16 + + 0 + 5 5 0 @@ -23449,14 +24959,17 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 + 27 27 27 + 27 27 27 + 27 5 5 @@ -24054,7 +25567,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 39 5 -5 +5 42 37 37 37 @@ -25180,17 +26693,19 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 0 +42 5 5 5 0 5 -14 15 +14 15 42 0 5 0 0 0 0 +42 5 14 5 5 14 @@ -25220,9 +26735,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 0 -14 15 +14 15 42 30 -8 +8 42 5 5 24 @@ -25288,7 +26803,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 15 0 -0 +0 42 23 5 5 @@ -25593,12 +27108,14 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -25704,6 +27221,8 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 18 0 +42 +42 0 12 35 @@ -26398,6 +27917,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf + + 0 @@ -26423,6 +27944,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf + + 0 0 0 @@ -26432,8 +27955,12 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 + + 5 20 + + 5 0 0 @@ -26441,6 +27968,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 + 27 27 @@ -26448,26 +27976,57 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf + + 5 5 5 0 0 + + + + + + + + + + + + + + 0 15 + 5 5 + 5 + 0 0 0 16 + 0 + 27 27 + + + + + + + + + + 0 5 5 @@ -26495,29 +28054,50 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 20 + + 0 5 5 0 + + + 0 -27 + + 27 27 -27 27 27 +27 + +27 + + + 35 + + + + + + + + + + 5 0 27 @@ -26528,6 +28108,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf + 0 16 16 @@ -26555,10 +28136,17 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf + + + + + + 27 27 + 0 5 5 @@ -26566,6 +28154,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 5 15 + + 0 5 0 @@ -26575,10 +28165,17 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 5 0 5 + + + + 5 16 + + 5 5 + 0 5 16 @@ -26598,6 +28195,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 16 5 0 + 0 0 15 @@ -26614,6 +28212,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 + + 5 5 5 @@ -26637,17 +28237,29 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 5 5 30 @@ -26676,23 +28288,29 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 -27 27 27 + 27 +27 + + 5 5 5 + 27 27 + + 5 0 5 @@ -26707,23 +28325,34 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 5 +42 5 0 0 -11 -27 +8 11 + + 27 27 -27 + 27 27 + +27 + + +27 + + 23 + + 0 @@ -26762,17 +28391,26 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 30 30 + 0 0 19 + 11 + 5 + + + + + + 5 @@ -26885,7 +28523,11 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 20 + + 20 + + 0 5 19 @@ -26903,12 +28545,16 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 + 28 5 16 16 15 + 0 + + 0 0 0 @@ -26939,6 +28585,11 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 14 16 5 + + + + + 5 0 0 @@ -26958,11 +28609,16 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 + + 5 5 5 0 5 + + + 8 8 8 @@ -26971,6 +28627,10 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 27 + + + + 19 18 19 @@ -26984,6 +28644,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 5 + + 0 0 0 @@ -26994,24 +28656,34 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 33 + 0 0 5 + 27 27 + + 15 + + 15 + + 27 27 + + 16 16 5 @@ -27044,6 +28716,9 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 5 + + + 12 5 @@ -27078,6 +28753,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 5 + + 0 5 0 @@ -27097,48 +28774,93 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 16 + + + 5 5 16 + + 0 + + + 0 12 5 5 + + 5 5 5 5 5 + 16 0 0 + + 0 12 20 + + 20 + + + + 5 15 + + 0 + 16 + + + 15 + + + 0 15 + + 15 + + 0 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -27157,6 +28879,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 5 + + 0 5 0 @@ -27178,7 +28902,10 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 16 5 16 + + 0 + 5 5 0 @@ -27192,14 +28919,17 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 -27 27 27 + 27 +27 + + 5 5 5 @@ -27796,7 +29526,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 39 5 -5 +5 42 37 37 @@ -28922,17 +30652,19 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 0 +42 5 5 5 0 5 -14 15 +14 15 42 0 5 0 0 0 0 +42 5 14 5 5 14 @@ -28962,9 +30694,9 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 0 -14 15 +14 15 42 30 -8 +8 42 5 5 24 @@ -29030,7 +30762,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 15 0 -0 +0 42 23 5 5 @@ -29335,12 +31067,14 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -29446,6 +31180,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 18 0 +42 +42 0 12 35 @@ -30140,6 +31876,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi + + 0 @@ -30165,6 +31903,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi + + 0 0 0 @@ -30174,8 +31914,12 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 + + 5 20 + + 5 0 0 @@ -30183,6 +31927,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 + 27 27 @@ -30190,26 +31935,57 @@ mipsel-linux-gnueabi mips-linux-gnueabi + + 5 5 5 0 0 + + + + + + + + + + + + + + 0 15 + 5 5 + 5 + 0 0 0 16 + 0 + 27 27 + + + + + + + + + + 0 5 5 @@ -30237,29 +32013,50 @@ mipsel-linux-gnueabi mips-linux-gnueabi 20 + + 0 5 5 0 + + + 0 -27 + + 27 27 -27 27 27 +27 + +27 + + + 35 + + + + + + + + + + 5 0 27 @@ -30270,6 +32067,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi + 0 16 16 @@ -30297,10 +32095,17 @@ mipsel-linux-gnueabi mips-linux-gnueabi + + + + + + 27 27 + 0 5 5 @@ -30308,6 +32113,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 5 15 + + 0 5 0 @@ -30317,10 +32124,17 @@ mipsel-linux-gnueabi mips-linux-gnueabi 5 0 5 + + + + 5 16 + + 5 5 + 0 5 16 @@ -30340,6 +32154,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 16 5 0 + 0 0 15 @@ -30356,6 +32171,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 + + 5 5 5 @@ -30379,17 +32196,29 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 5 5 30 @@ -30418,23 +32247,29 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 -27 27 27 + 27 +27 + + 5 5 5 + 27 27 + + 5 0 5 @@ -30449,23 +32284,34 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 5 +42 5 0 0 -11 -27 +8 11 + + 27 27 -27 + 27 27 + +27 + + +27 + + 23 + + 0 @@ -30504,17 +32350,26 @@ mipsel-linux-gnueabi mips-linux-gnueabi + 0 0 19 + 11 + 5 + + + + + + 5 @@ -30627,7 +32482,11 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 20 + + 20 + + 0 5 19 @@ -30645,12 +32504,16 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 + 28 5 16 16 15 + 0 + + 0 0 0 @@ -30681,6 +32544,11 @@ mipsel-linux-gnueabi mips-linux-gnueabi 14 16 5 + + + + + 5 0 0 @@ -30700,11 +32568,16 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 + + 5 5 5 0 5 + + + 8 8 8 @@ -30713,6 +32586,10 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 27 + + + + 19 18 19 @@ -30726,6 +32603,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 5 + + 0 0 0 @@ -30736,24 +32615,34 @@ mipsel-linux-gnueabi mips-linux-gnueabi 33 + 0 0 5 + 27 27 + + 15 + + 15 + + 27 27 + + 16 16 5 @@ -30786,6 +32675,9 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 5 + + + 12 5 @@ -30820,6 +32712,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 5 + + 0 5 0 @@ -30839,48 +32733,93 @@ mipsel-linux-gnueabi mips-linux-gnueabi 16 + + + 5 5 16 + + 0 + + + 0 12 5 5 + + 5 5 5 5 5 + 16 0 0 + + 0 12 20 + + 20 + + + + 5 15 + + 0 + 16 + + + 15 + + + 0 15 + + 15 + + 0 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -30899,6 +32838,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 5 + + 0 5 0 @@ -30920,7 +32861,10 @@ mipsel-linux-gnueabi mips-linux-gnueabi 16 5 16 + + 0 + 5 5 0 @@ -30934,14 +32878,17 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 -27 27 27 + 27 +27 + + 5 5 5 @@ -31538,7 +33485,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 39 5 -5 +5 42 37 37 @@ -32664,17 +34611,19 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 0 +42 5 5 5 0 5 -14 15 +14 15 42 0 5 0 0 0 0 +42 5 14 5 5 14 @@ -32704,9 +34653,9 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 0 -14 15 +14 15 42 30 -8 +8 42 5 5 24 @@ -32772,7 +34721,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 15 0 -0 +0 42 23 5 5 @@ -33077,12 +35026,14 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -33188,6 +35139,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 18 0 +42 +42 0 12 35 @@ -33878,7 +35831,9 @@ x86_64-linux-gnu 27 36 27 + 27 + 27 @@ -33907,6 +35862,8 @@ x86_64-linux-gnu 10 + + 10 10 10 @@ -33915,43 +35872,79 @@ x86_64-linux-gnu 27 36 27 + + 27 10 20 + + 10 10 10 27 36 27 + 27 27 36 27 + 27 + 10 10 10 10 10 + + + + + + + + + + + + + + 10 15 + 10 10 + 10 + 10 10 10 16 + 10 + 27 36 27 + 27 + + + + + + + + + 10 10 10 @@ -33979,29 +35972,50 @@ x86_64-linux-gnu 20 + + 10 10 10 10 + + + 10 + + + 27 36 27 + 27 27 36 27 + 27 27 36 27 + 27 35 + + + + + + + + + + 10 10 27 @@ -34011,6 +36025,7 @@ x86_64-linux-gnu + 25 10 16 @@ -34039,9 +36054,16 @@ x86_64-linux-gnu + + + + + + 27 36 27 + 27 10 10 @@ -34050,6 +36072,8 @@ x86_64-linux-gnu 10 10 15 + + 10 10 @@ -34059,10 +36083,17 @@ x86_64-linux-gnu 10 10 10 + + + + 10 16 + + 10 10 + 10 10 16 @@ -34082,6 +36113,7 @@ x86_64-linux-gnu 16 10 10 + 10 10 15 @@ -34097,7 +36129,9 @@ x86_64-linux-gnu 27 36 27 + 27 + 10 10 10 @@ -34121,17 +36155,29 @@ x86_64-linux-gnu 36 10 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 10 10 30 @@ -34159,23 +36205,29 @@ x86_64-linux-gnu 27 36 27 + 27 27 36 27 + 27 27 36 27 + 27 10 10 10 + 27 36 27 + + 27 10 10 @@ -34191,23 +36243,34 @@ x86_64-linux-gnu 10 10 10 +42 10 10 10 11 + + + 27 36 27 + 27 + 27 36 27 + 27 27 + 36 27 + 27 23 + + 10 @@ -34246,17 +36309,26 @@ x86_64-linux-gnu + 10 10 19 + 11 + 10 + + + + + + 10 @@ -34369,7 +36441,11 @@ x86_64-linux-gnu 10 10 20 + + 20 + + 10 10 19 @@ -34385,6 +36461,7 @@ x86_64-linux-gnu 27 36 27 + 27 28 @@ -34392,7 +36469,10 @@ x86_64-linux-gnu 16 16 15 + 10 + + 10 10 10 @@ -34423,6 +36503,11 @@ x86_64-linux-gnu 14 16 10 + + + + + 10 10 10 @@ -34441,12 +36526,17 @@ x86_64-linux-gnu 27 36 27 + 27 + 10 10 10 10 10 + + + 10 10 10 @@ -34454,7 +36544,11 @@ x86_64-linux-gnu 10 27 27 + 27 + + + 19 18 19 @@ -34468,6 +36562,8 @@ x86_64-linux-gnu 10 10 10 + + 10 10 10 @@ -34478,24 +36574,34 @@ x86_64-linux-gnu 36 10 33 + 10 10 10 + 27 36 27 + 27 + 15 + + 15 + + 27 36 27 + 27 + 16 10 @@ -34528,6 +36634,9 @@ x86_64-linux-gnu 10 10 10 + + + 12 10 @@ -34562,6 +36671,8 @@ x86_64-linux-gnu 36 10 10 + + 10 10 10 @@ -34581,48 +36692,93 @@ x86_64-linux-gnu 16 + + + 10 10 16 + + 10 + + + 10 12 10 10 + + 10 10 10 10 10 + 16 10 10 + + 10 12 20 + + 20 + + + + 10 15 + + 10 + 16 + + + 15 + + + 10 15 + + 15 + + 10 + 16 + + + 16 + + + + 16 + + + 10 10 + + 16 16 16 @@ -34641,6 +36797,8 @@ x86_64-linux-gnu 36 10 10 + + 10 10 10 @@ -34662,7 +36820,10 @@ x86_64-linux-gnu 16 10 16 + + 10 + 10 10 10 @@ -34675,14 +36836,17 @@ x86_64-linux-gnu 27 36 27 + 27 27 36 27 + 27 27 36 27 + 27 10 10 @@ -35280,7 +37444,7 @@ x86_64-linux-gnu 10 10 39 10 -10 +10 42 36 37 37 @@ -36406,17 +38570,19 @@ x86_64-linux-gnu 10 10 10 +42 10 10 10 10 -14 15 +14 15 42 10 10 10 10 10 10 +42 10 10 10 @@ -36446,9 +38612,9 @@ x86_64-linux-gnu 10 10 10 -14 15 +14 15 42 30 -10 +10 42 10 10 24 @@ -36514,7 +38680,7 @@ x86_64-linux-gnu 10 15 10 -10 +10 42 23 10 10 @@ -36819,12 +38985,14 @@ x86_64-linux-gnu 10 10 10 +42 10 10 10 10 10 10 +42 10 10 10 @@ -36930,6 +39098,8 @@ x86_64-linux-gnu 10 18 10 +42 +42 10 12 35 @@ -37620,7 +39790,9 @@ x86_64-linux-gnux32 28 36 28 + 28 + 28 @@ -37649,6 +39821,8 @@ x86_64-linux-gnux32 28 + + 28 28 28 @@ -37657,43 +39831,79 @@ x86_64-linux-gnux32 28 36 28 + + 28 28 28 -28 -28 -28 -28 -36 -28 -28 -28 -36 -28 -28 - -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 - 28 28 28 28 36 28 + 28 +28 +36 +28 + +28 + + + + +28 +28 +28 +28 +28 + + + + + + + + + + + + + + +28 +28 + +28 +28 + +28 + +28 +28 + +28 +28 + +28 + +28 +36 +28 + +28 + + + + + + + + + @@ -37721,29 +39931,50 @@ x86_64-linux-gnux32 28 + + 28 28 28 28 + + + +28 + + + +28 +36 +28 + 28 28 36 28 + 28 28 36 28 -28 -28 -36 -28 + 28 35 + + + + + + + + + + 28 28 28 @@ -37753,6 +39984,7 @@ x86_64-linux-gnux32 + 28 28 28 @@ -37781,9 +40013,16 @@ x86_64-linux-gnux32 + + + + + + 28 36 28 + 28 28 28 @@ -37792,6 +40031,8 @@ x86_64-linux-gnux32 28 28 28 + + 28 28 @@ -37801,10 +40042,17 @@ x86_64-linux-gnux32 28 28 28 + + + + 28 28 + + 28 28 + 28 28 28 @@ -37824,6 +40072,7 @@ x86_64-linux-gnux32 28 28 28 + 28 28 28 @@ -37839,7 +40088,9 @@ x86_64-linux-gnux32 28 36 28 + 28 + 28 28 28 @@ -37863,17 +40114,29 @@ x86_64-linux-gnux32 36 28 28 + 28 + 28 + 28 + 28 + 28 + 28 + 28 + 28 + 28 + 28 + 28 + 28 28 30 @@ -37901,23 +40164,29 @@ x86_64-linux-gnux32 28 36 28 + 28 28 36 28 + 28 28 36 28 + 28 28 28 28 + 28 36 28 + + 28 28 28 @@ -37933,23 +40202,34 @@ x86_64-linux-gnux32 28 28 28 +42 28 28 28 + + + +28 +36 +28 + +28 + 28 36 28 + 28 28 + 36 28 + 28 28 -36 -28 -28 -28 + + 28 @@ -37988,17 +40268,26 @@ x86_64-linux-gnux32 + 28 28 28 + 28 + 28 + + + + + + 28 @@ -38111,7 +40400,11 @@ x86_64-linux-gnux32 28 28 28 + + 28 + + 28 28 28 @@ -38127,8 +40420,18 @@ x86_64-linux-gnux32 28 36 28 + 28 +28 +28 +28 +28 +28 + +28 + + 28 28 28 @@ -38159,12 +40462,11 @@ x86_64-linux-gnux32 28 28 28 -28 -28 -28 -28 -28 -28 + + + + + 28 28 28 @@ -38183,6 +40485,29 @@ x86_64-linux-gnux32 28 36 28 + +28 + +28 +28 +28 +28 +28 + + + +28 +28 +28 +28 +28 +28 +28 + +28 + + + 28 28 28 @@ -38196,20 +40521,8 @@ x86_64-linux-gnux32 28 28 28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 + + 28 28 28 @@ -38220,24 +40533,34 @@ x86_64-linux-gnux32 36 28 33 + 28 28 28 + 28 36 28 + 28 + 28 + + 28 + + 28 36 28 + 28 + 28 28 @@ -38270,6 +40593,9 @@ x86_64-linux-gnux32 28 28 28 + + + 28 28 @@ -38304,6 +40630,8 @@ x86_64-linux-gnux32 36 28 28 + + 28 28 28 @@ -38323,10 +40651,22 @@ x86_64-linux-gnux32 28 + + + 28 28 + + 28 + + + +28 +28 + + 28 28 @@ -38336,9 +40676,28 @@ x86_64-linux-gnux32 28 28 28 + + 28 28 + +28 + + + +28 + + +28 +28 + + +28 + + + + 28 28 @@ -38348,23 +40707,37 @@ x86_64-linux-gnux32 28 + +28 + + + 28 28 + + +28 + + +28 + +28 + + + +28 + + + + +28 + + + 28 28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 -28 + + 28 28 28 @@ -38383,6 +40756,8 @@ x86_64-linux-gnux32 36 28 28 + + 28 28 28 @@ -38404,7 +40779,10 @@ x86_64-linux-gnux32 28 28 28 + + 28 + 28 28 28 @@ -38417,14 +40795,17 @@ x86_64-linux-gnux32 28 36 28 + 28 28 36 28 + 28 28 36 28 + 28 28 28 @@ -39022,7 +41403,7 @@ x86_64-linux-gnux32 28 28 39 28 -28 +28 42 36 37 37 @@ -40148,17 +42529,19 @@ x86_64-linux-gnux32 28 28 28 +42 +28 +28 +28 +28 +28 42 28 28 28 28 28 28 -28 -28 -28 -28 -28 +42 28 28 28 @@ -40188,9 +42571,9 @@ x86_64-linux-gnux32 28 28 28 -28 +28 42 30 -28 +28 42 28 28 28 @@ -40256,7 +42639,7 @@ x86_64-linux-gnux32 28 28 28 -28 +28 42 28 28 28 @@ -40561,12 +42944,14 @@ x86_64-linux-gnux32 28 28 28 +42 28 28 28 28 28 28 +42 28 28 28 @@ -40672,6 +43057,8 @@ x86_64-linux-gnux32 28 28 28 +42 +42 28 28 35 @@ -41362,7 +43749,9 @@ i386-linux-gnu 27 36 27 + 27 + 27 @@ -41391,6 +43780,8 @@ i386-linux-gnu + + 0 0 0 @@ -41399,43 +43790,79 @@ i386-linux-gnu 27 36 27 + + 27 1 20 + + 5 0 0 27 36 27 + 27 27 36 27 + 27 + 1 1 1 0 0 + + + + + + + + + + + + + + 0 15 + 1 1 + 1 + 0 0 0 16 + 0 + 27 36 27 + 27 + + + + + + + + + 0 5 5 @@ -41463,29 +43890,50 @@ i386-linux-gnu 0 20 + + 0 1 5 0 + + + 0 + + + 27 36 27 + 27 27 36 27 + 27 27 36 27 + 5 27 35 + 5 + + + + + + + + + 5 0 27 @@ -41495,6 +43943,7 @@ i386-linux-gnu + 25 0 16 @@ -41523,9 +43972,16 @@ i386-linux-gnu + + + + + + 27 36 27 + 27 0 1 @@ -41534,6 +43990,8 @@ i386-linux-gnu 1 5 15 + + 0 5 0 @@ -41543,10 +44001,17 @@ i386-linux-gnu 5 0 1 + + + + 5 16 + + 5 5 + 0 1 5 16 @@ -41566,6 +44031,7 @@ i386-linux-gnu 16 5 0 + 0 0 15 @@ -41581,7 +44047,9 @@ i386-linux-gnu 27 36 27 + 27 + 1 1 1 @@ -41605,17 +44073,29 @@ i386-linux-gnu 36 0 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 1 1 30 @@ -41643,23 +44123,29 @@ i386-linux-gnu 27 36 27 + 27 27 36 27 + 27 27 36 27 + 27 1 1 1 + 27 36 27 + + 27 1 0 @@ -41675,23 +44161,34 @@ i386-linux-gnu 0 0 1 +42 1 0 0 -3 11 +3 8 11 + + + 27 36 27 + 27 + 27 36 27 + 27 27 + 36 27 + 27 23 + + 0 @@ -41730,17 +44227,26 @@ i386-linux-gnu 0 + 0 0 19 + 11 + 1 + + + + + + 5 @@ -41853,7 +44359,11 @@ i386-linux-gnu 0 0 20 + + 20 + + 0 5 19 @@ -41869,6 +44379,7 @@ i386-linux-gnu 27 36 27 + 27 28 @@ -41876,7 +44387,10 @@ i386-linux-gnu 16 16 15 + 0 + + 0 0 0 @@ -41907,6 +44421,11 @@ i386-linux-gnu 14 16 1 5 + + + + + 1 0 0 @@ -41925,12 +44444,17 @@ i386-linux-gnu 27 36 27 + 27 + 5 5 5 0 5 + + + 8 8 8 @@ -41938,7 +44462,11 @@ i386-linux-gnu 0 27 27 + 27 + + + 19 18 19 @@ -41952,6 +44480,8 @@ i386-linux-gnu 0 0 5 + + 0 0 0 @@ -41962,24 +44492,34 @@ i386-linux-gnu 36 1 33 + 0 0 4 + 27 36 27 + 27 + 15 + + 15 + + 27 36 27 + 27 + 16 5 @@ -42012,6 +44552,9 @@ i386-linux-gnu 0 0 1 + + + 12 2 1 @@ -42046,6 +44589,8 @@ i386-linux-gnu 36 0 1 + + 0 2 0 @@ -42065,48 +44610,93 @@ i386-linux-gnu 16 + + + 5 5 16 + + 0 + + + 0 12 1 1 + + 1 1 1 1 1 + 16 0 0 0 + + 0 0 12 20 + + 20 + + + + 3 15 + + 0 + 16 + + + 15 + + + 0 15 + + 15 + + 0 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -42125,6 +44715,8 @@ i386-linux-gnu 36 0 1 + + 0 1 0 @@ -42146,7 +44738,10 @@ i386-linux-gnu 16 5 16 + + 0 + 5 5 0 @@ -42159,14 +44754,17 @@ i386-linux-gnu 27 36 27 + 27 27 36 27 + 27 27 36 27 + 27 1 1 @@ -42764,7 +45362,7 @@ i386-linux-gnu 0 0 39 1 -1 +1 42 36 37 37 @@ -43890,17 +46488,19 @@ i386-linux-gnu 0 0 0 +42 5 1 1 0 1 -14 15 +14 15 42 0 1 0 0 0 0 +42 5 1 1 @@ -43930,9 +46530,9 @@ i386-linux-gnu 0 0 0 -14 15 +14 15 42 30 -8 +8 42 1 5 24 @@ -43998,7 +46598,7 @@ i386-linux-gnu 0 15 0 -0 +0 42 23 5 5 @@ -44303,12 +46903,14 @@ i386-linux-gnu 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -44414,6 +47016,8 @@ i386-linux-gnu 0 18 0 +42 +42 0 12 35 @@ -45104,7 +47708,9 @@ powerpc64le-linux-gnu 29 36 29 +42 29 +42 29 @@ -45133,6 +47739,8 @@ powerpc64le-linux-gnu +42 +42 29 29 29 @@ -45141,43 +47749,79 @@ powerpc64le-linux-gnu 29 36 29 +42 +42 29 29 29 +42 +42 29 29 29 29 36 29 +42 29 -29 -36 -29 -29 - - - -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 -29 - -29 -29 -29 -29 -36 -29 -29 +29 +36 +29 +42 +29 +42 + + + +29 +29 +29 +29 +29 +42 +42 +42 +42 +42 +42 +42 +42 +42 +42 +42 +42 +42 +42 +29 +29 +42 +29 +29 +42 +29 +42 +29 +29 + +29 +29 +42 +29 +42 +29 +36 +29 +42 +29 +42 +42 +42 +42 +42 +42 +42 +42 +42 @@ -45205,33 +47849,55 @@ powerpc64le-linux-gnu 29 +42 +42 29 29 29 29 +42 +42 +42 +29 +42 +42 +42 +29 +36 +29 +42 29 29 36 29 +42 29 29 36 29 -29 -29 -36 -29 +42 29 35 +42 +42 +42 +42 +42 +42 +42 +42 +42 +42 29 29 29 29 +42 29 35 29 @@ -45264,10 +47930,17 @@ powerpc64le-linux-gnu +42 +42 +42 +42 +42 +42 29 36 29 +42 29 29 29 @@ -45276,6 +47949,8 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 29 29 @@ -45285,10 +47960,17 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 +42 +42 29 29 +42 +42 29 29 +42 29 29 29 @@ -45308,6 +47990,7 @@ powerpc64le-linux-gnu 29 29 29 +42 29 29 29 @@ -45323,7 +48006,9 @@ powerpc64le-linux-gnu 29 36 29 +42 29 +42 29 29 29 @@ -45347,17 +48032,29 @@ powerpc64le-linux-gnu 36 29 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 +42 29 29 30 @@ -45385,23 +48082,29 @@ powerpc64le-linux-gnu 29 36 29 +42 29 29 36 29 +42 29 29 36 29 +42 29 29 29 29 +42 29 36 29 +42 +42 29 29 29 @@ -45417,23 +48120,34 @@ powerpc64le-linux-gnu 29 29 29 +42 29 29 29 +42 +42 +42 29 36 29 +42 29 +42 29 36 29 +42 29 29 +42 36 29 +42 29 29 +42 +42 29 @@ -45472,17 +48186,26 @@ powerpc64le-linux-gnu +42 29 29 29 +42 29 +42 29 +42 +42 +42 +42 +42 +42 29 29 29 @@ -45595,7 +48318,11 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 29 +42 +42 29 29 29 @@ -45611,6 +48338,18 @@ powerpc64le-linux-gnu 29 36 29 +42 +29 +29 +29 +29 +29 +29 +29 +42 +29 +42 +42 29 29 29 @@ -45641,14 +48380,11 @@ powerpc64le-linux-gnu 29 29 29 -29 -29 -29 -29 -29 -29 -29 -29 +42 +42 +42 +42 +42 29 29 29 @@ -45667,6 +48403,17 @@ powerpc64le-linux-gnu 29 36 29 +42 +29 +42 +29 +29 +29 +29 +29 +42 +42 +42 29 29 29 @@ -45674,13 +48421,11 @@ powerpc64le-linux-gnu 29 29 29 +42 29 -29 -29 -29 -29 -29 -29 +42 +42 +42 29 29 29 @@ -45694,6 +48439,8 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 29 29 29 @@ -45704,24 +48451,34 @@ powerpc64le-linux-gnu 36 29 33 +42 29 29 29 +42 29 36 29 +42 29 +42 29 +42 +42 29 +42 +42 29 36 29 +42 29 +42 29 29 @@ -45754,6 +48511,9 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 +42 29 29 @@ -45788,6 +48548,8 @@ powerpc64le-linux-gnu 36 29 29 +42 +42 29 29 29 @@ -45807,48 +48569,93 @@ powerpc64le-linux-gnu 29 +42 +42 +42 29 29 29 +42 +42 29 +42 +42 +42 29 29 32 29 29 +42 +42 29 29 29 29 29 +42 29 29 29 +42 +42 29 29 29 +42 +42 +29 +42 +42 +42 +42 29 29 +42 +42 +29 +42 +29 +42 +42 +42 +29 +42 +42 +42 29 29 +42 +42 +29 +42 +42 +29 +42 +29 +42 +42 +42 +29 +42 +42 +42 +42 +29 +42 +42 +42 29 29 -29 -29 -29 -29 -29 -29 -29 -29 -29 +42 +42 29 29 29 @@ -45867,6 +48674,8 @@ powerpc64le-linux-gnu 36 29 29 +42 +42 29 29 29 @@ -45888,7 +48697,10 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 29 +42 29 29 29 @@ -45901,14 +48713,17 @@ powerpc64le-linux-gnu 29 36 29 +42 29 29 36 29 +42 29 29 36 29 +42 29 29 29 @@ -46506,7 +49321,7 @@ powerpc64le-linux-gnu 29 29 39 29 -29 +29 42 36 37 37 @@ -47632,17 +50447,19 @@ powerpc64le-linux-gnu 29 29 29 +42 +29 +29 +29 +29 +29 42 29 29 29 29 29 29 -29 -29 -29 -29 -29 +42 29 29 29 @@ -47672,9 +50489,9 @@ powerpc64le-linux-gnu 29 29 29 -29 +29 42 30 -29 +29 42 29 29 29 @@ -47740,7 +50557,7 @@ powerpc64le-linux-gnu 29 29 29 -29 +29 42 29 29 29 @@ -48045,12 +50862,14 @@ powerpc64le-linux-gnu 29 29 29 +42 29 29 29 29 29 29 +42 29 29 29 @@ -48156,6 +50975,8 @@ powerpc64le-linux-gnu 29 29 29 +42 +42 29 29 35 @@ -48846,7 +51667,9 @@ powerpc64-linux-gnu 27 27 + 27 + 27 @@ -48875,6 +51698,8 @@ powerpc64-linux-gnu + + 12 12 12 @@ -48883,47 +51708,83 @@ powerpc64-linux-gnu 27 27 + + 27 12 16 20 + + 12 12 12 27 27 + 27 27 27 + 27 + 12 12 12 12 12 + + + + + + + + + + + + + + 12 15 + 12 12 + 12 16 + 12 12 12 16 + 12 + 27 27 + 27 + + + + + + + + + 12 12 @@ -48947,33 +51808,55 @@ powerpc64-linux-gnu 20 + + 12 12 12 12 + + + 12 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + + + + + + + + + + 12 12 27 27 + 12 35 12 @@ -49007,9 +51890,16 @@ powerpc64-linux-gnu + + + + + + 27 27 + 27 12 12 @@ -49018,6 +51908,8 @@ powerpc64-linux-gnu 16 12 15 16 + + 12 12 @@ -49027,10 +51919,17 @@ powerpc64-linux-gnu 12 12 12 + + + + 12 16 + + 12 12 + 12 12 16 @@ -49050,6 +51949,7 @@ powerpc64-linux-gnu 16 12 12 + 12 12 15 @@ -49065,7 +51965,9 @@ powerpc64-linux-gnu 27 27 + 27 + 12 12 12 @@ -49089,17 +51991,29 @@ powerpc64-linux-gnu 12 16 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 12 12 30 @@ -49127,23 +52041,29 @@ powerpc64-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 12 12 12 + 27 27 + + 27 12 12 @@ -49159,23 +52079,34 @@ powerpc64-linux-gnu 12 12 12 +42 12 12 12 + + + +27 + +27 + +27 + +27 + 27 27 27 -27 -27 -27 + 27 -27 27 23 + + 12 @@ -49214,17 +52145,26 @@ powerpc64-linux-gnu + 12 12 19 + +12 + + + + + 12 -12 + + 12 16 16 @@ -49337,7 +52277,11 @@ powerpc64-linux-gnu 12 12 20 + + 20 + + 12 12 19 @@ -49353,6 +52297,7 @@ powerpc64-linux-gnu 27 27 + 27 29 28 @@ -49360,7 +52305,10 @@ powerpc64-linux-gnu 16 16 15 16 + 12 16 + + 12 12 12 @@ -49391,6 +52339,11 @@ powerpc64-linux-gnu 14 16 12 + + + + + 12 12 12 @@ -49409,12 +52362,17 @@ powerpc64-linux-gnu 27 27 + 27 + 12 12 12 12 12 + + + 12 12 12 @@ -49422,7 +52380,11 @@ powerpc64-linux-gnu 12 27 27 + 27 + + + 19 18 19 @@ -49436,6 +52398,8 @@ powerpc64-linux-gnu 12 12 12 + + 12 12 12 @@ -49446,24 +52410,34 @@ powerpc64-linux-gnu 16 33 + 12 12 15 12 + 27 27 + 27 + 15 16 + + 15 16 + + 27 27 + 27 + 16 12 @@ -49496,6 +52470,9 @@ powerpc64-linux-gnu 12 12 12 16 + + + 12 12 @@ -49530,6 +52507,8 @@ powerpc64-linux-gnu 12 12 + + 12 12 12 @@ -49549,48 +52528,93 @@ powerpc64-linux-gnu 16 + + + 12 12 16 + + 12 + + + 12 12 32 12 12 + + 12 12 12 12 12 + 16 12 12 + + 12 12 20 + + 20 + + + + 12 15 16 + + 12 16 + 16 + + + 15 16 + + + 12 16 15 16 + + 15 16 + + 12 16 + 16 + + + 16 + + + + 16 + + + 12 12 + + 16 16 16 @@ -49609,6 +52633,8 @@ powerpc64-linux-gnu 12 12 + + 12 12 12 16 @@ -49630,7 +52656,10 @@ powerpc64-linux-gnu 16 12 16 + + 12 + 12 12 12 @@ -49643,14 +52672,17 @@ powerpc64-linux-gnu 27 27 + 27 27 27 + 27 27 27 + 27 12 12 @@ -50248,7 +53280,7 @@ powerpc64-linux-gnu 12 39 12 12 -12 +12 42 37 37 @@ -51374,17 +54406,19 @@ powerpc64-linux-gnu 12 12 12 +42 12 12 12 12 -14 15 +14 15 42 12 12 12 12 12 12 +42 12 18 12 12 18 @@ -51414,9 +54448,9 @@ powerpc64-linux-gnu 12 12 12 -14 15 +14 15 42 30 -12 +12 42 12 12 24 @@ -51482,7 +54516,7 @@ powerpc64-linux-gnu 12 15 12 -12 +12 42 23 12 12 @@ -51787,12 +54821,14 @@ powerpc64-linux-gnu 12 12 12 +42 12 12 12 12 12 12 +42 12 12 12 @@ -51898,6 +54934,8 @@ powerpc64-linux-gnu 12 18 12 +42 +42 12 16 12 16 35 @@ -52588,7 +55626,9 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + 27 + 27 13 13 @@ -52617,6 +55657,8 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf + + 0 0 0 @@ -52625,20 +55667,27 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + + 27 1 16 20 + + 5 0 0 27 27 + 27 27 27 + 27 + 31 31 31 @@ -52647,21 +55696,50 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 1 0 0 + + + + + + + + + + + + + + 0 15 + 1 1 + 1 16 + 0 0 0 0 16 + 0 + 27 27 + 27 + + + + + + + + + 0 5 5 @@ -52689,33 +55767,55 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 13 20 + + 0 1 5 0 13 13 + + + 0 + + + +27 + 27 27 27 + 27 -27 27 27 27 + 27 35 + 13 + + + + + + + + + 5 0 27 27 + 1 35 1 @@ -52748,10 +55848,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 16 16 + 31 + + + + + 27 27 + 27 0 1 @@ -52760,6 +55867,8 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 5 15 16 + + 0 5 0 @@ -52769,10 +55878,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 5 0 1 + + + + 5 16 + + 5 5 + 0 1 5 16 @@ -52792,6 +55908,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 5 0 + 0 0 15 @@ -52807,7 +55924,9 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + 27 + 1 1 1 @@ -52831,17 +55950,29 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 16 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 19 + 1 1 30 @@ -52869,23 +56000,29 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + 27 27 27 + 27 27 27 + 27 1 1 1 + 13 13 27 27 + + 27 1 0 @@ -52901,23 +56038,34 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 1 +42 1 0 0 -3 11 +3 8 11 + + + +27 + +27 + +27 + +27 + 27 27 27 -27 -27 -27 + 27 -27 27 23 + + 0 0 16 @@ -52956,17 +56104,26 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 + 0 0 19 13 13 + 11 + 16 13 13 16 1 + + + + + + 5 16 16 @@ -53079,7 +56236,11 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 20 + + 20 + + 0 5 19 @@ -53095,6 +56256,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + 27 29 28 @@ -53102,7 +56264,10 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 16 15 16 + 0 16 + + 0 0 0 @@ -53133,6 +56298,11 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 14 16 1 5 + + + + + 1 0 0 @@ -53151,12 +56321,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + 27 + 5 5 5 0 5 + + + 8 8 8 @@ -53164,7 +56339,11 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 27 27 + 27 + + + 19 18 19 @@ -53178,6 +56357,8 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 5 + + 0 0 0 @@ -53188,24 +56369,34 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 33 + 0 0 15 4 13 13 13 + 27 27 + 27 + 15 16 + + 15 16 + + 27 13 27 + 27 13 + 16 5 @@ -53238,6 +56429,9 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 1 16 + + + 12 1 @@ -53272,6 +56466,8 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 1 + + 0 2 0 @@ -53291,48 +56487,93 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 13 13 16 + + + 5 5 16 + + 0 + + + 0 12 32 1 1 + + 1 1 1 1 1 13 + 16 0 0 0 0 + + 0 0 16 16 12 20 + + 20 + + + + 3 15 16 + + 0 16 + 16 + + + 15 16 + + + 0 16 15 16 + + 15 16 + + 0 16 + 16 + + + 16 + + + + 16 + + + 0 0 + + 16 16 16 @@ -53351,6 +56592,8 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 1 + + 0 1 0 16 @@ -53372,7 +56615,10 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 5 16 + + 0 + 5 5 0 @@ -53385,14 +56631,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 + 27 27 27 + 27 27 27 + 27 1 1 @@ -53990,7 +57239,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 39 1 -1 +1 42 37 37 @@ -55116,17 +58365,19 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 0 +42 5 1 1 0 1 -14 15 +14 15 42 0 1 0 0 0 0 +42 5 18 1 1 18 @@ -55156,9 +58407,9 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 0 -14 15 +14 15 42 30 -8 +8 42 1 5 24 @@ -55224,7 +58475,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 15 0 -0 +0 42 23 5 5 @@ -55529,12 +58780,14 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 0 +42 0 0 0 0 0 0 +42 0 0 0 @@ -55640,6 +58893,8 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 18 0 +42 +42 0 16 12 16 35 diff --git a/lib/libc/glibc/fns.txt b/lib/libc/glibc/fns.txt index a1dd9b18e1..5d274d178e 100644 --- a/lib/libc/glibc/fns.txt +++ b/lib/libc/glibc/fns.txt @@ -199,7 +199,9 @@ __acosf_finite m __acosh_finite m __acoshf128_finite m __acoshf_finite m +__acoshieee128 m __acoshl_finite m +__acosieee128 m __acosl_finite m __adddf3 c __addsf3 c @@ -228,6 +230,8 @@ __align_cpy_2 c __align_cpy_4 c __align_cpy_8 c __arch_prctl c +__argp_errorieee128 c +__argp_failureieee128 c __argz_count c __argz_next c __argz_stringify c @@ -236,20 +240,27 @@ __ashrdi3 c __asin_finite m __asinf128_finite m __asinf_finite m +__asinhieee128 m +__asinieee128 m __asinl_finite m __asprintf c __asprintf_chk c +__asprintf_chkieee128 c +__asprintfieee128 c __assert c __assert_fail c __assert_perror_fail c __atan2_finite m __atan2f128_finite m __atan2f_finite m +__atan2ieee128 m __atan2l_finite m __atanh_finite m __atanhf128_finite m __atanhf_finite m +__atanhieee128 m __atanhl_finite m +__atanieee128 m __atomic_feclearexcept c __atomic_feholdexcept c __atomic_feupdateenv c @@ -258,21 +269,50 @@ __backtrace_symbols c __backtrace_symbols_fd c __bsd_getpgrp c __bzero c +__cabsieee128 m +__cacoshieee128 m +__cacosieee128 m +__canonicalizeieee128 m +__cargieee128 m +__casinhieee128 m +__casinieee128 m +__catanhieee128 m +__catanieee128 m +__cbrtieee128 m +__ccoshieee128 m +__ccosieee128 m +__ceilieee128 m +__cexpieee128 m __check_rhosts_file c __chk_fail c +__cimagieee128 m __clog10 m __clog10f m +__clog10ieee128 m __clog10l m +__clogieee128 m __clone c __close c __cmpdi2 c __cmsg_nxthdr c __confstr_chk c +__conjieee128 m __connect c +__copysignieee128 m __cosh_finite m __coshf128_finite m __coshf_finite m +__coshieee128 m __coshl_finite m +__cosieee128 m +__cpowieee128 m +__cprojieee128 m +__crealieee128 m +__csinhieee128 m +__csinieee128 m +__csqrtieee128 m +__ctanhieee128 m +__ctanieee128 m __ctype32_b c __ctype32_tolower c __ctype32_toupper c @@ -300,33 +340,55 @@ __divdf3 c __divdi3 c __divsf3 c __dprintf_chk c +__dprintf_chkieee128 c +__dprintfieee128 c __dup2 c __duplocale c __endmntent c __environ c __eqdf2 c __eqsf2 c +__erfcieee128 m +__erfieee128 m +__errieee128 c __errno_location c +__error_at_lineieee128 c +__errorieee128 c +__errxieee128 c __exp10_finite m __exp10f128_finite m __exp10f_finite m +__exp10ieee128 m __exp10l_finite m __exp2_finite m __exp2f128_finite m __exp2f_finite m +__exp2ieee128 m __exp2l_finite m __exp_finite m __expf128_finite m __expf_finite m +__expieee128 m __expl m __expl_finite m __explicit_bzero_chk c +__expm1ieee128 m __expm1l m __extendsfdf2 c +__f32addieee128 m +__f32divieee128 m +__f32mulieee128 m +__f32subieee128 m +__f64addieee128 m +__f64divieee128 m +__f64mulieee128 m +__f64subieee128 m +__fabsieee128 m __fbufsize c __fcntl c __fdelt_chk c __fdelt_warn c +__fdimieee128 m __fe_dfl_env m __fe_dfl_mode m __fe_enabled_env m @@ -359,10 +421,17 @@ __floatundidf c __floatundisf c __floatunsidf c __floatunsisf c +__floorieee128 m __flt_rounds c +__fmaieee128 m +__fmaxieee128 m +__fmaxmagieee128 m +__fminieee128 m +__fminmagieee128 m __fmod_finite m __fmodf128_finite m __fmodf_finite m +__fmodieee128 m __fmodl_finite m __fork c __fpclassify m @@ -371,6 +440,8 @@ __fpclassifyf128 m __fpclassifyl m __fpending c __fprintf_chk c +__fprintf_chkieee128 c +__fprintfieee128 c __fpu_control c __fpurge c __frame_state_for c @@ -380,10 +451,17 @@ __freadable c __freading c __free_hook c __freelocale c +__frexpieee128 m +__fromfpieee128 m +__fromfpxieee128 m +__fscanfieee128 c __fsetlocking c __fwprintf_chk c +__fwprintf_chkieee128 c +__fwprintfieee128 c __fwritable c __fwriting c +__fwscanfieee128 c __fxstat c __fxstat64 c __fxstatat c @@ -403,6 +481,7 @@ __gethostname_chk c __getlogin_r_chk c __getmntent_r c __getpagesize c +__getpayloadieee128 m __getpgid c __getpid c __gets_chk c @@ -418,7 +497,9 @@ __h_errno_location c __hypot_finite m __hypotf128_finite m __hypotf_finite m +__hypotieee128 m __hypotl_finite m +__ilogbieee128 m __isalnum_l c __isalpha_l c __isascii_l c @@ -442,17 +523,29 @@ __isnanf c __isnanf128 m __isnanl c __isoc99_fscanf c +__isoc99_fscanfieee128 c __isoc99_fwscanf c +__isoc99_fwscanfieee128 c __isoc99_scanf c +__isoc99_scanfieee128 c __isoc99_sscanf c +__isoc99_sscanfieee128 c __isoc99_swscanf c +__isoc99_swscanfieee128 c __isoc99_vfscanf c +__isoc99_vfscanfieee128 c __isoc99_vfwscanf c +__isoc99_vfwscanfieee128 c __isoc99_vscanf c +__isoc99_vscanfieee128 c __isoc99_vsscanf c +__isoc99_vsscanfieee128 c __isoc99_vswscanf c +__isoc99_vswscanfieee128 c __isoc99_vwscanf c +__isoc99_vwscanfieee128 c __isoc99_wscanf c +__isoc99_wscanfieee128 c __isprint_l c __ispunct_l c __issignaling m @@ -480,23 +573,29 @@ __ivaliduser c __j0_finite m __j0f128_finite m __j0f_finite m +__j0ieee128 m __j0l_finite m __j1_finite m __j1f128_finite m __j1f_finite m +__j1ieee128 m __j1l_finite m __jn_finite m __jnf128_finite m __jnf_finite m +__jnieee128 m __jnl_finite m __key_decryptsession_pk_LOCAL c __key_encryptsession_pk_LOCAL c __key_gendes_LOCAL c +__ldexpieee128 m __ledf2 c __lesf2 c __lgamma_r_finite m __lgammaf128_r_finite m __lgammaf_r_finite m +__lgammaieee128 m +__lgammaieee128_r m __lgammal_r_finite m __libc_allocate_rtsig c __libc_calloc c @@ -512,23 +611,34 @@ __libc_memalign c __libc_pvalloc c __libc_realloc c __libc_sa_len c +__libc_single_threaded c __libc_stack_end ld __libc_start_main c __libc_valloc c __libpthread_version_placeholder pthread +__llogbieee128 m +__llrintieee128 m +__llroundieee128 m __log10_finite m __log10f128_finite m __log10f_finite m +__log10ieee128 m __log10l_finite m +__log1pieee128 m __log2_finite m __log2f128_finite m __log2f_finite m +__log2ieee128 m __log2l_finite m __log_finite m +__logbieee128 m __logf128_finite m __logf_finite m +__logieee128 m __logl_finite m __longjmp_chk c +__lrintieee128 m +__lroundieee128 m __lseek c __lshrdi3 c __ltdf2 c @@ -567,17 +677,26 @@ __memset_gg c __mips_fpu_getcw c __mips_fpu_setcw c __moddi3 c +__modfieee128 m __monstartup c __morecore c __mq_open_2 rt __muldf3 c __mulsf3 c +__nanieee128 m __nanosleep c +__nearbyintieee128 m __nedf2 c __negdf2 c __negsf2 c __nesf2 c __newlocale c +__nextafterieee128 m +__nextdownieee128 m +__nexttoward_to_ieee128 m +__nexttowardf_to_ieee128 m +__nexttowardieee128 m +__nextupieee128 m __nl_langinfo_l c __nldbl__IO_fprintf c __nldbl__IO_printf c @@ -690,7 +809,11 @@ __nss_hosts_lookup c __nss_next c __nss_passwd_lookup c __obstack_printf_chk c +__obstack_printf_chkieee128 c +__obstack_printfieee128 c __obstack_vprintf_chk c +__obstack_vprintf_chkieee128 c +__obstack_vprintfieee128 c __open c __open64 c __open64_2 c @@ -706,6 +829,7 @@ __posix_getopt c __pow_finite m __powf128_finite m __powf_finite m +__powieee128 m __powl_finite m __ppc_get_timebase_freq c __ppoll_chk c @@ -713,7 +837,10 @@ __pread64 c __pread64_chk c __pread_chk c __printf_chk c +__printf_chkieee128 c __printf_fp c +__printf_sizeieee128 c +__printfieee128 c __profile_frequency c __progname c __progname_full c @@ -744,6 +871,11 @@ __pthread_unregister_cancel_restore pthread __pthread_unwind_next pthread __ptsname_r_chk c __pwrite64 c +__qecvtieee128 c +__qecvtieee128_r c +__qfcvtieee128 c +__qfcvtieee128_r c +__qgcvtieee128 c __rawmemchr c __rcmd_errstr c __read c @@ -762,12 +894,17 @@ __register_frame_table c __remainder_finite m __remainderf128_finite m __remainderf_finite m +__remainderieee128 m __remainderl_finite m +__remquoieee128 m __res_init c __res_nclose c __res_ninit c __res_randomid c __res_state c +__rintieee128 m +__roundevenieee128 m +__roundieee128 m __rpc_thread_createerr c __rpc_thread_svc_fdset c __rpc_thread_svc_max_pollfd c @@ -775,7 +912,11 @@ __rpc_thread_svc_pollfd c __sbrk c __scalb_finite m __scalbf_finite m +__scalbieee128 m __scalbl_finite m +__scalblnieee128 m +__scalbnieee128 m +__scanfieee128 c __sched_cpualloc c __sched_cpucount c __sched_cpufree c @@ -789,6 +930,8 @@ __secure_getenv c __select c __send c __setmntent c +__setpayloadieee128 m +__setpayloadsigieee128 m __setpgid c __sigaction c __sigaddset c @@ -799,24 +942,34 @@ __signbitf c __signbitf128 m __signbitl c __signgam m +__significandieee128 m __sigpause c __sigsetjmp c __sigsuspend c __sim_disabled_exceptions c __sim_exceptions c __sim_round_mode c +__sincosieee128 m __sinh_finite m __sinhf128_finite m __sinhf_finite m +__sinhieee128 m __sinhl_finite m +__sinieee128 m __snprintf_chk c +__snprintf_chkieee128 c +__snprintfieee128 c __sprintf_chk c +__sprintf_chkieee128 c +__sprintfieee128 c __sqrt_finite m __sqrtdf2 c __sqrtf128_finite m __sqrtf_finite m +__sqrtieee128 m __sqrtl_finite m __sqrtsf2 c +__sscanfieee128 c __stack_chk_fail c __stack_chk_guard ld __statfs c @@ -849,6 +1002,9 @@ __strcspn_g c __strdup c __strerror_r c __strfmon_l c +__strfmon_lieee128 c +__strfmonieee128 c +__strfromieee128 c __strftime_l c __strlen_g c __strncasecmp_l c @@ -883,6 +1039,8 @@ __strtod_l c __strtof128_internal c __strtof_internal c __strtof_l c +__strtoieee128 c +__strtoieee128_l c __strtok_r c __strtok_r_1c c __strtol_internal c @@ -902,48 +1060,93 @@ __strxfrm_l c __subdf3 c __subsf3 c __swprintf_chk c +__swprintf_chkieee128 c +__swprintfieee128 c +__swscanfieee128 c __sysconf c __sysctl c __syslog_chk c +__syslog_chkieee128 c +__syslogieee128 c __sysv_signal c +__tanhieee128 m +__tanieee128 m +__tgammaieee128 m __timezone c __tls_get_addr ld __tls_get_addr_opt ld __tls_get_offset ld __toascii_l c __tolower_l c +__totalorderieee128 m +__totalordermagieee128 m __toupper_l c __towctrans c __towctrans_l c __towlower_l c __towupper_l c __truncdfsf2 c +__truncieee128 m __ttyname_r_chk c __tzname c __ucmpdi2 c __udivdi3 c __uflow c +__ufromfpieee128 m +__ufromfpxieee128 m __umoddi3 c __underflow c __unorddf2 c __unordsf2 c __uselocale c __vasprintf_chk c +__vasprintf_chkieee128 c +__vasprintfieee128 c __vdprintf_chk c +__vdprintf_chkieee128 c +__vdprintfieee128 c +__verrieee128 c +__verrxieee128 c __vfork c __vfprintf_chk c +__vfprintf_chkieee128 c +__vfprintfieee128 c __vfscanf c +__vfscanfieee128 c __vfwprintf_chk c +__vfwprintf_chkieee128 c +__vfwprintfieee128 c +__vfwscanfieee128 c __vprintf_chk c +__vprintf_chkieee128 c +__vprintfieee128 c +__vscanfieee128 c __vsnprintf c __vsnprintf_chk c +__vsnprintf_chkieee128 c +__vsnprintfieee128 c __vsprintf_chk c +__vsprintf_chkieee128 c +__vsprintfieee128 c __vsscanf c +__vsscanfieee128 c __vswprintf_chk c +__vswprintf_chkieee128 c +__vswprintfieee128 c +__vswscanfieee128 c __vsyslog_chk c +__vsyslog_chkieee128 c +__vsyslogieee128 c +__vwarnieee128 c +__vwarnxieee128 c __vwprintf_chk c +__vwprintf_chkieee128 c +__vwprintfieee128 c +__vwscanfieee128 c __wait c __waitpid c +__warnieee128 c +__warnxieee128 c __wcpcpy_chk c __wcpncpy_chk c __wcrtomb_chk c @@ -962,6 +1165,8 @@ __wcstod_l c __wcstof128_internal c __wcstof_internal c __wcstof_l c +__wcstoieee128 c +__wcstoieee128_l c __wcstol_internal c __wcstol_l c __wcstold_internal c @@ -983,7 +1188,10 @@ __wmempcpy_chk c __wmemset_chk c __woverflow c __wprintf_chk c +__wprintf_chkieee128 c +__wprintfieee128 c __write c +__wscanfieee128 c __wuflow c __wunderflow c __xmknod c @@ -996,14 +1204,17 @@ __xstat64 c __y0_finite m __y0f128_finite m __y0f_finite m +__y0ieee128 m __y0l_finite m __y1_finite m __y1f128_finite m __y1f_finite m +__y1ieee128 m __y1l_finite m __yn_finite m __ynf128_finite m __ynf_finite m +__ynieee128 m __ynl_finite m _authenticate c _dl_mcount ld @@ -2727,17 +2938,19 @@ pthread_attr_getinheritsched c pthread_attr_getschedparam c pthread_attr_getschedpolicy c pthread_attr_getscope c +pthread_attr_getsigmask_np c pthread_attr_getstack pthread pthread_attr_getstackaddr pthread pthread_attr_getstacksize pthread pthread_attr_init c -pthread_attr_setaffinity_np pthread +pthread_attr_setaffinity_np c pthread_attr_setdetachstate c pthread_attr_setguardsize pthread pthread_attr_setinheritsched c pthread_attr_setschedparam c pthread_attr_setschedpolicy c pthread_attr_setscope c +pthread_attr_setsigmask_np c pthread_attr_setstack pthread pthread_attr_setstackaddr pthread pthread_attr_setstacksize pthread @@ -2767,9 +2980,9 @@ pthread_create pthread pthread_detach pthread pthread_equal c pthread_exit c -pthread_getaffinity_np pthread +pthread_getaffinity_np c pthread_getattr_default_np pthread -pthread_getattr_np pthread +pthread_getattr_np c pthread_getconcurrency pthread pthread_getcpuclockid pthread pthread_getname_np pthread @@ -2835,7 +3048,7 @@ pthread_setname_np pthread pthread_setschedparam c pthread_setschedprio pthread pthread_setspecific pthread -pthread_sigmask pthread +pthread_sigmask c pthread_sigqueue pthread pthread_spin_destroy pthread pthread_spin_init pthread @@ -3140,12 +3353,14 @@ shmctl c shmdt c shmget c shutdown c +sigabbrev_np c sigaction c sigaddset c sigaltstack c sigandset c sigblock c sigdelset c +sigdescr_np c sigemptyset c sigfillset c siggetmask c @@ -3251,6 +3466,8 @@ strdup c strerror c strerror_l c strerror_r c +strerrordesc_np c +strerrorname_np c strfmon c strfmon_l c strfromd c diff --git a/lib/libc/glibc/vers.txt b/lib/libc/glibc/vers.txt index a76ef9b25d..185bd5195f 100644 --- a/lib/libc/glibc/vers.txt +++ b/lib/libc/glibc/vers.txt @@ -40,3 +40,4 @@ GLIBC_2.28 GLIBC_2.29 GLIBC_2.30 GLIBC_2.31 +GLIBC_2.32 From 23a81b439638fee89054ad749f0348ab7d107619 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 24 Aug 2020 02:27:26 +1000 Subject: [PATCH 31/55] std: refactor fs.openFileZ flag handling --- lib/std/fs.zig | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/std/fs.zig b/lib/std/fs.zig index df368e070b..d9c949ef33 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -686,21 +686,25 @@ pub const Dir = struct { return self.openFileW(path_w.span(), flags); } + var os_flags: u32 = os.O_CLOEXEC; // Use the O_ locking flags if the os supports them // (Or if it's darwin, as darwin's `open` doesn't support the O_SYNC flag) const has_flock_open_flags = @hasDecl(os, "O_EXLOCK") and !is_darwin; - const nonblocking_lock_flag = if (has_flock_open_flags and flags.lock_nonblocking) - os.O_NONBLOCK | os.O_SYNC - else - @as(u32, 0); - const lock_flag: u32 = if (has_flock_open_flags) switch (flags.lock) { - .None => @as(u32, 0), - .Shared => os.O_SHLOCK | nonblocking_lock_flag, - .Exclusive => os.O_EXLOCK | nonblocking_lock_flag, - } else 0; - - const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; - const os_flags = lock_flag | O_LARGEFILE | os.O_CLOEXEC | if (flags.write and flags.read) + if (has_flock_open_flags) { + const nonblocking_lock_flag = if (flags.lock_nonblocking) + os.O_NONBLOCK | os.O_SYNC + else + @as(u32, 0); + os_flags |= switch (flags.lock) { + .None => @as(u32, 0), + .Shared => os.O_SHLOCK | nonblocking_lock_flag, + .Exclusive => os.O_EXLOCK | nonblocking_lock_flag, + }; + } + if (@hasDecl(os, "O_LARGEFILE")) { + os_flags |= os.O_LARGEFILE; + } + os_flags |= if (flags.write and flags.read) @as(u32, os.O_RDWR) else if (flags.write) @as(u32, os.O_WRONLY) From 129d3e274dbc3e11a30e3d54c5da7a944ddcf4f0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 24 Aug 2020 02:28:31 +1000 Subject: [PATCH 32/55] std: use O_NOCTTY flag --- lib/std/fs.zig | 3 +++ lib/std/fs/file.zig | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/std/fs.zig b/lib/std/fs.zig index d9c949ef33..21a00eeb1d 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -704,6 +704,9 @@ pub const Dir = struct { if (@hasDecl(os, "O_LARGEFILE")) { os_flags |= os.O_LARGEFILE; } + if (!flags.allow_ctty) { + os_flags |= os.O_NOCTTY; + } os_flags |= if (flags.write and flags.read) @as(u32, os.O_RDWR) else if (flags.write) diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index 3e22528ea9..6fb2385a85 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -101,6 +101,10 @@ pub const File = struct { /// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions /// related to opening the file, reading, writing, and locking. intended_io_mode: io.ModeOverride = io.default_mode, + + /// Set this to allow the opened file to automatically become the + /// controlling TTY for the current process. + allow_ctty: bool = false, }; /// TODO https://github.com/ziglang/zig/issues/3802 From f31cee5393bbfd29883a7b253cd518db145b8b19 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Wed, 19 Aug 2020 20:51:56 +0200 Subject: [PATCH 33/55] Start working on stage2 ARM backend - add codegen/arm.zig with some basic functionality (load/store, data processing, branching, software interrupts) --- src-self-hosted/codegen.zig | 1 + src-self-hosted/codegen/arm.zig | 566 ++++++++++++++++++++++++++++++++ 2 files changed, 567 insertions(+) create mode 100644 src-self-hosted/codegen/arm.zig diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 93305b70e3..a1145a6c52 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -2372,6 +2372,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .x86_64 => @import("codegen/x86_64.zig"), .riscv64 => @import("codegen/riscv64.zig"), .spu_2 => @import("codegen/spu-mk2.zig"), + .arm => @import("codegen/arm.zig"), else => struct { pub const Register = enum { dummy, diff --git a/src-self-hosted/codegen/arm.zig b/src-self-hosted/codegen/arm.zig new file mode 100644 index 0000000000..7674e8af33 --- /dev/null +++ b/src-self-hosted/codegen/arm.zig @@ -0,0 +1,566 @@ +const std = @import("std"); +const testing = std.testing; + +/// The condition field specifies the flags neccessary for an +/// Instruction to be executed +pub const Condition = enum(u4) { + /// equal + eq, + /// not equal + ne, + /// unsigned higher or same + cs, + /// unsigned lower + cc, + /// negative + mi, + /// positive or zero + pl, + /// overflow + vs, + /// no overflow + vc, + /// unsigned higer + hi, + /// unsigned lower or same + ls, + /// greater or equal + ge, + /// less than + lt, + /// greater than + gt, + /// less than or equal + le, + /// always + al, +}; + +/// Represents a register in the ARM instruction set architecture +pub const Register = enum(u5) { + r0, + r1, + r2, + r3, + r4, + r5, + r6, + r7, + r8, + r9, + r10, + r11, + r12, + r13, + r14, + r15, + + /// Argument / result / scratch register 1 + a1, + /// Argument / result / scratch register 2 + a2, + /// Argument / scratch register 3 + a3, + /// Argument / scratch register 4 + a4, + /// Variable-register 1 + v1, + /// Variable-register 2 + v2, + /// Variable-register 3 + v3, + /// Variable-register 4 + v4, + /// Variable-register 5 + v5, + /// Platform register + v6, + /// Variable-register 7 + v7, + /// Frame pointer or Variable-register 8 + fp, + /// Intra-Procedure-call scratch register + ip, + /// Stack pointer + sp, + /// Link register + lr, + /// Program counter + pc, + + /// Returns the unique 4-bit ID of this register which is used in + /// the machine code + pub fn id(self: Register) u4 { + return @truncate(u4, @enumToInt(self)); + } +}; + +test "Register.id" { + testing.expectEqual(@as(u4, 15), Register.r15.id()); + testing.expectEqual(@as(u4, 15), Register.pc.id()); +} + +pub const callee_preserved_regs = [_]Register{ .r0, .r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8, .r10 }; +pub const c_abi_int_param_regs = [_]Register{ .r0, .r1, .r2, .r3 }; +pub const c_abi_int_return_regs = [_]Register{ .r0, .r1 }; + +/// Represents an instruction in the ARM instruction set architecture +pub const Instruction = union(enum) { + DataProcessing: packed struct { + // Note to self: The order of the fields top-to-bottom is + // right-to-left in the actual 32-bit int representation + op2: u12, + rd: u4, + rn: u4, + s: u1, + opcode: u4, + i: u1, + fixed: u2 = 0b00, + cond: u4, + }, + SingleDataTransfer: packed struct { + offset: u12, + rd: u4, + rn: u4, + l: u1, + w: u1, + b: u1, + u: u1, + p: u1, + i: u1, + fixed: u2 = 0b01, + cond: u4, + }, + Branch: packed struct { + offset: u24, + link: u1, + fixed: u3 = 0b101, + cond: u4, + }, + BranchExchange: packed struct { + rn: u4, + fixed_1: u1 = 0b1, + link: u1, + fixed_2: u22 = 0b0001_0010_1111_1111_1111_00, + cond: u4, + }, + SoftwareInterrupt: packed struct { + comment: u24, + fixed: u4 = 0b1111, + cond: u4, + }, + + /// Represents the possible operations which can be performed by a + /// DataProcessing instruction + const Opcode = enum(u4) { + // Rd := Op1 AND Op2 + @"and", + // Rd := Op1 EOR Op2 + eor, + // Rd := Op1 - Op2 + sub, + // Rd := Op2 - Op1 + rsb, + // Rd := Op1 + Op2 + add, + // Rd := Op1 + Op2 + C + adc, + // Rd := Op1 - Op2 + C - 1 + sbc, + // Rd := Op2 - Op1 + C - 1 + rsc, + // set condition codes on Op1 AND Op2 + tst, + // set condition codes on Op1 EOR Op2 + teq, + // set condition codes on Op1 - Op2 + cmp, + // set condition codes on Op1 + Op2 + cmn, + // Rd := Op1 OR Op2 + orr, + // Rd := Op2 + mov, + // Rd := Op1 AND NOT Op2 + bic, + // Rd := NOT Op2 + mvn, + }; + + /// Represents the second operand to a data processing instruction + /// which can either be content from a register or an immediate + /// value + pub const Operand = union(enum) { + Register: packed struct { + rm: u4, + shift: u8, + }, + Immediate: packed struct { + imm: u8, + rotate: u4, + }, + + /// Represents multiple ways a register can be shifted. A + /// register can be shifted by a specific immediate value or + /// by the contents of another register + pub const Shift = union(enum) { + Immediate: packed struct { + fixed: u1 = 0b0, + typ: u2, + amount: u5, + }, + Register: packed struct { + fixed_1: u1 = 0b1, + typ: u2, + fixed_2: u1 = 0b0, + rs: u4, + }, + + const Type = enum(u2) { + LogicalLeft, + LogicalRight, + ArithmeticRight, + RotateRight, + }; + + const none = Shift{ + .Immediate = .{ + .amount = 0, + .typ = 0, + }, + }; + + pub fn toU8(self: Shift) u8 { + return switch (self) { + .Register => |v| @bitCast(u8, v), + .Immediate => |v| @bitCast(u8, v), + }; + } + + pub fn reg(rs: Register, typ: Type) Shift { + return Shift{ + .Register = .{ + .rs = rs.id(), + .typ = @enumToInt(typ), + }, + }; + } + + pub fn imm(amount: u5, typ: Type) Shift { + return Shift{ + .Immediate = .{ + .amount = amount, + .typ = @enumToInt(typ), + }, + }; + } + }; + + pub fn toU12(self: Operand) u12 { + return switch (self) { + .Register => |v| @bitCast(u12, v), + .Immediate => |v| @bitCast(u12, v), + }; + } + + pub fn reg(rm: Register, shift: Shift) Operand { + return Operand{ + .Register = .{ + .rm = rm.id(), + .shift = shift.toU8(), + }, + }; + } + + pub fn imm(immediate: u8, rotate: u4) Operand { + return Operand{ + .Immediate = .{ + .imm = immediate, + .rotate = rotate, + }, + }; + } + }; + + /// Represents the offset operand of a load or store + /// instruction. Data can be loaded from memory with either an + /// immediate offset or an offset that is stored in some register. + pub const Offset = union(enum) { + Immediate: u12, + Register: packed struct { + rm: u4, + shift: u8, + }, + + pub const none = Offset{ + .Immediate = 0, + }; + + pub fn toU12(self: Offset) u12 { + return switch (self) { + .Register => |v| @bitCast(u12, v), + .Immediate => |v| v, + }; + } + + pub fn reg(rm: Register, shift: u8) Offset { + return Offset{ + .Register = .{ + .rm = rm.id(), + .shift = shift, + }, + }; + } + + pub fn imm(immediate: u8) Offset { + return Offset{ + .Immediate = immediate, + }; + } + }; + + pub fn toU32(self: Instruction) u32 { + return switch (self) { + .DataProcessing => |v| @bitCast(u32, v), + .SingleDataTransfer => |v| @bitCast(u32, v), + .Branch => |v| @bitCast(u32, v), + .BranchExchange => |v| @bitCast(u32, v), + .SoftwareInterrupt => |v| @bitCast(u32, v), + }; + } + + // Helper functions for the "real" functions below + + fn dataProcessing( + cond: Condition, + opcode: Opcode, + s: u1, + rn: Register, + rd: Register, + op2: Operand, + ) Instruction { + return Instruction{ + .DataProcessing = .{ + .cond = @enumToInt(cond), + .i = if (op2 == .Immediate) 1 else 0, + .opcode = @enumToInt(opcode), + .s = s, + .rn = rn.id(), + .rd = rd.id(), + .op2 = op2.toU12(), + }, + }; + } + + fn singleDataTransfer( + cond: Condition, + rd: Register, + rn: Register, + offset: Offset, + pre_post: u1, + up_down: u1, + byte_word: u1, + writeback: u1, + load_store: u1, + ) Instruction { + return Instruction{ + .SingleDataTransfer = .{ + .cond = @enumToInt(cond), + .rn = rn.id(), + .rd = rd.id(), + .offset = offset.toU12(), + .l = load_store, + .w = writeback, + .b = byte_word, + .u = up_down, + .p = pre_post, + .i = if (offset == .Immediate) 1 else 0, + }, + }; + } + + fn branch(cond: Condition, offset: i24, link: u1) Instruction { + return Instruction{ + .Branch = .{ + .cond = @enumToInt(cond), + .link = link, + .offset = @bitCast(u24, offset), + }, + }; + } + + fn branchExchange(cond: Condition, rn: Register, link: u1) Instruction { + return Instruction{ + .BranchExchange = .{ + .cond = @enumToInt(cond), + .link = link, + .rn = rn.id(), + }, + }; + } + + fn softwareInterrupt(cond: Condition, comment: u24) Instruction { + return Instruction{ + .SoftwareInterrupt = .{ + .cond = @enumToInt(cond), + .comment = comment, + }, + }; + } + + // Public functions replicating assembler syntax as closely as + // possible + + // Data processing + + pub fn @"and"(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .@"and", s, rd, rn, op2); + } + + pub fn eor(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .eor, s, rd, rn, op2); + } + + pub fn sub(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .sub, s, rd, rn, op2); + } + + pub fn rsb(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .rsb, s, rd, rn, op2); + } + + pub fn add(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .add, s, rd, rn, op2); + } + + pub fn adc(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .adc, s, rd, rn, op2); + } + + pub fn sbc(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .sbc, s, rd, rn, op2); + } + + pub fn rsc(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .rsc, s, rd, rn, op2); + } + + pub fn tst(cond: Condition, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .tst, 1, .r0, rn, op2); + } + + pub fn teq(cond: Condition, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .teq, 1, .r0, rn, op2); + } + + pub fn cmp(cond: Condition, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .cmp, 1, .r0, rn, op2); + } + + pub fn cmn(cond: Condition, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .cmn, 1, .r0, rn, op2); + } + + pub fn orr(cond: Condition, s: u1, rd: Register, rn: Register, op2: Operand) Instruction { + return dataProcessing(cond, .orr, s, rd, rn, op2); + } + + pub fn mov(cond: Condition, s: u1, rd: Register, op2: Operand) Instruction { + return dataProcessing(cond, .mov, s, rd, .r0, op2); + } + + pub fn bic(cond: Condition, s: u1, rd: Register, op2: Operand) Instruction { + return dataProcessing(cond, .bic, s, rd, rn, op2); + } + + pub fn mvn(cond: Condition, s: u1, rd: Register, op2: Operand) Instruction { + return dataProcessing(cond, .mvn, s, rd, .r0, op2); + } + + // Single data transfer + + pub fn ldr(cond: Condition, rd: Register, rn: Register, offset: Offset) Instruction { + return singleDataTransfer(cond, rd, rn, offset, 1, 1, 0, 0, 1); + } + + pub fn str(cond: Condition, rd: Register, rn: Register, offset: Offset) Instruction { + return singleDataTransfer(cond, rd, rn, offset, 1, 1, 0, 0, 0); + } + + // Branch + + pub fn b(cond: Condition, offset: i24) Instruction { + return branch(cond, offset, 0); + } + + pub fn bl(cond: Condition, offset: i24) Instruction { + return branch(cond, offset, 1); + } + + // Branch and exchange + + pub fn bx(cond: Condition, rn: Register) Instruction { + return branchExchange(cond, rn, 0); + } + + pub fn blx(cond: Condition, rn: Register) Instruction { + return branchExchange(cond, rn, 1); + } + + // Software interrupt + + pub fn swi(cond: Condition, comment: u24) Instruction { + return softwareInterrupt(cond, comment); + } +}; + +test "serialize instructions" { + const Testcase = struct { + inst: Instruction, + expected: u32, + }; + + const testcases = [_]Testcase{ + .{ // add r0, r0, r0 + .inst = Instruction.add(.al, 0, .r0, .r0, Instruction.Operand.reg(.r0, Instruction.Operand.Shift.none)), + .expected = 0b1110_00_0_0100_0_0000_0000_00000000_0000, + }, + .{ // mov r4, r2 + .inst = Instruction.mov(.al, 0, .r4, Instruction.Operand.reg(.r2, Instruction.Operand.Shift.none)), + .expected = 0b1110_00_0_1101_0_0100_0000_00000000_0010, + }, + .{ // mov r0, #42 + .inst = Instruction.mov(.al, 0, .r0, Instruction.Operand.imm(42, 0)), + .expected = 0b1110_00_1_1101_0_0000_0000_0000_00101010, + }, + .{ // ldr r0, [r2, #42] + .inst = Instruction.ldr(.al, .r0, .r2, Instruction.Offset.imm(42)), + .expected = 0b1110_01_1_1_1_0_0_1_0010_0000_000000101010, + }, + .{ // str r0, [r3] + .inst = Instruction.str(.al, .r0, .r3, Instruction.Offset.none), + .expected = 0b1110_01_1_1_1_0_0_0_0011_0000_000000000000, + }, + .{ // b #12 + .inst = Instruction.b(.al, 12), + .expected = 0b1110_101_0_0000_0000_0000_0000_0000_1100, + }, + .{ // bl #-4 + .inst = Instruction.bl(.al, -4), + .expected = 0b1110_101_1_1111_1111_1111_1111_1111_1100, + }, + .{ // bx lr + .inst = Instruction.bx(.al, .lr), + .expected = 0b1110_0001_0010_1111_1111_1111_0001_1110, + }, + .{ // swi #0 + .inst = Instruction.swi(.al, 0), + .expected = 0b1110_1111_0000_0000_0000_0000_0000_0000, + }, + }; + + for (testcases) |case| { + const actual = case.inst.toU32(); + testing.expectEqual(case.expected, actual); + } +} From 1c53c070535c519cbdc39a2094a24723f5245799 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Thu, 20 Aug 2020 23:09:46 +0200 Subject: [PATCH 34/55] stage2: Implement genBreakpoint for ARM --- src-self-hosted/codegen.zig | 13 ++++++++--- src-self-hosted/codegen/arm.zig | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index a1145a6c52..1e26f4ccf2 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -76,8 +76,8 @@ pub fn generateSymbol( switch (bin_file.options.target.cpu.arch) { .wasm32 => unreachable, // has its own code path .wasm64 => unreachable, // has its own code path - //.arm => return Function(.arm).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), - //.armeb => return Function(.armeb).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), + .arm => return Function(.arm).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), + .armeb => return Function(.armeb).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.aarch64 => return Function(.aarch64).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.aarch64_be => return Function(.aarch64_be).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), //.aarch64_32 => return Function(.aarch64_32).generateSymbol(bin_file, src, typed_value, code, dbg_line, dbg_info, dbg_info_type_relocs), @@ -1270,8 +1270,14 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { var instr = Instruction{ .condition = .always, .input0 = .zero, .input1 = .zero, .modify_flags = false, .output = .discard, .command = .undefined1 }; mem.writeIntLittle(u16, self.code.items[self.code.items.len - 2 ..][0..2], @bitCast(u16, instr)); }, + .arm => { + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.bkpt(0).toU32()); + }, + .armeb => { + mem.writeIntBig(u32, try self.code.addManyAsArray(4), Instruction.bkpt(0).toU32()); + }, else => return self.fail(src, "TODO implement @breakpoint() for {}", .{self.target.cpu.arch}), - } + } return .none; } @@ -2373,6 +2379,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .riscv64 => @import("codegen/riscv64.zig"), .spu_2 => @import("codegen/spu-mk2.zig"), .arm => @import("codegen/arm.zig"), + .armeb => @import("codegen/arm.zig"), else => struct { pub const Register = enum { dummy, diff --git a/src-self-hosted/codegen/arm.zig b/src-self-hosted/codegen/arm.zig index 7674e8af33..f509d4b6e4 100644 --- a/src-self-hosted/codegen/arm.zig +++ b/src-self-hosted/codegen/arm.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const DW = std.dwarf; const testing = std.testing; /// The condition field specifies the flags neccessary for an @@ -93,6 +94,18 @@ pub const Register = enum(u5) { pub fn id(self: Register) u4 { return @truncate(u4, @enumToInt(self)); } + + /// Returns the index into `callee_preserved_regs`. + pub fn allocIndex(self: Register) ?u4 { + inline for (callee_preserved_regs) |cpreg, i| { + if (self.id() == cpreg.id()) return i; + } + return null; + } + + pub fn dwarfLocOp(self: Register) u8 { + return @as(u8, self.id()) + DW.OP_reg0; + } }; test "Register.id" { @@ -149,6 +162,12 @@ pub const Instruction = union(enum) { fixed: u4 = 0b1111, cond: u4, }, + Breakpoint: packed struct { + imm4: u4, + fixed_1: u4 = 0b0111, + imm12: u12, + fixed_2_and_cond: u12 = 0b1110_0001_0010, + }, /// Represents the possible operations which can be performed by a /// DataProcessing instruction @@ -326,6 +345,7 @@ pub const Instruction = union(enum) { .Branch => |v| @bitCast(u32, v), .BranchExchange => |v| @bitCast(u32, v), .SoftwareInterrupt => |v| @bitCast(u32, v), + .Breakpoint => |v| @intCast(u32, v.imm4) | (@intCast(u32, v.fixed_1) << 4) | (@intCast(u32, v.imm12) << 8) | (@intCast(u32, v.fixed_2_and_cond) << 20), }; } @@ -408,6 +428,15 @@ pub const Instruction = union(enum) { }; } + fn breakpoint(imm: u16) Instruction { + return Instruction{ + .Breakpoint = .{ + .imm12 = @truncate(u12, imm >> 4), + .imm4 = @truncate(u4, imm), + }, + }; + } + // Public functions replicating assembler syntax as closely as // possible @@ -512,6 +541,12 @@ pub const Instruction = union(enum) { pub fn swi(cond: Condition, comment: u24) Instruction { return softwareInterrupt(cond, comment); } + + // Breakpoint + + pub fn bkpt(imm: u16) Instruction { + return breakpoint(imm); + } }; test "serialize instructions" { @@ -557,6 +592,10 @@ test "serialize instructions" { .inst = Instruction.swi(.al, 0), .expected = 0b1110_1111_0000_0000_0000_0000_0000_0000, }, + .{ // bkpt #42 + .inst = Instruction.bkpt(42), + .expected = 0b1110_0001_0010_000000000010_0111_1010, + }, }; for (testcases) |case| { From b2254023e464027abfcbff809e991ff22cf581e0 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Sun, 23 Aug 2020 17:43:00 +0200 Subject: [PATCH 35/55] stage2: Implement setReg, call, ret, asm for ARM These changes enable a Hello World example. However, all implemented codegen is not yet feature-complete. - asm only supports 'svc #0' at the moment - call only supports leaf functions at the moment - setReg uses a naive method at the moment --- src-self-hosted/codegen.zig | 110 ++++++++++++++++++++++++++++++++ src-self-hosted/codegen/arm.zig | 30 +++++---- src-self-hosted/type.zig | 1 + 3 files changed, 127 insertions(+), 14 deletions(-) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 1e26f4ccf2..4d6075e2e9 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1399,6 +1399,31 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { return self.fail(inst.base.src, "TODO implement calling runtime known function pointer", .{}); } }, + .arm => { + if (info.args.len > 0) return self.fail(inst.base.src, "TODO implement fn args for {}", .{self.target.cpu.arch}); + + if (inst.func.cast(ir.Inst.Constant)) |func_inst| { + if (func_inst.val.cast(Value.Payload.Function)) |func_val| { + const func = func_val.func; + const got = &elf_file.program_headers.items[elf_file.phdr_got_index.?]; + const ptr_bits = self.target.cpu.arch.ptrBitWidth(); + const ptr_bytes: u64 = @divExact(ptr_bits, 8); + const got_addr = @intCast(u32, got.p_vaddr + func.owner_decl.link.elf.offset_table_index * ptr_bytes); + + // TODO only works with leaf functions + // at the moment, which works fine for + // Hello World, but not for real code + // of course. Add pushing lr to stack + // and popping after call + try self.genSetReg(inst.base.src, .lr, .{ .memory = got_addr }); + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.blx(.al, .lr).toU32()); + } else { + return self.fail(inst.base.src, "TODO implement calling bitcasted functions", .{}); + } + } else { + return self.fail(inst.base.src, "TODO implement calling runtime known function pointer", .{}); + } + }, else => return self.fail(inst.base.src, "TODO implement call for {}", .{self.target.cpu.arch}), } } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { @@ -1455,6 +1480,9 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .riscv64 => { mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.jalr(.zero, 0, .ra).toU32()); }, + .arm => { + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.bx(.al, .lr).toU32()); + }, else => return self.fail(src, "TODO implement return for {}", .{self.target.cpu.arch}), } return .unreach; @@ -1705,6 +1733,36 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { return self.fail(inst.base.src, "TODO implement support for more SPU II assembly instructions", .{}); } }, + .arm => { + for (inst.inputs) |input, i| { + if (input.len < 3 or input[0] != '{' or input[input.len - 1] != '}') { + return self.fail(inst.base.src, "unrecognized asm input constraint: '{}'", .{input}); + } + const reg_name = input[1 .. input.len - 1]; + const reg = parseRegName(reg_name) orelse + return self.fail(inst.base.src, "unrecognized register: '{}'", .{reg_name}); + const arg = try self.resolveInst(inst.args[i]); + try self.genSetReg(inst.base.src, reg, arg); + } + + if (mem.eql(u8, inst.asm_source, "svc #0")) { + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.svc(.al, 0).toU32()); + } else { + return self.fail(inst.base.src, "TODO implement support for more arm assembly instructions", .{}); + } + + if (inst.output) |output| { + if (output.len < 4 or output[0] != '=' or output[1] != '{' or output[output.len - 1] != '}') { + return self.fail(inst.base.src, "unrecognized asm output constraint: '{}'", .{output}); + } + const reg_name = output[2 .. output.len - 1]; + const reg = parseRegName(reg_name) orelse + return self.fail(inst.base.src, "unrecognized register: '{}'", .{reg_name}); + return MCValue{ .register = reg }; + } else { + return MCValue.none; + } + }, .riscv64 => { for (inst.inputs) |input, i| { if (input.len < 3 or input[0] != '{' or input[input.len - 1] != '}') { @@ -1898,6 +1956,58 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { fn genSetReg(self: *Self, src: usize, reg: Register, mcv: MCValue) InnerError!void { switch (arch) { + .arm => switch (mcv) { + .dead => unreachable, + .ptr_stack_offset => unreachable, + .ptr_embedded_in_code => unreachable, + .unreach, .none => return, // Nothing to do. + .undef => { + if (!self.wantSafety()) + return; // The already existing value will do just fine. + // Write the debug undefined value. + return self.genSetReg(src, reg, .{ .immediate = 0xaaaaaaaa }); + }, + .immediate => |x| { + // TODO better analysis of x to determine the + // least amount of necessary instructions (use + // more intelligent rotating) + if (x <= math.maxInt(u8)) { + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.mov(.al, 0, reg, Instruction.Operand.imm(@truncate(u8, x), 0)).toU32()); + return; + } else if (x <= math.maxInt(u16)) { + // TODO Use movw Note: Not supported on + // all ARM targets! + + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.mov(.al, 0, reg, Instruction.Operand.imm(@truncate(u8, x), 0)).toU32()); + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.orr(.al, 0, reg, reg, Instruction.Operand.imm(@truncate(u8, x >> 8), 12)).toU32()); + } else if (x <= math.maxInt(u32)) { + // TODO Use movw and movt Note: Not + // supported on all ARM targets! Also TODO + // write constant to code and load + // relative to pc + + // immediate: 0xaabbccdd + // mov reg, #0xaa + // orr reg, reg, #0xbb, 24 + // orr reg, reg, #0xcc, 16 + // orr reg, reg, #0xdd, 8 + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.mov(.al, 0, reg, Instruction.Operand.imm(@truncate(u8, x), 0)).toU32()); + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.orr(.al, 0, reg, reg, Instruction.Operand.imm(@truncate(u8, x >> 8), 12)).toU32()); + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.orr(.al, 0, reg, reg, Instruction.Operand.imm(@truncate(u8, x >> 16), 8)).toU32()); + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.orr(.al, 0, reg, reg, Instruction.Operand.imm(@truncate(u8, x >> 24), 4)).toU32()); + return; + } else { + return self.fail(src, "ARM registers are 32-bit wide", .{}); + } + }, + .memory => |addr| { + // The value is in memory at a hard-coded address. + // If the type is a pointer, it means the pointer address is at this memory location. + try self.genSetReg(src, reg, .{ .immediate = addr }); + mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.ldr(.al, reg, reg, Instruction.Offset.none).toU32()); + }, + else => return self.fail(src, "TODO implement getSetReg for arm {}", .{mcv}), + }, .riscv64 => switch (mcv) { .dead => unreachable, .ptr_stack_offset => unreachable, diff --git a/src-self-hosted/codegen/arm.zig b/src-self-hosted/codegen/arm.zig index f509d4b6e4..05178ea7d3 100644 --- a/src-self-hosted/codegen/arm.zig +++ b/src-self-hosted/codegen/arm.zig @@ -157,7 +157,7 @@ pub const Instruction = union(enum) { fixed_2: u22 = 0b0001_0010_1111_1111_1111_00, cond: u4, }, - SoftwareInterrupt: packed struct { + SupervisorCall: packed struct { comment: u24, fixed: u4 = 0b1111, cond: u4, @@ -344,7 +344,7 @@ pub const Instruction = union(enum) { .SingleDataTransfer => |v| @bitCast(u32, v), .Branch => |v| @bitCast(u32, v), .BranchExchange => |v| @bitCast(u32, v), - .SoftwareInterrupt => |v| @bitCast(u32, v), + .SupervisorCall => |v| @bitCast(u32, v), .Breakpoint => |v| @intCast(u32, v.imm4) | (@intCast(u32, v.fixed_1) << 4) | (@intCast(u32, v.imm12) << 8) | (@intCast(u32, v.fixed_2_and_cond) << 20), }; } @@ -355,8 +355,8 @@ pub const Instruction = union(enum) { cond: Condition, opcode: Opcode, s: u1, - rn: Register, rd: Register, + rn: Register, op2: Operand, ) Instruction { return Instruction{ @@ -394,7 +394,7 @@ pub const Instruction = union(enum) { .b = byte_word, .u = up_down, .p = pre_post, - .i = if (offset == .Immediate) 1 else 0, + .i = if (offset == .Immediate) 0 else 1, }, }; } @@ -419,9 +419,9 @@ pub const Instruction = union(enum) { }; } - fn softwareInterrupt(cond: Condition, comment: u24) Instruction { + fn supervisorCall(cond: Condition, comment: u24) Instruction { return Instruction{ - .SoftwareInterrupt = .{ + .SupervisorCall = .{ .cond = @enumToInt(cond), .comment = comment, }, @@ -536,10 +536,12 @@ pub const Instruction = union(enum) { return branchExchange(cond, rn, 1); } - // Software interrupt + // Supervisor Call - pub fn swi(cond: Condition, comment: u24) Instruction { - return softwareInterrupt(cond, comment); + pub const swi = svc; + + pub fn svc(cond: Condition, comment: u24) Instruction { + return supervisorCall(cond, comment); } // Breakpoint @@ -562,7 +564,7 @@ test "serialize instructions" { }, .{ // mov r4, r2 .inst = Instruction.mov(.al, 0, .r4, Instruction.Operand.reg(.r2, Instruction.Operand.Shift.none)), - .expected = 0b1110_00_0_1101_0_0100_0000_00000000_0010, + .expected = 0b1110_00_0_1101_0_0000_0100_00000000_0010, }, .{ // mov r0, #42 .inst = Instruction.mov(.al, 0, .r0, Instruction.Operand.imm(42, 0)), @@ -570,11 +572,11 @@ test "serialize instructions" { }, .{ // ldr r0, [r2, #42] .inst = Instruction.ldr(.al, .r0, .r2, Instruction.Offset.imm(42)), - .expected = 0b1110_01_1_1_1_0_0_1_0010_0000_000000101010, + .expected = 0b1110_01_0_1_1_0_0_1_0010_0000_000000101010, }, .{ // str r0, [r3] .inst = Instruction.str(.al, .r0, .r3, Instruction.Offset.none), - .expected = 0b1110_01_1_1_1_0_0_0_0011_0000_000000000000, + .expected = 0b1110_01_0_1_1_0_0_0_0011_0000_000000000000, }, .{ // b #12 .inst = Instruction.b(.al, 12), @@ -588,8 +590,8 @@ test "serialize instructions" { .inst = Instruction.bx(.al, .lr), .expected = 0b1110_0001_0010_1111_1111_1111_0001_1110, }, - .{ // swi #0 - .inst = Instruction.swi(.al, 0), + .{ // svc #0 + .inst = Instruction.svc(.al, 0), .expected = 0b1110_1111_0000_0000_0000_0000_0000_0000, }, .{ // bkpt #42 diff --git a/src-self-hosted/type.zig b/src-self-hosted/type.zig index 2218c49200..37b13c1d15 100644 --- a/src-self-hosted/type.zig +++ b/src-self-hosted/type.zig @@ -756,6 +756,7 @@ pub const Type = extern union { .fn_ccc_void_no_args, // represents machine code; not a pointer .function, // represents machine code; not a pointer => return switch (target.cpu.arch) { + .arm => 4, .riscv64 => 2, else => 1, }, From 4f2618e75bfbaaea755c7fec14f5ae844eb3d0f8 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Sun, 23 Aug 2020 23:10:19 +0200 Subject: [PATCH 36/55] stage2: Add Hello World test for ARM backend --- src-self-hosted/codegen.zig | 2 +- test/stage2/test.zig | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 4d6075e2e9..e0caaba38f 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1277,7 +1277,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { mem.writeIntBig(u32, try self.code.addManyAsArray(4), Instruction.bkpt(0).toU32()); }, else => return self.fail(src, "TODO implement @breakpoint() for {}", .{self.target.cpu.arch}), - } + } return .none; } diff --git a/test/stage2/test.zig b/test/stage2/test.zig index 627cfc7fe0..fee8886ddb 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -18,6 +18,11 @@ const linux_riscv64 = std.zig.CrossTarget{ .os_tag = .linux, }; +const linux_arm = std.zig.CrossTarget{ + .cpu_arch = .arm, + .os_tag = .linux, +}; + const wasi = std.zig.CrossTarget{ .cpu_arch = .wasm32, .os_tag = .wasi, @@ -181,6 +186,41 @@ pub fn addCases(ctx: *TestContext) !void { ); } + { + var case = ctx.exe("hello world", linux_arm); + // Regular old hello world + case.addCompareOutput( + \\export fn _start() noreturn { + \\ print(); + \\ exit(); + \\} + \\ + \\fn print() void { + \\ asm volatile ("svc #0" + \\ : + \\ : [number] "{r7}" (4), + \\ [arg1] "{r0}" (1), + \\ [arg2] "{r1}" (@ptrToInt("Hello, World!\n")), + \\ [arg3] "{r2}" (14) + \\ : "memory" + \\ ); + \\ return; + \\} + \\ + \\fn exit() noreturn { + \\ asm volatile ("svc #0" + \\ : + \\ : [number] "{r7}" (1), + \\ [arg1] "{r0}" (0) + \\ : "memory" + \\ ); + \\ unreachable; + \\} + , + "Hello, World!\n", + ); + } + { var case = ctx.exe("adding numbers at comptime", linux_x64); case.addCompareOutput( From 7015d84e0ca6f02fede45621571084df98dda712 Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 23 Aug 2020 16:10:02 -0300 Subject: [PATCH 37/55] remove licensing comments from init-exe/init-lib --- lib/std/special/init-exe/build.zig | 5 ----- lib/std/special/init-exe/src/main.zig | 5 ----- lib/std/special/init-lib/build.zig | 5 ----- lib/std/special/init-lib/src/main.zig | 5 ----- 4 files changed, 20 deletions(-) diff --git a/lib/std/special/init-exe/build.zig b/lib/std/special/init-exe/build.zig index db818cbe92..fd71588c5f 100644 --- a/lib/std/special/init-exe/build.zig +++ b/lib/std/special/init-exe/build.zig @@ -1,8 +1,3 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2015-2020 Zig Contributors -// This file is part of [zig](https://ziglang.org/), which is MIT licensed. -// The MIT license requires this copyright notice to be included in all copies -// and substantial portions of the software. const Builder = @import("std").build.Builder; pub fn build(b: *Builder) void { diff --git a/lib/std/special/init-exe/src/main.zig b/lib/std/special/init-exe/src/main.zig index e4b2e7d8ec..d29869ff88 100644 --- a/lib/std/special/init-exe/src/main.zig +++ b/lib/std/special/init-exe/src/main.zig @@ -1,8 +1,3 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2015-2020 Zig Contributors -// This file is part of [zig](https://ziglang.org/), which is MIT licensed. -// The MIT license requires this copyright notice to be included in all copies -// and substantial portions of the software. const std = @import("std"); pub fn main() anyerror!void { diff --git a/lib/std/special/init-lib/build.zig b/lib/std/special/init-lib/build.zig index edc8a0215d..558e447c15 100644 --- a/lib/std/special/init-lib/build.zig +++ b/lib/std/special/init-lib/build.zig @@ -1,8 +1,3 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2015-2020 Zig Contributors -// This file is part of [zig](https://ziglang.org/), which is MIT licensed. -// The MIT license requires this copyright notice to be included in all copies -// and substantial portions of the software. const Builder = @import("std").build.Builder; pub fn build(b: *Builder) void { diff --git a/lib/std/special/init-lib/src/main.zig b/lib/std/special/init-lib/src/main.zig index 9a82bcc26b..747bb08573 100644 --- a/lib/std/special/init-lib/src/main.zig +++ b/lib/std/special/init-lib/src/main.zig @@ -1,8 +1,3 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2015-2020 Zig Contributors -// This file is part of [zig](https://ziglang.org/), which is MIT licensed. -// The MIT license requires this copyright notice to be included in all copies -// and substantial portions of the software. const std = @import("std"); const testing = std.testing; From 4bbea3422a7b312a4996e0d6fc35c30dabd692b8 Mon Sep 17 00:00:00 2001 From: LiterallyVoid Date: Sat, 22 Aug 2020 16:50:25 -0700 Subject: [PATCH 38/55] Fix unused argument error when formatting std.Target --- lib/std/target.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/std/target.zig b/lib/std/target.zig index 080ac65f5c..0a87d442d8 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -133,9 +133,7 @@ pub const Target = struct { if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { try std.fmt.format(out_stream, "WindowsVersion.{}", .{@tagName(self)}); } else { - try std.fmt.format(out_stream, "WindowsVersion(", .{@typeName(@This())}); - try std.fmt.format(out_stream, "{}", .{@enumToInt(self)}); - try out_stream.writeAll(")"); + try std.fmt.format(out_stream, "WindowsVersion({})", .{@enumToInt(self)}); } } } From 9589dc4c954c1fd10bdf075c62418aeed42ae96f Mon Sep 17 00:00:00 2001 From: Vexu Date: Sat, 22 Aug 2020 15:25:33 +0300 Subject: [PATCH 39/55] add error checks to `@Type` --- src/ir.cpp | 56 +++++++++++++++++++++++++++++++++++++---- test/compile_errors.zig | 19 ++++++++++++++ 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/src/ir.cpp b/src/ir.cpp index e9ec9c6384..a2056a4c9b 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -2146,6 +2146,7 @@ static IrInstSrc *ir_build_const_undefined(IrBuilderSrc *irb, Scope *scope, AstN IrInstSrcConst *const_instruction = ir_create_instruction(irb, scope, source_node); ir_instruction_append(irb->current_basic_block, &const_instruction->base); const_instruction->value = irb->codegen->intern.for_undefined(); + const_instruction->value->special = ConstValSpecialUndef; return &const_instruction->base; } @@ -14916,6 +14917,9 @@ static IrInstGen *ir_analyze_struct_literal_to_struct(IrAnalyze *ira, IrInst* so field_val->parent.data.p_struct.struct_val = const_result->value; field_val->parent.data.p_struct.field_index = dst_field->src_index; field_values[dst_field->src_index] = field_val; + if (field_val->type->id == ZigTypeIdUndefined && dst_field->type_entry->id != ZigTypeIdUndefined) { + field_values[dst_field->src_index]->special = ConstValSpecialUndef; + } } else { is_comptime = false; } @@ -15648,7 +15652,7 @@ static IrInstGen *ir_analyze_cast(IrAnalyze *ira, IrInst *source_instr, wanted_type->data.array.len == field_count) { return ir_analyze_struct_literal_to_array(ira, source_instr, value, wanted_type); - } else if (wanted_type->id == ZigTypeIdStruct && + } else if (wanted_type->id == ZigTypeIdStruct && !is_slice(wanted_type) && (!is_array_init || field_count == 0)) { return ir_analyze_struct_literal_to_struct(ira, source_instr, value, wanted_type); @@ -22301,6 +22305,7 @@ static IrInstGen *ir_analyze_container_member_access_inner(IrAnalyze *ira, static void memoize_field_init_val(CodeGen *codegen, ZigType *container_type, TypeStructField *field) { if (field->init_val != nullptr) return; + if (field->decl_node == nullptr) return; if (field->decl_node->type != NodeTypeStructField) return; AstNode *init_node = field->decl_node->data.struct_field.value; if (init_node == nullptr) return; @@ -26016,6 +26021,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->special == ConstValSpecialStatic); assert(payload->type == type_info_pointer_type); ZigValue *size_value = get_const_field(ira, source_instr->source_node, payload, "size", 0); + if (size_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + assert(size_value->type == ir_type_info_get_type(ira, "Size", type_info_pointer_type)); BuiltinPtrSize size_enum_index = (BuiltinPtrSize)bigint_as_u32(&size_value->data.x_enum_tag); PtrLen ptr_len = size_enum_index_to_ptr_len(size_enum_index); @@ -26099,13 +26107,21 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->special == ConstValSpecialStatic); assert(payload->type == ir_type_info_get_type(ira, "Optional", nullptr)); ZigType *child_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "child", 0); + if (type_is_invalid(child_type)) + return ira->codegen->invalid_inst_gen->value->type; return get_optional_type(ira->codegen, child_type); } case ZigTypeIdErrorUnion: { assert(payload->special == ConstValSpecialStatic); assert(payload->type == ir_type_info_get_type(ira, "ErrorUnion", nullptr)); ZigType *err_set_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "error_set", 0); + if (type_is_invalid(err_set_type)) + return ira->codegen->invalid_inst_gen->value->type; + ZigType *payload_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "payload", 1); + if (type_is_invalid(payload_type)) + return ira->codegen->invalid_inst_gen->value->type; + return get_error_union_type(ira->codegen, err_set_type, payload_type); } case ZigTypeIdOpaque: { @@ -26119,8 +26135,10 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->special == ConstValSpecialStatic); assert(payload->type == ir_type_info_get_type(ira, "Vector", nullptr)); BigInt *len = get_const_field_lit_int(ira, source_instr->source_node, payload, "len", 0); + if (len == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + ZigType *child_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "child", 1); - Error err; if ((err = ir_validate_vector_elem_type(ira, source_instr->source_node, child_type))) { return ira->codegen->invalid_inst_gen->value->type; } @@ -26130,6 +26148,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->special == ConstValSpecialStatic); assert(payload->type == ir_type_info_get_type(ira, "AnyFrame", nullptr)); ZigType *child_type = get_const_field_meta_type_optional(ira, source_instr->source_node, payload, "child", 0); + if (child_type != nullptr && type_is_invalid(child_type)) + return ira->codegen->invalid_inst_gen->value->type; + return get_any_frame_type(ira->codegen, child_type); } case ZigTypeIdEnumLiteral: @@ -26138,6 +26159,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->special == ConstValSpecialStatic); assert(payload->type == ir_type_info_get_type(ira, "Frame", nullptr)); ZigValue *function = get_const_field(ira, source_instr->source_node, payload, "function", 0); + if (function == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + assert(function->type->id == ZigTypeIdFn); ZigFn *fn = function->data.x_ptr.data.fn.fn_entry; return get_fn_frame_type(ira->codegen, fn); @@ -26172,7 +26196,6 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(error->type == ir_type_info_get_type(ira, "Error", nullptr)); ErrorTableEntry *err_entry = heap::c_allocator.create(); err_entry->decl_node = source_instr->source_node; - Error err; if ((err = get_const_field_buf(ira, source_instr->source_node, error, "name", 0, &err_entry->name))) return ira->codegen->invalid_inst_gen->value->type; auto existing_entry = ira->codegen->error_table.put_unique(&err_entry->name, err_entry); @@ -26199,11 +26222,15 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->type == ir_type_info_get_type(ira, "Struct", nullptr)); ZigValue *layout_value = get_const_field(ira, source_instr->source_node, payload, "layout", 0); + if (layout_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; assert(layout_value->special == ConstValSpecialStatic); assert(layout_value->type == ir_type_info_get_type(ira, "ContainerLayout", nullptr)); ContainerLayout layout = (ContainerLayout)bigint_as_u32(&layout_value->data.x_enum_tag); ZigValue *fields_value = get_const_field(ira, source_instr->source_node, payload, "fields", 1); + if (fields_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; assert(fields_value->special == ConstValSpecialStatic); assert(is_slice(fields_value->type)); ZigValue *fields_ptr = fields_value->data.x_struct.fields[slice_ptr_index]; @@ -26211,6 +26238,8 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI size_t fields_len = bigint_as_usize(&fields_len_value->data.x_bigint); ZigValue *decls_value = get_const_field(ira, source_instr->source_node, payload, "decls", 2); + if (decls_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; assert(decls_value->special == ConstValSpecialStatic); assert(is_slice(decls_value->type)); ZigValue *decls_len_value = decls_value->data.x_struct.fields[slice_len_index]; @@ -26221,7 +26250,8 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI } bool is_tuple; - get_const_field_bool(ira, source_instr->source_node, payload, "is_tuple", 3, &is_tuple); + if ((err = get_const_field_bool(ira, source_instr->source_node, payload, "is_tuple", 3, &is_tuple))) + return ira->codegen->invalid_inst_gen->value->type; ZigType *entry = new_type_table_entry(ZigTypeIdStruct); buf_init_from_buf(&entry->name, @@ -26249,6 +26279,8 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI return ira->codegen->invalid_inst_gen->value->type; field->decl_node = source_instr->source_node; ZigValue *type_value = get_const_field(ira, source_instr->source_node, field_value, "field_type", 1); + if (type_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; field->type_val = type_value; field->type_entry = type_value->data.x_type; if (entry->data.structure.fields_by_name.put_unique(field->name, field) != nullptr) { @@ -26256,6 +26288,8 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI return ira->codegen->invalid_inst_gen->value->type; } ZigValue *default_value = get_const_field(ira, source_instr->source_node, field_value, "default_value", 2); + if (default_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; if (default_value->type->id == ZigTypeIdNull) { field->init_val = nullptr; } else if (default_value->type->id == ZigTypeIdOptional && default_value->type->data.maybe.child_type == field->type_entry) { @@ -26278,6 +26312,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->type == ir_type_info_get_type(ira, "Enum", nullptr)); ZigValue *layout_value = get_const_field(ira, source_instr->source_node, payload, "layout", 0); + if (layout_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + assert(layout_value->special == ConstValSpecialStatic); assert(layout_value->type == ir_type_info_get_type(ira, "ContainerLayout", nullptr)); ContainerLayout layout = (ContainerLayout)bigint_as_u32(&layout_value->data.x_enum_tag); @@ -26285,6 +26322,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI ZigType *tag_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "tag_type", 1); ZigValue *fields_value = get_const_field(ira, source_instr->source_node, payload, "fields", 2); + if (fields_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + assert(fields_value->special == ConstValSpecialStatic); assert(is_slice(fields_value->type)); ZigValue *fields_ptr = fields_value->data.x_struct.fields[slice_ptr_index]; @@ -26292,6 +26332,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI size_t fields_len = bigint_as_usize(&fields_len_value->data.x_bigint); ZigValue *decls_value = get_const_field(ira, source_instr->source_node, payload, "decls", 3); + if (decls_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + assert(decls_value->special == ConstValSpecialStatic); assert(is_slice(decls_value->type)); ZigValue *decls_len_value = decls_value->data.x_struct.fields[slice_len_index]; @@ -26337,7 +26380,10 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI ir_add_error(ira, source_instr, buf_sprintf("duplicate enum field '%s'", buf_ptr(field->name))); return ira->codegen->invalid_inst_gen->value->type; } - field->value = *get_const_field_lit_int(ira, source_instr->source_node, field_value, "value", 1); + BigInt *field_int_value = get_const_field_lit_int(ira, source_instr->source_node, field_value, "value", 1); + if (field_int_value == nullptr) + return ira->codegen->invalid_inst_gen->value->type; + field->value = *field_int_value; } return entry; diff --git a/test/compile_errors.zig b/test/compile_errors.zig index f6a1fa5105..f5ebc02691 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,25 @@ const tests = @import("tests.zig"); const std = @import("std"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.add("@Type with undefined", + \\comptime { + \\ _ = @Type(.{ .Array = .{ .len = 0, .child = u8, .sentinel = undefined } }); + \\} + \\comptime { + \\ _ = @Type(.{ + \\ .Struct = .{ + \\ .fields = undefined, + \\ .decls = undefined, + \\ .is_tuple = false, + \\ .layout = .Auto, + \\ }, + \\ }); + \\} + , &[_][]const u8{ + "tmp.zig:2:16: error: use of undefined value here causes undefined behavior", + "tmp.zig:5:16: error: use of undefined value here causes undefined behavior", + }); + cases.add("struct with declarations unavailable for @Type", \\export fn entry() void { \\ _ = @Type(@typeInfo(struct { const foo = 1; })); From c1ee9efb7c2a1589b14d6efeffb1f5e6c2d9b994 Mon Sep 17 00:00:00 2001 From: Vexu Date: Mon, 24 Aug 2020 15:24:00 +0300 Subject: [PATCH 40/55] fix error note using invalid source node Closes #6153 --- src/ir.cpp | 9 +++++++-- test/compile_errors.zig | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/ir.cpp b/src/ir.cpp index a2056a4c9b..c8b6c432ee 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -20695,8 +20695,13 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr, if ((return_type->id == ZigTypeIdErrorUnion || return_type->id == ZigTypeIdErrorSet) && expected_return_type->id != ZigTypeIdErrorUnion && expected_return_type->id != ZigTypeIdErrorSet) { - add_error_note(ira->codegen, ira->new_irb.exec->first_err_trace_msg, - ira->explicit_return_type_source_node, buf_create_from_str("function cannot return an error")); + if (call_result_loc->id == ResultLocIdReturn) { + add_error_note(ira->codegen, ira->new_irb.exec->first_err_trace_msg, + ira->explicit_return_type_source_node, buf_sprintf("function cannot return an error")); + } else { + add_error_note(ira->codegen, ira->new_irb.exec->first_err_trace_msg, result_loc->base.source_node, + buf_sprintf("cannot store an error in type '%s'", buf_ptr(&expected_return_type->name))); + } } return ira->codegen->invalid_inst_gen; } diff --git a/test/compile_errors.zig b/test/compile_errors.zig index f5ebc02691..fe11763ea1 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -158,16 +158,22 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { \\export fn baz() void { \\ try bar(); \\} - \\export fn quux() u32 { + \\export fn qux() u32 { \\ return bar(); \\} + \\export fn quux() u32 { + \\ var buf: u32 = 0; + \\ buf = bar(); + \\} , &[_][]const u8{ "tmp.zig:2:17: error: expected type 'u32', found 'error{Ohno}'", "tmp.zig:1:17: note: function cannot return an error", "tmp.zig:8:5: error: expected type 'void', found '@TypeOf(bar).ReturnType.ErrorSet'", "tmp.zig:7:17: note: function cannot return an error", "tmp.zig:11:15: error: expected type 'u32', found '@TypeOf(bar).ReturnType.ErrorSet!u32'", - "tmp.zig:10:18: note: function cannot return an error", + "tmp.zig:10:17: note: function cannot return an error", + "tmp.zig:15:14: error: expected type 'u32', found '@TypeOf(bar).ReturnType.ErrorSet!u32'", + "tmp.zig:14:5: note: cannot store an error in type 'u32'", }); cases.addTest("int/float conversion to comptime_int/float", From 2516db9645f3e8103ea6bff0b59d3a39fcce97a9 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 21 Aug 2020 08:04:02 +0200 Subject: [PATCH 41/55] Specify path to dyld in Mach-O This is required since an exec on macOS always has to link against libSystem.dylib. Signed-off-by: Jakub Konka --- lib/std/macho.zig | 24 ++- src-self-hosted/codegen.zig | 57 +++++- src-self-hosted/link/MachO.zig | 309 ++++++++++++++++++++++++++++----- 3 files changed, 342 insertions(+), 48 deletions(-) diff --git a/lib/std/macho.zig b/lib/std/macho.zig index 7eb22c7179..935802a45f 100644 --- a/lib/std/macho.zig +++ b/lib/std/macho.zig @@ -83,7 +83,7 @@ pub const symtab_command = extern struct { /// The linkedit_data_command contains the offsets and sizes of a blob /// of data in the __LINKEDIT segment. -const linkedit_data_command = extern struct { +pub const linkedit_data_command = extern struct { /// LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, LC_FUNCTION_STARTS, LC_DATA_IN_CODE, LC_DYLIB_CODE_SIGN_DRS or LC_LINKER_OPTIMIZATION_HINT. cmd: u32, @@ -97,6 +97,28 @@ const linkedit_data_command = extern struct { datasize: u32, }; +/// A program that uses a dynamic linker contains a dylinker_command to identify +/// the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker +/// contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER). +/// A file can have at most one of these. +/// This struct is also used for the LC_DYLD_ENVIRONMENT load command and contains +/// string for dyld to treat like an environment variable. +pub const dylinker_command = extern struct { + /// LC_ID_DYLINKER, LC_LOAD_DYLINKER, or LC_DYLD_ENVIRONMENT + cmd: u32, + + /// includes pathname string + cmdsize: u32, + + /// A variable length string in a load command is represented by an lc_str + /// union. The strings are stored just after the load command structure and + /// the offset is from the start of the load command structure. The size + /// of the string is reflected in the cmdsize field of the load command. + /// Once again any padded bytes to bring the cmdsize field to a multiple + /// of 4 bytes must be zero. + name: u32, +}; + /// The segment load command indicates that a part of this file is to be /// mapped into the task's address space. The size of this segment in memory, /// vmsize, maybe equal to or larger than the amount to map from this file, diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index e0caaba38f..4481adf021 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1427,7 +1427,62 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { else => return self.fail(inst.base.src, "TODO implement call for {}", .{self.target.cpu.arch}), } } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { - return self.fail(inst.base.src, "TODO implement codegen for call when linking with MachO", .{}); + switch (arch) { + // .x86_64 => { + // for (info.args) |mc_arg, arg_i| { + // const arg = inst.args[arg_i]; + // const arg_mcv = try self.resolveInst(inst.args[arg_i]); + // // Here we do not use setRegOrMem even though the logic is similar, because + // // the function call will move the stack pointer, so the offsets are different. + // switch (mc_arg) { + // .none => continue, + // .register => |reg| { + // try self.genSetReg(arg.src, reg, arg_mcv); + // // TODO interact with the register allocator to mark the instruction as moved. + // }, + // .stack_offset => { + // // Here we need to emit instructions like this: + // // mov qword ptr [rsp + stack_offset], x + // return self.fail(inst.base.src, "TODO implement calling with parameters in memory", .{}); + // }, + // .ptr_stack_offset => { + // return self.fail(inst.base.src, "TODO implement calling with MCValue.ptr_stack_offset arg", .{}); + // }, + // .ptr_embedded_in_code => { + // return self.fail(inst.base.src, "TODO implement calling with MCValue.ptr_embedded_in_code arg", .{}); + // }, + // .undef => unreachable, + // .immediate => unreachable, + // .unreach => unreachable, + // .dead => unreachable, + // .embedded_in_code => unreachable, + // .memory => unreachable, + // .compare_flags_signed => unreachable, + // .compare_flags_unsigned => unreachable, + // } + // } + + // if (inst.func.cast(ir.Inst.Constant)) |func_inst| { + // if (func_inst.val.cast(Value.Payload.Function)) |func_val| { + // const func = func_val.func; + // const got = &macho_file.segment_cmds.items[macho_file.seg_got_index.?]; + // const ptr_bytes: u64 = 8; + // const got_addr = @intCast(u32, got.vmaddrs + func.owner_decl.link.macho.offset_table_index * ptr_bytes); + // // 01 xx xx xx xx call [addr] + // try self.code.ensureCapacity(self.code.items.len + 5); + // self.code.appendSliceAssumeCapacity(&[1]u8{ 0x1 }); + // mem.writeIntLittle(u32, self.code.addManyAsArrayAssumeCapacity(4), got_addr); + // } else { + // return self.fail(inst.base.src, "TODO implement calling bitcasted functions", .{}); + // } + // } else { + // return self.fail(inst.base.src, "TODO implement calling runtime known function pointer", .{}); + // } + // }, + .x86_64 => return self.fail(inst.base.src, "TODO implement codegen for call when linking with MachO for x86_64 arch", .{}), + .aarch64 => return self.fail(inst.base.src, "TODO implement codegen for call when linking with MachO for aarch64 arch", .{}), + else => unreachable, + } } else { unreachable; } diff --git a/src-self-hosted/link/MachO.zig b/src-self-hosted/link/MachO.zig index 4bcea9cfa8..e2e93624f1 100644 --- a/src-self-hosted/link/MachO.zig +++ b/src-self-hosted/link/MachO.zig @@ -6,8 +6,11 @@ const assert = std.debug.assert; const fs = std.fs; const log = std.log.scoped(.link); const macho = std.macho; +const codegen = @import("../codegen.zig"); const math = std.math; const mem = std.mem; +const trace = @import("../tracy.zig").trace; +const Type = @import("../type.zig").Type; const Module = @import("../Module.zig"); const link = @import("../link.zig"); @@ -17,18 +20,35 @@ pub const base_tag: File.Tag = File.Tag.macho; base: File, -/// Stored in native-endian format, depending on target endianness needs to be bswapped on read/write. -/// Same order as in the file. -segment_cmds: std.ArrayListUnmanaged(macho.segment_command_64) = std.ArrayListUnmanaged(macho.segment_command_64){}, +/// List of all load command headers that are in the file. +/// We use it to track number and size of all commands needed by the header. +commands: std.ArrayListUnmanaged(macho.load_command) = std.ArrayListUnmanaged(macho.load_command){}, +command_file_offset: ?u64 = null, /// Stored in native-endian format, depending on target endianness needs to be bswapped on read/write. /// Same order as in the file. +segments: std.ArrayListUnmanaged(macho.segment_command_64) = std.ArrayListUnmanaged(macho.segment_command_64){}, sections: std.ArrayListUnmanaged(macho.section_64) = std.ArrayListUnmanaged(macho.section_64){}, +segment_table_offset: ?u64 = null, +/// Entry point load command +entry_point_cmd: ?macho.entry_point_command = null, entry_addr: ?u64 = null, +/// Default VM start address set at 4GB +vm_start_address: u64 = 0x100000000, + +seg_table_dirty: bool = false, + error_flags: File.ErrorFlags = File.ErrorFlags{}, +/// `alloc_num / alloc_den` is the factor of padding when allocating. +const alloc_num = 4; +const alloc_den = 3; + +/// Default path to dyld +const DEFAULT_DYLD_PATH: [*:0]const u8 = "/usr/lib/dyld"; + pub const TextBlock = struct { pub const empty = TextBlock{}; }; @@ -80,12 +100,6 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !MachO /// Truncates the existing file contents and overwrites the contents. /// Returns an error if `file` is not already open with +read +write +seek abilities. fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !MachO { - switch (options.output_mode) { - .Exe => {}, - .Obj => {}, - .Lib => return error.TODOImplementWritingLibFiles, - } - var self: MachO = .{ .base = .{ .file = file, @@ -96,31 +110,35 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Mach }; errdefer self.deinit(); - if (options.output_mode == .Exe) { - // The first segment command for executables is always a __PAGEZERO segment. - try self.segment_cmds.append(allocator, .{ - .cmd = macho.LC_SEGMENT_64, - .cmdsize = @sizeOf(macho.segment_command_64), - .segname = self.makeString("__PAGEZERO"), - .vmaddr = 0, - .vmsize = 0, - .fileoff = 0, - .filesize = 0, - .maxprot = 0, - .initprot = 0, - .nsects = 0, - .flags = 0, - }); + switch (options.output_mode) { + .Exe => { + // The first segment command for executables is always a __PAGEZERO segment. + const pagezero = .{ + .cmd = macho.LC_SEGMENT_64, + .cmdsize = commandSize(@sizeOf(macho.segment_command_64)), + .segname = makeString("__PAGEZERO"), + .vmaddr = 0, + .vmsize = self.vm_start_address, + .fileoff = 0, + .filesize = 0, + .maxprot = 0, + .initprot = 0, + .nsects = 0, + .flags = 0, + }; + try self.commands.append(allocator, .{ + .cmd = pagezero.cmd, + .cmdsize = pagezero.cmdsize, + }); + try self.segments.append(allocator, pagezero); + }, + .Obj => return error.TODOImplementWritingObjFiles, + .Lib => return error.TODOImplementWritingLibFiles, } - return self; -} + try self.populateMissingMetadata(); -fn makeString(self: *MachO, comptime bytes: []const u8) [16]u8 { - var buf: [16]u8 = undefined; - if (bytes.len > buf.len) @compileError("MachO segment/section name too long"); - mem.copy(u8, buf[0..], bytes); - return buf; + return self; } fn writeMachOHeader(self: *MachO) !void { @@ -156,10 +174,14 @@ fn writeMachOHeader(self: *MachO) !void { }; hdr.filetype = filetype; - // TODO consider other commands - const ncmds = try math.cast(u32, self.segment_cmds.items.len); + const ncmds = try math.cast(u32, self.commands.items.len); hdr.ncmds = ncmds; - hdr.sizeofcmds = ncmds * @sizeOf(macho.segment_command_64); + + var sizeof_cmds: u32 = 0; + for (self.commands.items) |cmd| { + sizeof_cmds += cmd.cmdsize; + } + hdr.sizeofcmds = sizeof_cmds; // TODO should these be set to something else? hdr.flags = 0; @@ -169,36 +191,117 @@ fn writeMachOHeader(self: *MachO) !void { } pub fn flush(self: *MachO, module: *Module) !void { - // TODO implement flush + // Save segments first { - const buf = try self.base.allocator.alloc(macho.segment_command_64, self.segment_cmds.items.len); + const buf = try self.base.allocator.alloc(macho.segment_command_64, self.segments.items.len); defer self.base.allocator.free(buf); + self.command_file_offset = @sizeOf(macho.mach_header_64); + for (buf) |*seg, i| { - seg.* = self.segment_cmds.items[i]; + seg.* = self.segments.items[i]; + self.command_file_offset.? += self.segments.items[i].cmdsize; } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), @sizeOf(macho.mach_header_64)); } - if (self.entry_addr == null and self.base.options.output_mode == .Exe) { - log.debug("flushing. no_entry_point_found = true\n", .{}); - self.error_flags.no_entry_point_found = true; - } else { - log.debug("flushing. no_entry_point_found = false\n", .{}); - self.error_flags.no_entry_point_found = false; - try self.writeMachOHeader(); + switch (self.base.options.output_mode) { + .Exe => { + { + // We need to add LC_LOAD_DYLINKER and LC_LOAD_DYLIB since we always + // have to link against libSystem.dylib + const cmdsize = commandSize(@intCast(u32, @sizeOf(macho.dylinker_command) + mem.lenZ(DEFAULT_DYLD_PATH))); + const load_dylinker = [1]macho.dylinker_command{ + .{ + .cmd = macho.LC_LOAD_DYLINKER, + .cmdsize = cmdsize, + .name = @sizeOf(macho.dylinker_command), + }, + }; + try self.commands.append(self.base.allocator, .{ + .cmd = macho.LC_LOAD_DYLINKER, + .cmdsize = cmdsize, + }); + + try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylinker[0..1]), self.command_file_offset.?); + + const padded_path = try self.base.allocator.alloc(u8, cmdsize - @sizeOf(macho.dylinker_command)); + defer self.base.allocator.free(padded_path); + mem.set(u8, padded_path[0..], 0); + mem.copy(u8, padded_path[0..], mem.spanZ(DEFAULT_DYLD_PATH)); + + try self.base.file.?.pwriteAll(padded_path, self.command_file_offset.? + @sizeOf(macho.dylinker_command)); + self.command_file_offset.? += cmdsize; + } + }, + .Obj => return error.TODOImplementWritingObjFiles, + .Lib => return error.TODOImplementWritingLibFiles, } + + // if (self.entry_addr == null and self.base.options.output_mode == .Exe) { + // log.debug("flushing. no_entry_point_found = true\n", .{}); + // self.error_flags.no_entry_point_found = true; + // } else { + log.debug("flushing. no_entry_point_found = false\n", .{}); + self.error_flags.no_entry_point_found = false; + try self.writeMachOHeader(); + // } } pub fn deinit(self: *MachO) void { - self.segment_cmds.deinit(self.base.allocator); + self.commands.deinit(self.base.allocator); + self.segments.deinit(self.base.allocator); self.sections.deinit(self.base.allocator); } pub fn allocateDeclIndexes(self: *MachO, decl: *Module.Decl) !void {} -pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void {} +pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void { + // const tracy = trace(@src()); + // defer tracy.end(); + + // var code_buffer = std.ArrayList(u8).init(self.base.allocator); + // defer code_buffer.deinit(); + + // var dbg_line_buffer = std.ArrayList(u8).init(self.base.allocator); + // defer dbg_line_buffer.deinit(); + + // var dbg_info_buffer = std.ArrayList(u8).init(self.base.allocator); + // defer dbg_info_buffer.deinit(); + + // var dbg_info_type_relocs: File.DbgInfoTypeRelocsTable = .{}; + // defer { + // for (dbg_info_type_relocs.items()) |*entry| { + // entry.value.relocs.deinit(self.base.allocator); + // } + // dbg_info_type_relocs.deinit(self.base.allocator); + // } + + // const typed_value = decl.typed_value.most_recent.typed_value; + // log.debug("typed_value = {}", .{typed_value}); + + // const res = try codegen.generateSymbol( + // &self.base, + // decl.src(), + // typed_value, + // &code_buffer, + // &dbg_line_buffer, + // &dbg_info_buffer, + // &dbg_info_type_relocs, + // ); + // log.debug("res = {}", .{res}); + + // const code = switch (res) { + // .externally_managed => |x| x, + // .appended => code_buffer.items, + // .fail => |em| { + // decl.analysis = .codegen_failure; + // try module.failed_decls.put(module.gpa, decl, em); + // return; + // }, + // }; +} pub fn updateDeclLineNumber(self: *MachO, module: *Module, decl: *const Module.Decl) !void {} @@ -214,3 +317,117 @@ pub fn freeDecl(self: *MachO, decl: *Module.Decl) void {} pub fn getDeclVAddr(self: *MachO, decl: *const Module.Decl) u64 { @panic("TODO implement getDeclVAddr for MachO"); } + +pub fn populateMissingMetadata(self: *MachO) !void { + // if (self.seg_load_re_index == null) { + // self.seg_load_re_index = @intCast(u16, self.segment_cmds.items.len); + // const file_size = self.base.options.program_code_size_hint; + // const p_align = 0x1000; + // const off = self.findFreeSpace(file_size, p_align); + // log.debug("found LC_SEGMENT_64 free space 0x{x} to 0x{x}", .{ off, off + file_size }); + // try self.segment_cmds.append(self.base.allocator, .{}); + // self.entry_addr = null; + // self.seg_table_dirty = true; + // } + // if (self.seg_got_index == null) { + // self.seg_got_index = @intCast(u16, self.segment_cmds.items.len); + // const file_size = 8 * self.base.options.symbol_count_hint; + // // Apple recommends to page align for better performance. + // // TODO This is not necessarily true for MH_OBJECT which means we + // // could potentially shave off a couple of bytes when generating + // // only object files. + // const p_align = 0x1000; + // const off = self.findFreeSpace(file_size, p_align); + // log.debug("found LC_SEGMENT_64 free space 0x{x} to 0x{x}", .{ off, off + file_size }); + // const default_vmaddr = 0x4000000; + // try self.segment_cmds.append(self.base.allocator, .{ + // .cmd = macho.LC_SEGMENT_64, + // .cmdsize = @sizeOf(macho.segment_command_64), + // .segname = self.makeString("__TEXT"), + // .vmaddr = default_vmaddr, + // .vmsize = file_size, + // .fileoff = off, + // .filesize = file_size, + // .maxprot = 0x5, + // .initprot = 0x5, + // .nsects = 0, + // .flags = 0, + // }); + // self.seg_table_dirty = true; + // } +} + +/// Returns end pos of collision, if any. +fn detectAllocCollision(self: *MachO, start: u64, size: u64) ?u64 { + const header_size: u64 = @sizeOf(macho.mach_header_64); + if (start < header_size) + return header_size; + + const end = start + satMul(size, alloc_num) / alloc_den; + + // if (self.sec_table_offset) |off| { + // const section_size: u64 = @sizeOf(macho.section_64); + // const tight_size = self.sections.items.len * section_size; + // const increased_size = satMul(tight_size, alloc_num) / alloc_den; + // const test_end = off + increased_size; + // if (end > off and start < test_end) { + // return test_end; + // } + // } + + // if (self.seg_table_offset) |off| { + // const segment_size: u64 = @sizeOf(macho.segment_command_64); + // const tight_size = self.segment_cmds.items.len * segment_size; + // const increased_size = satMul(tight_size, alloc_num) / alloc_den; + // const test_end = off + increased_size; + // if (end > off and start < test_end) { + // return test_end; + // } + // } + + // for (self.sections.items) |section| { + // const increased_size = satMul(section.size, alloc_num) / alloc_den; + // const test_end = section.offset + increased_size; + // if (end > section.offset and start < test_end) { + // return test_end; + // } + // } + + for (self.segments.items) |segment| { + const increased_size = satMul(segment.filesize, alloc_num) / alloc_den; + const test_end = segment_cmd.fileoff + increased_size; + if (end > segment_cmd.fileoff and start < test_end) { + return test_end; + } + } + + return null; +} + +fn findFreeSpace(self: *MachO, object_size: u64, min_alignment: u16) u64 { + var start: u64 = 0; + while (self.detectAllocCollision(start, object_size)) |item_end| { + start = mem.alignForwardGeneric(u64, item_end, min_alignment); + } + return start; +} + +/// Saturating multiplication +fn satMul(a: anytype, b: anytype) @TypeOf(a, b) { + const T = @TypeOf(a, b); + return std.math.mul(T, a, b) catch std.math.maxInt(T); +} + +fn makeString(comptime bytes: []const u8) [16]u8 { + var buf: [16]u8 = undefined; + if (bytes.len > buf.len) @compileError("MachO segment/section name too long"); + mem.copy(u8, buf[0..], bytes); + return buf; +} + +fn commandSize(min_size: u32) u32 { + if (min_size % @sizeOf(u64) == 0) return min_size; + + const div = min_size / @sizeOf(u64); + return (div + 1) * @sizeOf(u64); +} From 1698e6d7a7af7fa2b92f11c1c58581f297bc44cb Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Mon, 24 Aug 2020 09:41:14 +0200 Subject: [PATCH 42/55] Link against libSystem when generating Mach-O exe This is required when generating an exe on macOS. Signed-off-by: Jakub Konka --- lib/std/c/darwin.zig | 1 + lib/std/macho.zig | 32 ++++++++++++++++++++ src-self-hosted/link/MachO.zig | 54 ++++++++++++++++++++++++++++++---- 3 files changed, 82 insertions(+), 5 deletions(-) diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 08a34075b0..ed1ddb7d91 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -11,6 +11,7 @@ const macho = std.macho; usingnamespace @import("../os/bits.zig"); extern "c" fn __error() *c_int; +pub extern "c" fn NSVersionOfRunTimeLibrary(library_name: [*:0]const u8) u32; pub extern "c" fn _NSGetExecutablePath(buf: [*]u8, bufsize: *u32) c_int; pub extern "c" fn _dyld_image_count() u32; pub extern "c" fn _dyld_get_image_header(image_index: u32) ?*mach_header; diff --git a/lib/std/macho.zig b/lib/std/macho.zig index 935802a45f..be323a722e 100644 --- a/lib/std/macho.zig +++ b/lib/std/macho.zig @@ -119,6 +119,38 @@ pub const dylinker_command = extern struct { name: u32, }; +pub const dylib_command = extern struct { + /// LC_ID_DYLIB, LC_LOAD_WEAK_DYLIB, LC_LOAD_DYLIB, LC_REEXPORT_DYLIB + cmd: u32, + + /// includes pathname string + cmdsize: u32, + + /// the library identification + dylib: dylib, +}; + +/// Dynamicaly linked shared libraries are identified by two things. The +/// pathname (the name of the library as found for execution), and the +/// compatibility version number. The pathname must match and the compatibility +/// number in the user of the library must be greater than or equal to the +/// library being used. The time stamp is used to record the time a library was +/// built and copied into user so it can be use to determined if the library used +/// at runtime is exactly the same as used to built the program. +pub const dylib = extern struct { + /// library's pathname (offset pointing at the end of dylib_command) + name: u32, + + /// library's build timestamp + timestamp: u32, + + /// library's current version number + current_version: u32, + + /// library's compatibility version number + compatibility_version: u32, +}; + /// The segment load command indicates that a part of this file is to be /// mapped into the task's address space. The size of this segment in memory, /// vmsize, maybe equal to or larger than the amount to map from this file, diff --git a/src-self-hosted/link/MachO.zig b/src-self-hosted/link/MachO.zig index e2e93624f1..39c959e70b 100644 --- a/src-self-hosted/link/MachO.zig +++ b/src-self-hosted/link/MachO.zig @@ -49,6 +49,10 @@ const alloc_den = 3; /// Default path to dyld const DEFAULT_DYLD_PATH: [*:0]const u8 = "/usr/lib/dyld"; +/// We always have to link against libSystem since macOS Catalina (TODO link) +const LIB_SYSTEM_NAME: [*:0]const u8 = "System"; +const LIB_SYSTEM_PATH: [*:0]const u8 = "/usr/lib/libSystem.B.dylib"; + pub const TextBlock = struct { pub const empty = TextBlock{}; }; @@ -226,12 +230,41 @@ pub fn flush(self: *MachO, module: *Module) !void { try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylinker[0..1]), self.command_file_offset.?); - const padded_path = try self.base.allocator.alloc(u8, cmdsize - @sizeOf(macho.dylinker_command)); - defer self.base.allocator.free(padded_path); - mem.set(u8, padded_path[0..], 0); - mem.copy(u8, padded_path[0..], mem.spanZ(DEFAULT_DYLD_PATH)); + const file_offset = self.command_file_offset.? + @sizeOf(macho.dylinker_command); + try self.addPadding(cmdsize - @sizeOf(macho.dylinker_command), file_offset); - try self.base.file.?.pwriteAll(padded_path, self.command_file_offset.? + @sizeOf(macho.dylinker_command)); + try self.base.file.?.pwriteAll(mem.spanZ(DEFAULT_DYLD_PATH), file_offset); + self.command_file_offset.? += cmdsize; + } + + { + // Link against libSystem + const cmdsize = commandSize(@intCast(u32, @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH))); + const version = std.c.NSVersionOfRunTimeLibrary(LIB_SYSTEM_NAME); + const dylib = .{ + .name = @sizeOf(macho.dylib_command), + .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files + .current_version = version, + .compatibility_version = 0x10000, // not sure why this either; value from reverse engineering + }; + const load_dylib = [1]macho.dylib_command{ + .{ + .cmd = macho.LC_LOAD_DYLIB, + .cmdsize = cmdsize, + .dylib = dylib, + }, + }; + try self.commands.append(self.base.allocator, .{ + .cmd = macho.LC_LOAD_DYLIB, + .cmdsize = cmdsize, + }); + + try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylib[0..1]), self.command_file_offset.?); + + const file_offset = self.command_file_offset.? + @sizeOf(macho.dylib_command); + try self.addPadding(cmdsize - @sizeOf(macho.dylib_command), file_offset); + + try self.base.file.?.pwriteAll(mem.spanZ(LIB_SYSTEM_PATH), file_offset); self.command_file_offset.? += cmdsize; } }, @@ -431,3 +464,14 @@ fn commandSize(min_size: u32) u32 { const div = min_size / @sizeOf(u64); return (div + 1) * @sizeOf(u64); } + +fn addPadding(self: *MachO, size: u32, file_offset: u64) !void { + if (size == 0) return; + + const buf = try self.base.allocator.alloc(u8, size); + defer self.base.allocator.free(buf); + + mem.set(u8, buf[0..], 0); + + try self.base.file.?.pwriteAll(buf, file_offset); +} From 9745e7b5126a5429da0be67899d89803e769498c Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Mon, 24 Aug 2020 09:48:00 +0200 Subject: [PATCH 43/55] Clean up draft for merging into upstream Signed-off-by: Jakub Konka --- lib/std/macho.zig | 5 + src-self-hosted/codegen.zig | 51 ------ src-self-hosted/link/MachO.zig | 280 ++++++++++----------------------- 3 files changed, 84 insertions(+), 252 deletions(-) diff --git a/lib/std/macho.zig b/lib/std/macho.zig index be323a722e..4057d3dc99 100644 --- a/lib/std/macho.zig +++ b/lib/std/macho.zig @@ -119,6 +119,11 @@ pub const dylinker_command = extern struct { name: u32, }; +/// A dynamically linked shared library (filetype == MH_DYLIB in the mach header) +/// contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library. +/// An object that uses a dynamically linked shared library also contains a +/// dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or +/// LC_REEXPORT_DYLIB) for each library it uses. pub const dylib_command = extern struct { /// LC_ID_DYLIB, LC_LOAD_WEAK_DYLIB, LC_LOAD_DYLIB, LC_REEXPORT_DYLIB cmd: u32, diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig index 4481adf021..cb12211206 100644 --- a/src-self-hosted/codegen.zig +++ b/src-self-hosted/codegen.zig @@ -1428,57 +1428,6 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { } } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { switch (arch) { - // .x86_64 => { - // for (info.args) |mc_arg, arg_i| { - // const arg = inst.args[arg_i]; - // const arg_mcv = try self.resolveInst(inst.args[arg_i]); - // // Here we do not use setRegOrMem even though the logic is similar, because - // // the function call will move the stack pointer, so the offsets are different. - // switch (mc_arg) { - // .none => continue, - // .register => |reg| { - // try self.genSetReg(arg.src, reg, arg_mcv); - // // TODO interact with the register allocator to mark the instruction as moved. - // }, - // .stack_offset => { - // // Here we need to emit instructions like this: - // // mov qword ptr [rsp + stack_offset], x - // return self.fail(inst.base.src, "TODO implement calling with parameters in memory", .{}); - // }, - // .ptr_stack_offset => { - // return self.fail(inst.base.src, "TODO implement calling with MCValue.ptr_stack_offset arg", .{}); - // }, - // .ptr_embedded_in_code => { - // return self.fail(inst.base.src, "TODO implement calling with MCValue.ptr_embedded_in_code arg", .{}); - // }, - // .undef => unreachable, - // .immediate => unreachable, - // .unreach => unreachable, - // .dead => unreachable, - // .embedded_in_code => unreachable, - // .memory => unreachable, - // .compare_flags_signed => unreachable, - // .compare_flags_unsigned => unreachable, - // } - // } - - // if (inst.func.cast(ir.Inst.Constant)) |func_inst| { - // if (func_inst.val.cast(Value.Payload.Function)) |func_val| { - // const func = func_val.func; - // const got = &macho_file.segment_cmds.items[macho_file.seg_got_index.?]; - // const ptr_bytes: u64 = 8; - // const got_addr = @intCast(u32, got.vmaddrs + func.owner_decl.link.macho.offset_table_index * ptr_bytes); - // // 01 xx xx xx xx call [addr] - // try self.code.ensureCapacity(self.code.items.len + 5); - // self.code.appendSliceAssumeCapacity(&[1]u8{ 0x1 }); - // mem.writeIntLittle(u32, self.code.addManyAsArrayAssumeCapacity(4), got_addr); - // } else { - // return self.fail(inst.base.src, "TODO implement calling bitcasted functions", .{}); - // } - // } else { - // return self.fail(inst.base.src, "TODO implement calling runtime known function pointer", .{}); - // } - // }, .x86_64 => return self.fail(inst.base.src, "TODO implement codegen for call when linking with MachO for x86_64 arch", .{}), .aarch64 => return self.fail(inst.base.src, "TODO implement codegen for call when linking with MachO for aarch64 arch", .{}), else => unreachable, diff --git a/src-self-hosted/link/MachO.zig b/src-self-hosted/link/MachO.zig index 39c959e70b..a65366261a 100644 --- a/src-self-hosted/link/MachO.zig +++ b/src-self-hosted/link/MachO.zig @@ -16,6 +16,8 @@ const Module = @import("../Module.zig"); const link = @import("../link.zig"); const File = link.File; +const is_darwin = std.Target.current.os.tag.isDarwin(); + pub const base_tag: File.Tag = File.Tag.macho; base: File, @@ -42,16 +44,27 @@ seg_table_dirty: bool = false, error_flags: File.ErrorFlags = File.ErrorFlags{}, +/// TODO ultimately this will be propagated down from main() and set (in this form or another) +/// when user links against system lib. +link_against_system: bool = false, + /// `alloc_num / alloc_den` is the factor of padding when allocating. const alloc_num = 4; const alloc_den = 3; /// Default path to dyld +/// TODO instead of hardcoding it, we should probably look through some env vars and search paths +/// instead but this will do for now. const DEFAULT_DYLD_PATH: [*:0]const u8 = "/usr/lib/dyld"; -/// We always have to link against libSystem since macOS Catalina (TODO link) +/// Default lib search path +/// TODO instead of hardcoding it, we should probably look through some env vars and search paths +/// instead but this will do for now. +const DEFAULT_LIB_SEARCH_PATH: []const u8 = "/usr/lib"; + const LIB_SYSTEM_NAME: [*:0]const u8 = "System"; -const LIB_SYSTEM_PATH: [*:0]const u8 = "/usr/lib/libSystem.B.dylib"; +/// TODO we should search for libSystem and fail if it doesn't exist, instead of hardcoding it +const LIB_SYSTEM_PATH: [*:0]const u8 = DEFAULT_LIB_SEARCH_PATH ++ "/libSystem.B.dylib"; pub const TextBlock = struct { pub const empty = TextBlock{}; @@ -212,74 +225,81 @@ pub fn flush(self: *MachO, module: *Module) !void { switch (self.base.options.output_mode) { .Exe => { - { - // We need to add LC_LOAD_DYLINKER and LC_LOAD_DYLIB since we always - // have to link against libSystem.dylib - const cmdsize = commandSize(@intCast(u32, @sizeOf(macho.dylinker_command) + mem.lenZ(DEFAULT_DYLD_PATH))); - const load_dylinker = [1]macho.dylinker_command{ - .{ - .cmd = macho.LC_LOAD_DYLINKER, - .cmdsize = cmdsize, - .name = @sizeOf(macho.dylinker_command), - }, - }; - try self.commands.append(self.base.allocator, .{ - .cmd = macho.LC_LOAD_DYLINKER, - .cmdsize = cmdsize, - }); + if (self.link_against_system) { + if (is_darwin) { + { + // Specify path to dynamic linker dyld + const cmdsize = commandSize(@intCast(u32, @sizeOf(macho.dylinker_command) + mem.lenZ(DEFAULT_DYLD_PATH))); + const load_dylinker = [1]macho.dylinker_command{ + .{ + .cmd = macho.LC_LOAD_DYLINKER, + .cmdsize = cmdsize, + .name = @sizeOf(macho.dylinker_command), + }, + }; + try self.commands.append(self.base.allocator, .{ + .cmd = macho.LC_LOAD_DYLINKER, + .cmdsize = cmdsize, + }); - try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylinker[0..1]), self.command_file_offset.?); + try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylinker[0..1]), self.command_file_offset.?); - const file_offset = self.command_file_offset.? + @sizeOf(macho.dylinker_command); - try self.addPadding(cmdsize - @sizeOf(macho.dylinker_command), file_offset); + const file_offset = self.command_file_offset.? + @sizeOf(macho.dylinker_command); + try self.addPadding(cmdsize - @sizeOf(macho.dylinker_command), file_offset); - try self.base.file.?.pwriteAll(mem.spanZ(DEFAULT_DYLD_PATH), file_offset); - self.command_file_offset.? += cmdsize; - } + try self.base.file.?.pwriteAll(mem.spanZ(DEFAULT_DYLD_PATH), file_offset); + self.command_file_offset.? += cmdsize; + } - { - // Link against libSystem - const cmdsize = commandSize(@intCast(u32, @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH))); - const version = std.c.NSVersionOfRunTimeLibrary(LIB_SYSTEM_NAME); - const dylib = .{ - .name = @sizeOf(macho.dylib_command), - .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files - .current_version = version, - .compatibility_version = 0x10000, // not sure why this either; value from reverse engineering - }; - const load_dylib = [1]macho.dylib_command{ - .{ - .cmd = macho.LC_LOAD_DYLIB, - .cmdsize = cmdsize, - .dylib = dylib, - }, - }; - try self.commands.append(self.base.allocator, .{ - .cmd = macho.LC_LOAD_DYLIB, - .cmdsize = cmdsize, - }); + { + // Link against libSystem + const cmdsize = commandSize(@intCast(u32, @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH))); + // According to Apple's manual, we should obtain current libSystem version using libc call + // NSVersionOfRunTimeLibrary. + const version = std.c.NSVersionOfRunTimeLibrary(LIB_SYSTEM_NAME); + const dylib = .{ + .name = @sizeOf(macho.dylib_command), + .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files + .current_version = version, + .compatibility_version = 0x10000, // not sure why this either; value from reverse engineering + }; + const load_dylib = [1]macho.dylib_command{ + .{ + .cmd = macho.LC_LOAD_DYLIB, + .cmdsize = cmdsize, + .dylib = dylib, + }, + }; + try self.commands.append(self.base.allocator, .{ + .cmd = macho.LC_LOAD_DYLIB, + .cmdsize = cmdsize, + }); - try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylib[0..1]), self.command_file_offset.?); + try self.base.file.?.pwriteAll(mem.sliceAsBytes(load_dylib[0..1]), self.command_file_offset.?); - const file_offset = self.command_file_offset.? + @sizeOf(macho.dylib_command); - try self.addPadding(cmdsize - @sizeOf(macho.dylib_command), file_offset); + const file_offset = self.command_file_offset.? + @sizeOf(macho.dylib_command); + try self.addPadding(cmdsize - @sizeOf(macho.dylib_command), file_offset); - try self.base.file.?.pwriteAll(mem.spanZ(LIB_SYSTEM_PATH), file_offset); - self.command_file_offset.? += cmdsize; + try self.base.file.?.pwriteAll(mem.spanZ(LIB_SYSTEM_PATH), file_offset); + self.command_file_offset.? += cmdsize; + } + } else { + @panic("linking against libSystem on non-native target is unsupported"); + } } }, .Obj => return error.TODOImplementWritingObjFiles, .Lib => return error.TODOImplementWritingLibFiles, } - // if (self.entry_addr == null and self.base.options.output_mode == .Exe) { - // log.debug("flushing. no_entry_point_found = true\n", .{}); - // self.error_flags.no_entry_point_found = true; - // } else { - log.debug("flushing. no_entry_point_found = false\n", .{}); - self.error_flags.no_entry_point_found = false; - try self.writeMachOHeader(); - // } + if (self.entry_addr == null and self.base.options.output_mode == .Exe) { + log.debug("flushing. no_entry_point_found = true\n", .{}); + self.error_flags.no_entry_point_found = true; + } else { + log.debug("flushing. no_entry_point_found = false\n", .{}); + self.error_flags.no_entry_point_found = false; + try self.writeMachOHeader(); + } } pub fn deinit(self: *MachO) void { @@ -290,51 +310,7 @@ pub fn deinit(self: *MachO) void { pub fn allocateDeclIndexes(self: *MachO, decl: *Module.Decl) !void {} -pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void { - // const tracy = trace(@src()); - // defer tracy.end(); - - // var code_buffer = std.ArrayList(u8).init(self.base.allocator); - // defer code_buffer.deinit(); - - // var dbg_line_buffer = std.ArrayList(u8).init(self.base.allocator); - // defer dbg_line_buffer.deinit(); - - // var dbg_info_buffer = std.ArrayList(u8).init(self.base.allocator); - // defer dbg_info_buffer.deinit(); - - // var dbg_info_type_relocs: File.DbgInfoTypeRelocsTable = .{}; - // defer { - // for (dbg_info_type_relocs.items()) |*entry| { - // entry.value.relocs.deinit(self.base.allocator); - // } - // dbg_info_type_relocs.deinit(self.base.allocator); - // } - - // const typed_value = decl.typed_value.most_recent.typed_value; - // log.debug("typed_value = {}", .{typed_value}); - - // const res = try codegen.generateSymbol( - // &self.base, - // decl.src(), - // typed_value, - // &code_buffer, - // &dbg_line_buffer, - // &dbg_info_buffer, - // &dbg_info_type_relocs, - // ); - // log.debug("res = {}", .{res}); - - // const code = switch (res) { - // .externally_managed => |x| x, - // .appended => code_buffer.items, - // .fail => |em| { - // decl.analysis = .codegen_failure; - // try module.failed_decls.put(module.gpa, decl, em); - // return; - // }, - // }; -} +pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void {} pub fn updateDeclLineNumber(self: *MachO, module: *Module, decl: *const Module.Decl) !void {} @@ -351,105 +327,7 @@ pub fn getDeclVAddr(self: *MachO, decl: *const Module.Decl) u64 { @panic("TODO implement getDeclVAddr for MachO"); } -pub fn populateMissingMetadata(self: *MachO) !void { - // if (self.seg_load_re_index == null) { - // self.seg_load_re_index = @intCast(u16, self.segment_cmds.items.len); - // const file_size = self.base.options.program_code_size_hint; - // const p_align = 0x1000; - // const off = self.findFreeSpace(file_size, p_align); - // log.debug("found LC_SEGMENT_64 free space 0x{x} to 0x{x}", .{ off, off + file_size }); - // try self.segment_cmds.append(self.base.allocator, .{}); - // self.entry_addr = null; - // self.seg_table_dirty = true; - // } - // if (self.seg_got_index == null) { - // self.seg_got_index = @intCast(u16, self.segment_cmds.items.len); - // const file_size = 8 * self.base.options.symbol_count_hint; - // // Apple recommends to page align for better performance. - // // TODO This is not necessarily true for MH_OBJECT which means we - // // could potentially shave off a couple of bytes when generating - // // only object files. - // const p_align = 0x1000; - // const off = self.findFreeSpace(file_size, p_align); - // log.debug("found LC_SEGMENT_64 free space 0x{x} to 0x{x}", .{ off, off + file_size }); - // const default_vmaddr = 0x4000000; - // try self.segment_cmds.append(self.base.allocator, .{ - // .cmd = macho.LC_SEGMENT_64, - // .cmdsize = @sizeOf(macho.segment_command_64), - // .segname = self.makeString("__TEXT"), - // .vmaddr = default_vmaddr, - // .vmsize = file_size, - // .fileoff = off, - // .filesize = file_size, - // .maxprot = 0x5, - // .initprot = 0x5, - // .nsects = 0, - // .flags = 0, - // }); - // self.seg_table_dirty = true; - // } -} - -/// Returns end pos of collision, if any. -fn detectAllocCollision(self: *MachO, start: u64, size: u64) ?u64 { - const header_size: u64 = @sizeOf(macho.mach_header_64); - if (start < header_size) - return header_size; - - const end = start + satMul(size, alloc_num) / alloc_den; - - // if (self.sec_table_offset) |off| { - // const section_size: u64 = @sizeOf(macho.section_64); - // const tight_size = self.sections.items.len * section_size; - // const increased_size = satMul(tight_size, alloc_num) / alloc_den; - // const test_end = off + increased_size; - // if (end > off and start < test_end) { - // return test_end; - // } - // } - - // if (self.seg_table_offset) |off| { - // const segment_size: u64 = @sizeOf(macho.segment_command_64); - // const tight_size = self.segment_cmds.items.len * segment_size; - // const increased_size = satMul(tight_size, alloc_num) / alloc_den; - // const test_end = off + increased_size; - // if (end > off and start < test_end) { - // return test_end; - // } - // } - - // for (self.sections.items) |section| { - // const increased_size = satMul(section.size, alloc_num) / alloc_den; - // const test_end = section.offset + increased_size; - // if (end > section.offset and start < test_end) { - // return test_end; - // } - // } - - for (self.segments.items) |segment| { - const increased_size = satMul(segment.filesize, alloc_num) / alloc_den; - const test_end = segment_cmd.fileoff + increased_size; - if (end > segment_cmd.fileoff and start < test_end) { - return test_end; - } - } - - return null; -} - -fn findFreeSpace(self: *MachO, object_size: u64, min_alignment: u16) u64 { - var start: u64 = 0; - while (self.detectAllocCollision(start, object_size)) |item_end| { - start = mem.alignForwardGeneric(u64, item_end, min_alignment); - } - return start; -} - -/// Saturating multiplication -fn satMul(a: anytype, b: anytype) @TypeOf(a, b) { - const T = @TypeOf(a, b); - return std.math.mul(T, a, b) catch std.math.maxInt(T); -} +pub fn populateMissingMetadata(self: *MachO) !void {} fn makeString(comptime bytes: []const u8) [16]u8 { var buf: [16]u8 = undefined; From 140c599559b6e048db2ec8476cb2cc08366f6aa8 Mon Sep 17 00:00:00 2001 From: Rocknest <35231115+Rocknest@users.noreply.github.com> Date: Mon, 24 Aug 2020 23:47:44 +0300 Subject: [PATCH 44/55] Fix & update windows version stuff (#6157) * Update windows version constants * Add docs --- lib/std/target.zig | 15 ++++++++++----- lib/std/zig/system.zig | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/std/target.zig b/lib/std/target.zig index 0a87d442d8..deb7c85984 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -96,8 +96,12 @@ pub const Target = struct { win10_rs4 = 0x0A000005, win10_rs5 = 0x0A000006, win10_19h1 = 0x0A000007, + win10_20h1 = 0x0A000008, _, + /// Latest Windows version that the Zig Standard Library is aware of + pub const latest = WindowsVersion.win10_20h1; + pub const Range = struct { min: WindowsVersion, max: WindowsVersion, @@ -124,16 +128,17 @@ pub const Target = struct { out_stream: anytype, ) !void { if (fmt.len > 0 and fmt[0] == 's') { - if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { + if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.latest)) { try std.fmt.format(out_stream, ".{}", .{@tagName(self)}); } else { - try std.fmt.format(out_stream, "@intToEnum(Target.Os.WindowsVersion, {})", .{@enumToInt(self)}); + // TODO this code path breaks zig triples, but it is used in `builtin` + try std.fmt.format(out_stream, "@intToEnum(Target.Os.WindowsVersion, 0x{X:0>8})", .{@enumToInt(self)}); } } else { - if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { + if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.latest)) { try std.fmt.format(out_stream, "WindowsVersion.{}", .{@tagName(self)}); } else { - try std.fmt.format(out_stream, "WindowsVersion({})", .{@enumToInt(self)}); + try std.fmt.format(out_stream, "WindowsVersion(0x{X:0>8})", .{@enumToInt(self)}); } } } @@ -278,7 +283,7 @@ pub const Target = struct { .windows => return .{ .windows = .{ .min = .win8_1, - .max = .win10_19h1, + .max = WindowsVersion.latest, }, }, } diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 175b0e4555..d24e8a57e9 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -249,7 +249,7 @@ pub const NativeTargetInfo = struct { // values const known_build_numbers = [_]u32{ 10240, 10586, 14393, 15063, 16299, 17134, 17763, - 18362, 18363, + 18362, 19041, }; var last_idx: usize = 0; for (known_build_numbers) |build, i| { From fd9f509d6dcad43f5b1bf17e57b1f0b200755df8 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 24 Aug 2020 15:19:34 -0700 Subject: [PATCH 45/55] Revert "Merge pull request #6137 from Jan200101/update/glibc-2.32" This reverts commit bb9c3118ed5fdc16b8e2d9882375005c2a62d0cc, reversing changes made to 7015d84e0ca6f02fede45621571084df98dda712. This is missing quite a few headers --- lib/libc/glibc/abi.txt | 3929 ++--------------- lib/libc/glibc/fns.txt | 225 +- lib/libc/glibc/vers.txt | 1 - .../include/aarch64-linux-gnu/bits/hwcap.h | 21 +- .../aarch64-linux-gnu/bits/long-double.h | 2 +- .../aarch64-linux-gnu/bits/typesizes.h | 38 +- .../aarch64-linux-gnu/gnu/lib-names-lp64.h | 2 + .../aarch64-linux-gnu/gnu/stubs-lp64.h | 5 +- .../include/aarch64_be-linux-gnu/bits/hwcap.h | 21 +- .../aarch64_be-linux-gnu/bits/long-double.h | 2 +- .../aarch64_be-linux-gnu/bits/typesizes.h | 38 +- .../gnu/lib-names-lp64_be.h | 2 + .../aarch64_be-linux-gnu/gnu/stubs-lp64_be.h | 5 +- .../arm-linux-gnueabi/bits/long-double.h | 15 +- .../arm-linux-gnueabi/bits/semaphore.h | 13 +- .../arm-linux-gnueabihf/bits/long-double.h | 15 +- .../arm-linux-gnueabihf/bits/semaphore.h | 13 +- .../armeb-linux-gnueabi/bits/long-double.h | 15 +- .../armeb-linux-gnueabi/bits/semaphore.h | 13 +- .../armeb-linux-gnueabihf/bits/long-double.h | 15 +- .../armeb-linux-gnueabihf/bits/semaphore.h | 13 +- lib/libc/include/generic-glibc/argp.h | 3 +- lib/libc/include/generic-glibc/bits/a.out.h | 6 +- .../include/generic-glibc/bits/endianness.h | 9 +- .../include/generic-glibc/bits/environments.h | 64 +- lib/libc/include/generic-glibc/bits/epoll.h | 4 +- .../include/generic-glibc/bits/fcntl-linux.h | 3 +- lib/libc/include/generic-glibc/bits/fcntl.h | 65 +- lib/libc/include/generic-glibc/bits/fenv.h | 111 +- .../include/generic-glibc/bits/fenvinline.h | 8 + lib/libc/include/generic-glibc/bits/floatn.h | 62 +- .../generic-glibc/bits/flt-eval-method.h | 17 +- lib/libc/include/generic-glibc/bits/fp-logb.h | 10 +- .../generic-glibc/bits/indirect-return.h | 20 +- .../include/generic-glibc/bits/ipctypes.h | 19 +- .../include/generic-glibc/bits/iscanonical.h | 40 +- lib/libc/include/generic-glibc/bits/link.h | 204 +- .../include/generic-glibc/bits/long-double.h | 11 +- .../include/generic-glibc/bits/math-vector.h | 46 +- .../bits/mathcalls-helper-functions.h | 18 +- .../include/generic-glibc/bits/mathcalls.h | 9 +- .../include/generic-glibc/bits/mathinline.h | 12 + .../include/generic-glibc/bits/mman-shared.h | 1 - lib/libc/include/generic-glibc/bits/mman.h | 18 +- lib/libc/include/generic-glibc/bits/msq-pad.h | 31 + lib/libc/include/generic-glibc/bits/msq.h | 39 +- .../include/generic-glibc/bits/procfs-id.h | 9 +- lib/libc/include/generic-glibc/bits/procfs.h | 37 +- .../generic-glibc/bits/pthreadtypes-arch.h | 46 +- .../include/generic-glibc/bits/resource.h | 2 +- lib/libc/include/generic-glibc/bits/sem-pad.h | 33 + lib/libc/include/generic-glibc/bits/sem.h | 26 +- .../include/generic-glibc/bits/semaphore.h | 9 +- lib/libc/include/generic-glibc/bits/setjmp.h | 65 +- lib/libc/include/generic-glibc/bits/shm-pad.h | 37 + lib/libc/include/generic-glibc/bits/shm.h | 35 +- .../include/generic-glibc/bits/sigcontext.h | 181 +- .../include/generic-glibc/bits/siginfo-arch.h | 14 +- .../generic-glibc/bits/signum-generic.h | 27 +- lib/libc/include/generic-glibc/bits/signum.h | 58 + .../generic-glibc/bits/socket-constants.h | 16 +- lib/libc/include/generic-glibc/bits/stat.h | 251 +- .../generic-glibc/bits/statx-generic.h | 1 - .../include/generic-glibc/bits/stdio-ldbl.h | 46 +- lib/libc/include/generic-glibc/bits/stdio2.h | 25 +- .../include/generic-glibc/bits/stdlib-ldbl.h | 22 - lib/libc/include/generic-glibc/bits/stdlib.h | 17 +- .../generic-glibc/bits/string_fortified.h | 5 +- .../include/generic-glibc/bits/struct_mutex.h | 57 +- .../generic-glibc/bits/struct_rwlock.h | 38 +- .../include/generic-glibc/bits/sys_errlist.h | 32 + lib/libc/include/generic-glibc/bits/syscall.h | 24 +- lib/libc/include/generic-glibc/bits/sysctl.h | 1 + .../include/generic-glibc/bits/syslog-ldbl.h | 4 +- .../generic-glibc/bits/thread-shared-types.h | 10 - .../include/generic-glibc/bits/timesize.h | 13 +- lib/libc/include/generic-glibc/bits/types.h | 1 - .../include/generic-glibc/bits/typesizes.h | 66 +- lib/libc/include/generic-glibc/bits/unistd.h | 58 +- .../include/generic-glibc/bits/wchar-ldbl.h | 36 +- .../include/generic-glibc/bits/wordsize.h | 36 +- lib/libc/include/generic-glibc/complex.h | 29 +- lib/libc/include/generic-glibc/elf.h | 80 +- lib/libc/include/generic-glibc/err.h | 3 +- lib/libc/include/generic-glibc/error.h | 6 +- lib/libc/include/generic-glibc/features.h | 2 +- lib/libc/include/generic-glibc/fenv.h | 4 + .../finclude/math-vector-fortran.h | 26 +- lib/libc/include/generic-glibc/fpu_control.h | 161 +- .../include/generic-glibc/gnu/lib-names-32.h | 2 + .../generic-glibc/gnu/lib-names-hard.h | 2 + .../generic-glibc/gnu/lib-names-n32_hard.h | 2 + .../generic-glibc/gnu/lib-names-n64_hard.h | 2 + .../generic-glibc/gnu/lib-names-o32_hard.h | 2 + .../generic-glibc/gnu/lib-names-soft.h | 2 + .../include/generic-glibc/gnu/lib-names.h | 41 +- lib/libc/include/generic-glibc/gnu/stubs-32.h | 2 + lib/libc/include/generic-glibc/gnu/stubs-64.h | 18 + .../include/generic-glibc/gnu/stubs-hard.h | 2 + .../generic-glibc/gnu/stubs-n32_hard.h | 2 + .../generic-glibc/gnu/stubs-n64_hard.h | 2 + .../generic-glibc/gnu/stubs-o32_hard.h | 2 + .../include/generic-glibc/gnu/stubs-soft.h | 2 + lib/libc/include/generic-glibc/gnu/stubs.h | 40 +- lib/libc/include/generic-glibc/inttypes.h | 48 +- lib/libc/include/generic-glibc/malloc.h | 7 +- lib/libc/include/generic-glibc/math.h | 88 +- lib/libc/include/generic-glibc/monetary.h | 3 +- .../include/generic-glibc/netinet/icmp6.h | 8 +- lib/libc/include/generic-glibc/netinet/in.h | 4 - lib/libc/include/generic-glibc/nss.h | 203 +- lib/libc/include/generic-glibc/printf.h | 3 +- lib/libc/include/generic-glibc/pthread.h | 15 - lib/libc/include/generic-glibc/signal.h | 31 +- lib/libc/include/generic-glibc/stdio.h | 27 +- lib/libc/include/generic-glibc/stdlib.h | 15 +- lib/libc/include/generic-glibc/string.h | 48 +- lib/libc/include/generic-glibc/sys/asm.h | 497 +++ lib/libc/include/generic-glibc/sys/cachectl.h | 41 + lib/libc/include/generic-glibc/sys/cdefs.h | 49 +- lib/libc/include/generic-glibc/sys/elf.h | 14 +- lib/libc/include/generic-glibc/sys/ptrace.h | 46 +- lib/libc/include/generic-glibc/sys/random.h | 1 - lib/libc/include/generic-glibc/sys/sysctl.h | 76 + lib/libc/include/generic-glibc/sys/syslog.h | 4 +- lib/libc/include/generic-glibc/sys/ucontext.h | 284 +- lib/libc/include/generic-glibc/sys/user.h | 322 +- lib/libc/include/generic-glibc/threads.h | 13 +- lib/libc/include/generic-glibc/unistd.h | 65 +- lib/libc/include/generic-glibc/wchar.h | 14 +- lib/libc/include/i386-linux-gnu/bits/fenv.h | 54 + .../include/i386-linux-gnu/bits/long-double.h | 2 +- lib/libc/include/i386-linux-gnu/bits/select.h | 42 +- .../include/i386-linux-gnu/bits/sem-pad.h | 24 + .../include/i386-linux-gnu/bits/semaphore.h | 5 +- lib/libc/include/i386-linux-gnu/bits/sysctl.h | 20 + .../include/i386-linux-gnu/bits/typesizes.h | 6 - .../include/mips-linux-gnu/bits/msq-pad.h | 31 + .../include/mips-linux-gnu/bits/resource.h | 2 +- .../include/mips-linux-gnu/bits/sem-pad.h | 24 + .../include/mips-linux-gnu/bits/shm-pad.h | 26 + lib/libc/include/mips-linux-gnu/bits/signum.h | 68 + .../mips64-linux-gnuabi64/bits/msq-pad.h | 31 + .../mips64-linux-gnuabi64/bits/resource.h | 2 +- .../mips64-linux-gnuabi64/bits/sem-pad.h | 24 + .../mips64-linux-gnuabi64/bits/shm-pad.h | 26 + .../mips64-linux-gnuabi64/bits/signum.h | 68 + .../mips64-linux-gnuabin32/bits/msq-pad.h | 31 + .../mips64-linux-gnuabin32/bits/resource.h | 2 +- .../mips64-linux-gnuabin32/bits/sem-pad.h | 24 + .../mips64-linux-gnuabin32/bits/shm-pad.h | 26 + .../mips64-linux-gnuabin32/bits/signum.h | 68 + .../mips64el-linux-gnuabi64/bits/msq-pad.h | 31 + .../mips64el-linux-gnuabi64/bits/resource.h | 2 +- .../mips64el-linux-gnuabi64/bits/sem-pad.h | 24 + .../mips64el-linux-gnuabi64/bits/shm-pad.h | 26 + .../mips64el-linux-gnuabi64/bits/signum.h | 68 + .../mips64el-linux-gnuabin32/bits/msq-pad.h | 31 + .../mips64el-linux-gnuabin32/bits/resource.h | 2 +- .../mips64el-linux-gnuabin32/bits/sem-pad.h | 24 + .../mips64el-linux-gnuabin32/bits/shm-pad.h | 26 + .../mips64el-linux-gnuabin32/bits/signum.h | 68 + .../include/mipsel-linux-gnu/bits/msq-pad.h | 31 + .../include/mipsel-linux-gnu/bits/resource.h | 2 +- .../include/mipsel-linux-gnu/bits/sem-pad.h | 24 + .../include/mipsel-linux-gnu/bits/shm-pad.h | 26 + .../include/mipsel-linux-gnu/bits/signum.h | 68 + .../powerpc-linux-gnu/bits/fenvinline.h | 102 + .../include/powerpc-linux-gnu/bits/hwcap.h | 4 +- .../powerpc-linux-gnu/bits/iscanonical.h | 2 +- .../powerpc-linux-gnu/bits/long-double.h | 2 +- .../include/powerpc-linux-gnu/bits/msq-pad.h | 26 + .../include/powerpc-linux-gnu/bits/sem-pad.h | 26 + .../powerpc-linux-gnu/bits/semaphore.h | 5 +- .../include/powerpc-linux-gnu/bits/shm-pad.h | 28 + .../powerpc-linux-gnu/gnu/lib-names-32.h | 2 + lib/libc/include/powerpc-linux-gnu/ieee754.h | 68 +- .../powerpc64-linux-gnu/bits/fenvinline.h | 102 + .../include/powerpc64-linux-gnu/bits/hwcap.h | 4 +- .../powerpc64-linux-gnu/bits/iscanonical.h | 2 +- .../powerpc64-linux-gnu/bits/long-double.h | 2 +- .../powerpc64-linux-gnu/bits/msq-pad.h | 26 + .../powerpc64-linux-gnu/bits/sem-pad.h | 26 + .../powerpc64-linux-gnu/bits/semaphore.h | 5 +- .../powerpc64-linux-gnu/bits/shm-pad.h | 28 + .../powerpc64-linux-gnu/gnu/lib-names-64-v1.h | 2 + .../powerpc64-linux-gnu/gnu/stubs-64-v1.h | 2 + .../include/powerpc64-linux-gnu/ieee754.h | 68 +- .../powerpc64le-linux-gnu/bits/fenvinline.h | 102 + .../powerpc64le-linux-gnu/bits/hwcap.h | 4 +- .../powerpc64le-linux-gnu/bits/iscanonical.h | 2 +- .../powerpc64le-linux-gnu/bits/long-double.h | 5 +- .../powerpc64le-linux-gnu/bits/msq-pad.h | 26 + .../powerpc64le-linux-gnu/bits/sem-pad.h | 26 + .../powerpc64le-linux-gnu/bits/semaphore.h | 5 +- .../powerpc64le-linux-gnu/bits/shm-pad.h | 28 + .../gnu/lib-names-64-v2.h | 2 + .../powerpc64le-linux-gnu/gnu/stubs-64-v2.h | 2 + .../include/powerpc64le-linux-gnu/ieee754.h | 68 +- .../riscv64-linux-gnu/bits/long-double.h | 2 +- .../riscv64-linux-gnu/bits/semaphore.h | 14 +- .../riscv64-linux-gnu/bits/typesizes.h | 38 +- .../riscv64-linux-gnu/gnu/lib-names-lp64.h | 2 + .../riscv64-linux-gnu/gnu/stubs-lp64.h | 5 +- lib/libc/include/s390x-linux-gnu/bits/fenv.h | 4 +- .../s390x-linux-gnu/bits/long-double.h | 2 +- .../include/s390x-linux-gnu/bits/semaphore.h | 4 +- .../include/s390x-linux-gnu/bits/typesizes.h | 7 - .../s390x-linux-gnu/gnu/lib-names-64.h | 2 + lib/libc/include/sparc-linux-gnu/bits/fenv.h | 9 + .../sparc-linux-gnu/bits/long-double.h | 2 +- .../include/sparc-linux-gnu/bits/msq-pad.h | 26 + .../include/sparc-linux-gnu/bits/resource.h | 2 +- .../include/sparc-linux-gnu/bits/sem-pad.h | 26 + .../include/sparc-linux-gnu/bits/semaphore.h | 5 +- .../include/sparc-linux-gnu/bits/shm-pad.h | 28 + .../include/sparc-linux-gnu/bits/signum.h | 39 + .../include/sparc-linux-gnu/bits/typesizes.h | 7 - .../sparc-linux-gnu/gnu/lib-names-64.h | 2 + .../include/sparcv9-linux-gnu/bits/fenv.h | 9 + .../sparcv9-linux-gnu/bits/long-double.h | 2 +- .../include/sparcv9-linux-gnu/bits/msq-pad.h | 26 + .../include/sparcv9-linux-gnu/bits/resource.h | 2 +- .../include/sparcv9-linux-gnu/bits/sem-pad.h | 26 + .../sparcv9-linux-gnu/bits/semaphore.h | 5 +- .../include/sparcv9-linux-gnu/bits/shm-pad.h | 28 + .../include/sparcv9-linux-gnu/bits/signum.h | 39 + .../sparcv9-linux-gnu/bits/typesizes.h | 7 - lib/libc/include/x86_64-linux-gnu/bits/fenv.h | 54 + .../x86_64-linux-gnu/bits/long-double.h | 2 +- .../include/x86_64-linux-gnu/bits/select.h | 42 +- .../include/x86_64-linux-gnu/bits/sem-pad.h | 24 + .../include/x86_64-linux-gnu/bits/semaphore.h | 5 +- .../include/x86_64-linux-gnu/bits/sysctl.h | 20 + .../include/x86_64-linux-gnu/bits/typesizes.h | 6 - .../x86_64-linux-gnu/gnu/lib-names-64.h | 2 + .../include/x86_64-linux-gnu/gnu/stubs-64.h | 2 + .../include/x86_64-linux-gnux32/bits/fenv.h | 54 + .../x86_64-linux-gnux32/bits/long-double.h | 2 +- .../include/x86_64-linux-gnux32/bits/select.h | 42 +- .../x86_64-linux-gnux32/bits/sem-pad.h | 24 + .../x86_64-linux-gnux32/bits/semaphore.h | 5 +- .../include/x86_64-linux-gnux32/bits/sysctl.h | 20 + .../x86_64-linux-gnux32/bits/typesizes.h | 6 - .../x86_64-linux-gnux32/gnu/lib-names-x32.h | 2 + .../x86_64-linux-gnux32/gnu/stubs-x32.h | 2 + 246 files changed, 4898 insertions(+), 6578 deletions(-) create mode 100644 lib/libc/include/generic-glibc/bits/fenvinline.h create mode 100644 lib/libc/include/generic-glibc/bits/mathinline.h create mode 100644 lib/libc/include/generic-glibc/bits/msq-pad.h create mode 100644 lib/libc/include/generic-glibc/bits/sem-pad.h create mode 100644 lib/libc/include/generic-glibc/bits/shm-pad.h create mode 100644 lib/libc/include/generic-glibc/bits/signum.h create mode 100644 lib/libc/include/generic-glibc/bits/sys_errlist.h create mode 100644 lib/libc/include/generic-glibc/bits/sysctl.h create mode 100644 lib/libc/include/generic-glibc/gnu/stubs-64.h create mode 100644 lib/libc/include/generic-glibc/sys/asm.h create mode 100644 lib/libc/include/generic-glibc/sys/cachectl.h create mode 100644 lib/libc/include/generic-glibc/sys/sysctl.h create mode 100644 lib/libc/include/i386-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/i386-linux-gnu/bits/sysctl.h create mode 100644 lib/libc/include/mips-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/mips-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/mips-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/mips-linux-gnu/bits/signum.h create mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h create mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h create mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h create mode 100644 lib/libc/include/mips64-linux-gnuabi64/bits/signum.h create mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h create mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h create mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h create mode 100644 lib/libc/include/mips64-linux-gnuabin32/bits/signum.h create mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h create mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h create mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h create mode 100644 lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h create mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h create mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h create mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h create mode 100644 lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h create mode 100644 lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/mipsel-linux-gnu/bits/signum.h create mode 100644 lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h create mode 100644 lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h create mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h create mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/sparc-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/sparc-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/sparc-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/sparc-linux-gnu/bits/signum.h create mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h create mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h create mode 100644 lib/libc/include/sparcv9-linux-gnu/bits/signum.h create mode 100644 lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h create mode 100644 lib/libc/include/x86_64-linux-gnu/bits/sysctl.h create mode 100644 lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h create mode 100644 lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h diff --git a/lib/libc/glibc/abi.txt b/lib/libc/glibc/abi.txt index 13053a9417..4832449214 100644 --- a/lib/libc/glibc/abi.txt +++ b/lib/libc/glibc/abi.txt @@ -200,9 +200,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 - 29 @@ -231,8 +229,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu - - 29 29 29 @@ -241,27 +237,20 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - +29 +29 +29 +29 +29 +29 +29 29 29 29 - 29 29 -29 -29 - -29 - -29 -29 - -29 - -29 - @@ -270,51 +259,22 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - - - - - - - - - - - - - +29 +29 +29 +29 +29 29 29 29 29 - -29 - 29 29 29 29 -29 - -29 - -29 - -29 - - - - - - - - - - @@ -341,50 +301,29 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 - - 29 29 29 29 - - - -29 - - - -29 - -29 - 29 29 29 - 29 29 +29 +29 29 +29 29 35 - - - - - - - - - - 29 29 29 @@ -395,7 +334,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu - 29 29 29 @@ -423,16 +361,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu - - - - - - 29 29 - 29 29 29 @@ -441,8 +372,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - 29 29 @@ -452,17 +381,10 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - - - 29 29 - - 29 29 - 29 29 29 @@ -482,7 +404,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - 29 29 29 @@ -498,9 +419,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 - 29 29 29 @@ -524,29 +443,17 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 - 29 - 29 - 29 - 29 - 29 - 29 - 29 - 29 - 29 - 29 - 29 29 30 @@ -574,29 +481,23 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 29 29 - 29 29 29 - 29 29 29 29 - 29 29 - - 29 29 29 @@ -612,34 +513,23 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -42 29 29 29 - - - 29 29 - 29 - 29 29 - 29 29 - 29 - 29 29 - - 29 @@ -678,26 +568,17 @@ aarch64-linux-gnu aarch64_be-linux-gnu - 29 29 29 - 29 - 29 - - - - - - 29 @@ -810,11 +691,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - 29 - - 29 29 29 @@ -830,7 +707,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 29 @@ -838,10 +714,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - 29 - - 29 29 29 @@ -872,11 +745,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - - - - 29 29 29 @@ -895,17 +763,12 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 - 29 29 29 29 29 - - - 29 29 29 @@ -913,11 +776,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - 29 - - - 29 29 29 @@ -931,8 +790,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - 29 29 29 @@ -943,34 +800,24 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 33 - 29 29 29 - 29 29 - 29 - 29 - - 29 - - 29 29 - 29 - 29 29 29 @@ -1003,9 +850,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - - 29 29 @@ -1040,8 +884,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - - 29 29 29 @@ -1061,93 +903,48 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 - - - 29 29 - - 29 - - - 29 29 29 29 - - 29 29 29 29 29 - 29 29 29 - - 29 29 29 - - 29 - - - - 29 29 - - 29 - 29 - - - 29 - - - 29 29 - - 29 - - 29 - 29 - - - 29 - - - - 29 - - - 29 29 - - 29 29 29 @@ -1166,8 +963,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - - 29 29 29 @@ -1189,10 +984,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 - - 29 - 29 29 29 @@ -1205,17 +997,14 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 - 29 29 29 - 29 29 29 - 29 29 29 @@ -1813,7 +1602,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 39 29 -29 42 +29 37 37 37 @@ -2939,19 +2728,17 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -42 -29 -29 -29 -29 -29 42 29 29 29 29 29 29 -42 +29 +29 +29 +29 +29 29 29 29 @@ -2981,9 +2768,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -29 42 +29 30 -29 42 +29 29 29 29 @@ -3049,7 +2836,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -29 42 +29 29 29 29 @@ -3354,14 +3141,12 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -42 29 29 29 29 29 29 -42 29 29 29 @@ -3467,8 +3252,6 @@ aarch64-linux-gnu aarch64_be-linux-gnu 29 29 29 -42 -42 29 29 35 @@ -4159,9 +3942,7 @@ s390x-linux-gnu 27 27 - 27 - 27 @@ -4190,8 +3971,6 @@ s390x-linux-gnu - - 5 5 5 @@ -4200,79 +3979,43 @@ s390x-linux-gnu 27 27 - - 27 5 16 20 - - 5 5 5 27 27 - 27 27 27 - 27 - 5 5 5 5 5 - - - - - - - - - - - - - - 5 15 - 5 5 - 5 16 - 5 5 5 16 - 5 - 27 27 - 27 - - - - - - - - - 5 5 5 @@ -4300,50 +4043,29 @@ s390x-linux-gnu 20 - - 5 5 5 5 - - - 5 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - - - - - - - - - - 5 5 27 @@ -4353,7 +4075,6 @@ s390x-linux-gnu - 39 5 16 @@ -4382,16 +4103,9 @@ s390x-linux-gnu - - - - - - 27 27 - 27 5 5 @@ -4400,8 +4114,6 @@ s390x-linux-gnu 16 5 15 16 - - 5 5 5 @@ -4411,17 +4123,10 @@ s390x-linux-gnu 5 5 5 - - - - 5 16 - - 5 5 - 5 5 16 @@ -4441,7 +4146,6 @@ s390x-linux-gnu 16 5 5 - 5 5 15 @@ -4457,9 +4161,7 @@ s390x-linux-gnu 27 27 - 27 - 5 5 5 @@ -4483,29 +4185,17 @@ s390x-linux-gnu 5 16 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 5 5 30 @@ -4533,72 +4223,55 @@ s390x-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 5 5 5 - -27 - -27 - - -27 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -42 -5 -5 -5 -8 11 - - - -27 - -27 - -27 - -27 - 27 27 27 - - +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +11 27 +27 +27 +27 + +27 +27 +27 + +27 27 23 31 - - 5 @@ -4637,26 +4310,17 @@ s390x-linux-gnu - 5 5 19 - 11 - 5 - - - - - - 5 16 16 @@ -4769,11 +4433,7 @@ s390x-linux-gnu 5 5 20 - - 20 - - 5 5 19 @@ -4789,7 +4449,6 @@ s390x-linux-gnu 27 27 - 27 28 @@ -4797,10 +4456,7 @@ s390x-linux-gnu 16 16 15 16 - 5 16 - - 5 5 5 @@ -4831,11 +4487,6 @@ s390x-linux-gnu 14 16 5 - - - - - 5 5 5 @@ -4854,17 +4505,12 @@ s390x-linux-gnu 27 27 - 27 - 5 5 5 5 5 - - - 8 8 8 @@ -4872,11 +4518,7 @@ s390x-linux-gnu 5 27 27 - 27 - - - 19 18 19 @@ -4890,8 +4532,6 @@ s390x-linux-gnu 5 5 5 - - 5 5 5 @@ -4902,34 +4542,24 @@ s390x-linux-gnu 16 33 - 5 31 5 5 - 27 27 - 27 - 15 16 - - 15 16 - - 27 27 - 27 - 16 5 @@ -4962,9 +4592,6 @@ s390x-linux-gnu 5 5 5 16 - - - 12 5 @@ -4999,8 +4626,6 @@ s390x-linux-gnu 5 5 - - 5 5 5 @@ -5020,93 +4645,48 @@ s390x-linux-gnu 16 - - - 5 5 16 - - 5 - - - 5 12 5 5 - - 5 5 5 5 5 - 16 5 5 - - 5 12 20 - - 20 - - - - 5 15 16 - - 5 16 - 16 - - - 15 16 - - - 5 16 15 16 - - 15 16 - - 5 16 - 16 - - - 16 - - - - 16 - - - 5 5 - - 16 16 16 @@ -5125,8 +4705,6 @@ s390x-linux-gnu 5 5 - - 5 5 5 16 @@ -5148,10 +4726,7 @@ s390x-linux-gnu 16 5 16 - - 5 - 5 5 5 @@ -5164,17 +4739,14 @@ s390x-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 5 5 @@ -5772,7 +5344,7 @@ s390x-linux-gnu 5 5 39 5 -5 42 +5 37 37 37 @@ -6898,19 +6470,17 @@ s390x-linux-gnu 5 5 5 -42 5 5 5 5 -14 15 42 +14 15 5 5 5 5 5 5 -42 5 5 5 @@ -6940,9 +6510,9 @@ s390x-linux-gnu 5 5 5 -14 15 42 +14 15 30 -8 42 +8 5 5 24 @@ -7008,7 +6578,7 @@ s390x-linux-gnu 5 15 5 -5 42 +5 23 5 5 @@ -7313,14 +6883,12 @@ s390x-linux-gnu 5 5 5 -42 5 5 5 5 5 5 -42 5 5 5 @@ -7426,8 +6994,6 @@ s390x-linux-gnu 5 18 5 -42 -42 5 16 12 16 35 @@ -8122,8 +7688,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - - 16 16 16 @@ -8149,8 +7713,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - - 16 16 16 @@ -8160,12 +7722,8 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 - - 16 20 - - 16 16 16 @@ -8173,7 +7731,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 - 27 27 @@ -8181,43 +7738,22 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - - 16 16 16 16 16 - - - - - - - - - - - - - - +16 +16 +16 +16 +16 16 16 16 16 - 16 - -16 -16 - -16 -16 - -16 - 27 27 @@ -8226,16 +7762,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - - - - - - - - - - 16 16 @@ -8259,50 +7785,29 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 20 - - 16 16 16 16 - - - 16 +27 - +27 27 27 - 27 27 -27 - -27 - - - 35 - - - - - - - - - - 16 16 27 @@ -8313,7 +7818,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - 16 16 16 @@ -8341,17 +7845,10 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - - - - - - 27 27 - 16 16 16 @@ -8359,8 +7856,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 - - 16 16 @@ -8370,17 +7865,10 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - - - - 16 16 - - 16 16 - 16 16 16 @@ -8400,7 +7888,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - 16 16 16 @@ -8417,8 +7904,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 - - 16 16 16 @@ -8442,29 +7927,17 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 16 16 30 @@ -8493,71 +7966,54 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 +27 + +27 27 27 +16 +16 +16 + 27 27 - 16 16 16 - - +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 27 27 - - -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -16 -42 -16 -16 -16 - - - - 27 27 - - 27 27 - -27 - - -27 - - 23 - - 16 @@ -8596,26 +8052,17 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf - 16 16 19 - 16 - 16 - - - - - - 16 @@ -8728,11 +8175,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 20 - - 20 - - 16 16 19 @@ -8750,16 +8193,11 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 - 28 16 16 16 16 - -16 - - 16 16 16 @@ -8790,11 +8228,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - - - - - +16 16 16 16 @@ -8814,16 +8248,11 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 - - 16 16 16 16 16 - - - 16 16 16 @@ -8832,10 +8261,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 27 - - - - 19 18 19 @@ -8849,8 +8274,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - - 16 16 16 @@ -8861,34 +8284,24 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 33 - 16 16 16 - 27 27 - - 16 - - 16 - - 27 27 - - 16 16 16 @@ -8921,9 +8334,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - - - 16 16 @@ -8958,8 +8368,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 - - 16 16 16 @@ -8979,26 +8387,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 - - - 16 -16 -16 - - -16 - - - -16 -16 - - -16 -16 - - 16 16 16 @@ -9006,66 +8395,26 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 +16 +16 +16 +16 +16 16 16 - +16 16 +16 16 16 20 - - 20 - - - - -16 -16 - - -16 - -16 - - - -16 - - - -16 -16 - - -16 - - -16 - -16 - - - -16 - - - - -16 - - - -16 -16 - - 16 16 16 @@ -9081,10 +8430,20 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - 16 16 - +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 +16 16 16 @@ -9107,10 +8466,9 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 - - 16 - +16 +16 16 16 16 @@ -9124,17 +8482,14 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 27 - 27 27 - 27 27 - 16 16 16 @@ -9731,7 +9086,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 39 16 16 -42 16 +16 37 37 @@ -10857,19 +10212,17 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -42 -16 -16 -16 -16 -42 16 16 16 16 16 16 16 -42 +16 +16 +16 +16 +16 16 16 16 @@ -10899,9 +10252,9 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -42 16 +16 30 -42 16 +16 16 16 24 @@ -10967,7 +10320,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -42 16 +16 23 16 16 @@ -11272,14 +10625,12 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 16 16 -42 16 16 16 16 16 16 -42 16 16 16 @@ -11385,8 +10736,6 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf 16 18 16 -42 -42 16 16 35 @@ -12077,9 +11426,7 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - 27 - 27 @@ -12108,8 +11455,6 @@ sparc-linux-gnu sparcel-linux-gnu - - 0 0 0 @@ -12118,79 +11463,43 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - - 27 1 16 20 - - 5 0 0 27 27 - 27 27 27 - 27 - 1 1 1 0 0 - - - - - - - - - - - - - - 0 15 - 1 1 - 1 16 - 0 0 0 16 - 0 - 27 27 - 27 - - - - - - - - - 0 5 5 @@ -12218,50 +11527,29 @@ sparc-linux-gnu sparcel-linux-gnu 20 - - 0 1 5 0 - - - 0 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - - - - - - - - - - 5 0 27 @@ -12272,7 +11560,6 @@ sparc-linux-gnu sparcel-linux-gnu - 0 16 16 @@ -12300,16 +11587,9 @@ sparc-linux-gnu sparcel-linux-gnu - - - - - - 27 27 - 27 0 1 @@ -12318,8 +11598,6 @@ sparc-linux-gnu sparcel-linux-gnu 16 5 15 16 - - 0 5 0 @@ -12329,17 +11607,10 @@ sparc-linux-gnu sparcel-linux-gnu 5 0 1 - - - - 5 16 - - 5 5 - 0 1 5 16 @@ -12359,7 +11630,6 @@ sparc-linux-gnu sparcel-linux-gnu 16 5 0 - 0 0 15 @@ -12375,9 +11645,7 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - 27 - 1 1 1 @@ -12401,29 +11669,17 @@ sparc-linux-gnu sparcel-linux-gnu 0 16 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 1 1 30 @@ -12451,29 +11707,23 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 1 1 1 - 27 27 - - 27 1 0 @@ -12489,34 +11739,23 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 1 -42 1 0 0 -3 8 11 - - - -27 - -27 - -27 - -27 - +3 11 27 27 27 - - 27 +27 +27 +27 + +27 27 23 - - 0 @@ -12555,26 +11794,17 @@ sparc-linux-gnu sparcel-linux-gnu - 0 0 19 - 11 - 1 - - - - - - 5 16 16 @@ -12687,11 +11917,7 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 20 - - 20 - - 0 5 19 @@ -12707,7 +11933,6 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - 27 28 @@ -12715,10 +11940,7 @@ sparc-linux-gnu sparcel-linux-gnu 16 16 15 16 - 0 16 - - 0 0 0 @@ -12749,11 +11971,6 @@ sparc-linux-gnu sparcel-linux-gnu 14 16 1 5 - - - - - 1 0 0 @@ -12772,17 +11989,12 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - 27 - 5 5 5 0 5 - - - 8 8 8 @@ -12790,11 +12002,7 @@ sparc-linux-gnu sparcel-linux-gnu 0 27 27 - 27 - - - 19 18 19 @@ -12808,8 +12016,6 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 5 - - 0 0 0 @@ -12820,34 +12026,24 @@ sparc-linux-gnu sparcel-linux-gnu 16 33 - 0 0 4 - 27 27 - 27 - 15 16 - - 15 16 - - 27 27 - 33 - 16 5 @@ -12880,9 +12076,6 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 1 16 - - - 12 1 @@ -12917,8 +12110,6 @@ sparc-linux-gnu sparcel-linux-gnu 0 1 - - 0 2 0 @@ -12938,93 +12129,48 @@ sparc-linux-gnu sparcel-linux-gnu 16 - - - 5 5 16 - - 0 - - - 0 12 1 1 - - 1 1 1 1 1 - 16 0 0 - - 0 12 20 - - 20 - - - - 3 15 16 - - 0 16 - 16 - - - 15 16 - - - 0 16 15 16 - - 15 16 - - 0 16 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -13043,8 +12189,6 @@ sparc-linux-gnu sparcel-linux-gnu 0 1 - - 0 1 0 16 @@ -13066,10 +12210,7 @@ sparc-linux-gnu sparcel-linux-gnu 16 5 16 - - 0 - 5 5 0 @@ -13082,17 +12223,14 @@ sparc-linux-gnu sparcel-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 1 1 @@ -13690,7 +12828,7 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 39 1 -1 42 +1 37 37 37 @@ -14816,19 +13954,17 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 0 -42 5 1 1 0 1 -14 15 42 +14 15 0 1 0 0 0 0 -42 5 14 1 1 14 @@ -14858,9 +13994,9 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 0 -14 15 42 +14 15 30 -8 42 +8 1 5 24 @@ -14926,7 +14062,7 @@ sparc-linux-gnu sparcel-linux-gnu 0 15 0 -0 42 +0 23 5 5 @@ -15231,14 +14367,12 @@ sparc-linux-gnu sparcel-linux-gnu 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -15344,8 +14478,6 @@ sparc-linux-gnu sparcel-linux-gnu 0 18 0 -42 -42 0 16 12 16 35 @@ -16036,9 +15168,7 @@ sparcv9-linux-gnu 27 27 - 27 - 27 @@ -16067,8 +15197,6 @@ sparcv9-linux-gnu 5 5 - - 5 5 5 @@ -16077,79 +15205,43 @@ sparcv9-linux-gnu 27 27 - - 27 5 20 - - 5 5 5 27 27 - 27 27 27 - 27 - 5 5 5 5 5 - - - - - - - - - - - - - - 5 15 - 5 5 - 5 - 5 5 5 16 - 5 - 27 27 - 27 - - - - - - - - - 5 5 5 @@ -16177,50 +15269,29 @@ sparcv9-linux-gnu 20 - - 5 5 5 5 - - - 5 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - - - - - - - - - - 5 5 27 @@ -16231,7 +15302,6 @@ sparcv9-linux-gnu - 5 16 16 @@ -16259,16 +15329,9 @@ sparcv9-linux-gnu - - - - - - 27 27 - 27 5 5 @@ -16277,8 +15340,6 @@ sparcv9-linux-gnu 5 5 15 - - 5 5 5 @@ -16288,17 +15349,10 @@ sparcv9-linux-gnu 5 5 5 - - - - 5 16 - - 5 5 - 5 5 16 @@ -16318,7 +15372,6 @@ sparcv9-linux-gnu 16 5 5 - 5 5 15 @@ -16334,9 +15387,7 @@ sparcv9-linux-gnu 27 27 - 27 - 5 5 5 @@ -16360,29 +15411,17 @@ sparcv9-linux-gnu 5 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 5 5 30 @@ -16410,72 +15449,55 @@ sparcv9-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 5 5 5 - -27 - -27 - - -27 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -42 -5 -5 -5 -8 11 - - - -27 - -27 - -27 - -27 - 27 27 27 - - +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +11 27 +27 +27 +27 + +27 +27 +27 + +27 27 23 - - 5 @@ -16514,26 +15536,17 @@ sparcv9-linux-gnu - 5 5 19 - 11 - 5 - - - - - - 5 @@ -16646,11 +15659,7 @@ sparcv9-linux-gnu 5 5 20 - - 20 - - 5 5 19 @@ -16666,7 +15675,6 @@ sparcv9-linux-gnu 27 27 - 27 28 @@ -16674,10 +15682,7 @@ sparcv9-linux-gnu 16 16 15 - 5 - - 5 5 5 @@ -16708,11 +15713,6 @@ sparcv9-linux-gnu 14 16 5 - - - - - 5 5 5 @@ -16731,17 +15731,12 @@ sparcv9-linux-gnu 27 27 - 27 - 5 5 5 5 5 - - - 8 8 8 @@ -16749,11 +15744,7 @@ sparcv9-linux-gnu 5 27 27 - 27 - - - 19 18 19 @@ -16767,8 +15758,6 @@ sparcv9-linux-gnu 5 5 5 - - 5 5 5 @@ -16779,34 +15768,24 @@ sparcv9-linux-gnu 5 33 - 5 5 5 - 27 27 - 27 - 15 - - 15 - - 27 27 - 27 - 16 5 @@ -16839,9 +15818,6 @@ sparcv9-linux-gnu 5 5 5 - - - 12 5 @@ -16876,8 +15852,6 @@ sparcv9-linux-gnu 5 5 - - 5 5 5 @@ -16897,93 +15871,48 @@ sparcv9-linux-gnu 16 - - - 5 5 16 - - 5 - - - 5 12 5 5 - - 5 5 5 5 5 - 16 5 5 - - 5 12 20 - - 20 - - - - 5 15 - - 5 - 16 - - - 15 - - - 5 15 - - 15 - - 5 - 16 - - - 16 - - - - 16 - - - 5 5 - - 16 16 16 @@ -17002,8 +15931,6 @@ sparcv9-linux-gnu 5 5 - - 5 5 5 @@ -17025,10 +15952,7 @@ sparcv9-linux-gnu 16 5 16 - - 5 - 5 5 5 @@ -17041,17 +15965,14 @@ sparcv9-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 5 5 @@ -17649,7 +16570,7 @@ sparcv9-linux-gnu 5 5 39 5 -5 42 +5 37 37 37 @@ -18775,19 +17696,17 @@ sparcv9-linux-gnu 5 5 5 -42 5 5 5 5 -14 15 42 +14 15 5 5 5 5 5 5 -42 5 14 5 5 14 @@ -18817,9 +17736,9 @@ sparcv9-linux-gnu 5 5 5 -14 15 42 +14 15 30 -8 42 +8 5 5 24 @@ -18885,7 +17804,7 @@ sparcv9-linux-gnu 5 15 5 -5 42 +5 23 5 5 @@ -19190,14 +18109,12 @@ sparcv9-linux-gnu 5 5 5 -42 5 5 5 5 5 5 -42 5 5 5 @@ -19303,8 +18220,6 @@ sparcv9-linux-gnu 5 18 5 -42 -42 5 12 35 @@ -19995,9 +18910,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - 27 - 27 @@ -20026,8 +18939,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 - - 0 0 0 @@ -20036,79 +18947,43 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - - 27 5 20 - - 5 0 0 27 27 - 27 27 27 - 27 - 5 5 5 0 0 - - - - - - - - - - - - - - 0 15 - 5 5 - 5 - 0 0 0 16 - 0 - 27 27 - 27 - - - - - - - - - 0 5 5 @@ -20136,50 +19011,29 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 20 - - 0 5 5 0 - - - 0 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - - - - - - - - - - 5 0 27 @@ -20190,7 +19044,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 - 0 16 16 @@ -20218,16 +19071,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 - - - - - - 27 27 - 27 0 5 @@ -20236,8 +19082,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 5 5 15 - - 0 5 0 @@ -20247,17 +19091,10 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 5 0 5 - - - - 5 16 - - 5 5 - 0 5 16 @@ -20277,7 +19114,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 5 0 - 0 0 15 @@ -20293,9 +19129,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - 27 - 5 5 5 @@ -20319,29 +19153,17 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 5 5 30 @@ -20369,29 +19191,23 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - 27 27 27 - 27 27 27 - 27 5 5 5 - 27 27 - - 27 5 0 @@ -20407,34 +19223,23 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 5 -42 5 0 0 -8 11 - - - -27 - -27 - -27 - -27 - +11 27 27 27 - - 27 +27 +27 +27 + +27 27 23 - - 0 @@ -20473,26 +19278,17 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 - 0 0 19 - 11 - 5 - - - - - - 5 @@ -20605,11 +19401,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 20 - - 20 - - 0 5 19 @@ -20625,7 +19417,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - 27 28 @@ -20633,10 +19424,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 16 15 - 0 - - 0 0 0 @@ -20667,11 +19455,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 14 16 5 - - - - - 5 0 0 @@ -20690,17 +19473,12 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - 27 - 5 5 5 0 5 - - - 8 8 8 @@ -20708,11 +19486,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 27 27 - 27 - - - 19 18 19 @@ -20726,8 +19500,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 5 - - 0 0 0 @@ -20738,34 +19510,24 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 5 33 - 0 0 5 - 27 27 - 27 - 15 - - 15 - - 27 27 - 27 - 16 16 5 @@ -20798,9 +19560,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 5 - - - 12 5 @@ -20835,8 +19594,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 5 - - 0 5 0 @@ -20856,93 +19613,48 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 - - - 5 5 16 - - 0 - - - 0 12 5 5 - - 5 5 5 5 5 - 16 0 0 - - 0 12 20 - - 20 - - - - 5 15 - - 0 - 16 - - - 15 - - - 0 15 - - 15 - - 0 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -20961,8 +19673,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 5 - - 0 5 0 @@ -20984,10 +19694,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 16 5 16 - - 0 - 5 5 0 @@ -21000,17 +19707,14 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 27 27 - 27 27 27 - 27 27 27 - 27 5 5 @@ -21608,7 +20312,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 39 5 -5 42 +5 37 37 37 @@ -22734,19 +21438,17 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 0 -42 5 5 5 0 5 -14 15 42 +14 15 0 5 0 0 0 0 -42 5 14 5 5 14 @@ -22776,9 +21478,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 0 -14 15 42 +14 15 30 -8 42 +8 5 5 24 @@ -22844,7 +21546,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 15 0 -0 42 +0 23 5 5 @@ -23149,14 +21851,12 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -23262,8 +21962,6 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 0 18 0 -42 -42 0 12 35 @@ -23954,9 +22652,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - 27 - 27 @@ -23985,8 +22681,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 - - 0 0 0 @@ -23995,79 +22689,43 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - - 27 5 20 - - 5 0 0 27 27 - 27 27 27 - 27 - 5 5 5 0 0 - - - - - - - - - - - - - - 0 15 - 5 5 - 5 - 0 0 0 16 - 0 - 27 27 - 27 - - - - - - - - - 0 5 5 @@ -24095,50 +22753,29 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 20 - - 0 5 5 0 - - - 0 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - - - - - - - - - - 5 0 27 @@ -24149,7 +22786,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 - 0 16 16 @@ -24177,16 +22813,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 - - - - - - 27 27 - 27 0 5 @@ -24195,8 +22824,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 5 5 15 - - 0 5 0 @@ -24206,17 +22833,10 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 5 0 5 - - - - 5 16 - - 5 5 - 0 5 16 @@ -24236,7 +22856,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 5 0 - 0 0 15 @@ -24252,9 +22871,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - 27 - 5 5 5 @@ -24278,29 +22895,17 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 5 5 30 @@ -24328,29 +22933,23 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - 27 27 27 - 27 27 27 - 27 5 5 5 - 27 27 - - 27 5 0 @@ -24366,34 +22965,23 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 5 -42 5 0 0 -8 11 - - - -27 - -27 - -27 - -27 - +11 27 27 27 - - 27 +27 +27 +27 + +27 27 23 - - 0 @@ -24432,26 +23020,17 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 - 0 0 19 - 11 - 5 - - - - - - 5 @@ -24564,11 +23143,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 20 - - 20 - - 0 5 19 @@ -24584,7 +23159,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - 27 28 @@ -24592,10 +23166,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 16 15 - 0 - - 0 0 0 @@ -24626,11 +23197,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 14 16 5 - - - - - 5 0 0 @@ -24649,17 +23215,12 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - 27 - 5 5 5 0 5 - - - 8 8 8 @@ -24667,11 +23228,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 27 27 - 27 - - - 19 18 19 @@ -24685,8 +23242,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 5 - - 0 0 0 @@ -24697,34 +23252,24 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 5 33 - 0 0 5 - 27 27 - 27 - 15 - - 15 - - 27 27 - 27 - 16 16 5 @@ -24757,9 +23302,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 5 - - - 12 5 @@ -24794,8 +23336,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 5 - - 0 5 0 @@ -24815,93 +23355,48 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 - - - 5 5 16 - - 0 - - - 0 12 5 5 - - 5 5 5 5 5 - 16 0 0 - - 0 12 20 - - 20 - - - - 5 15 - - 0 - 16 - - - 15 - - - 0 15 - - 15 - - 0 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -24920,8 +23415,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 5 - - 0 5 0 @@ -24943,10 +23436,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 16 5 16 - - 0 - 5 5 0 @@ -24959,17 +23449,14 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 27 27 - 27 27 27 - 27 27 27 - 27 5 5 @@ -25567,7 +24054,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 39 5 -5 42 +5 37 37 37 @@ -26693,19 +25180,17 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 0 -42 5 5 5 0 5 -14 15 42 +14 15 0 5 0 0 0 0 -42 5 14 5 5 14 @@ -26735,9 +25220,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 0 -14 15 42 +14 15 30 -8 42 +8 5 5 24 @@ -26803,7 +25288,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 15 0 -0 42 +0 23 5 5 @@ -27108,14 +25593,12 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -27221,8 +25704,6 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 0 18 0 -42 -42 0 12 35 @@ -27917,8 +26398,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf - - 0 @@ -27944,8 +26423,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf - - 0 0 0 @@ -27955,12 +26432,8 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - - 5 20 - - 5 0 0 @@ -27968,7 +26441,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - 27 27 @@ -27976,57 +26448,26 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf - - 5 5 5 0 0 - - - - - - - - - - - - - - 0 15 - 5 5 - 5 - 0 0 0 16 - 0 - 27 27 - - - - - - - - - - 0 5 5 @@ -28054,50 +26495,29 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 20 - - 0 5 5 0 - - - 0 +27 - +27 27 27 - 27 27 -27 - -27 - - - 35 - - - - - - - - - - 5 0 27 @@ -28108,7 +26528,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf - 0 16 16 @@ -28136,17 +26555,10 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf - - - - - - 27 27 - 0 5 5 @@ -28154,8 +26566,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 5 15 - - 0 5 0 @@ -28165,17 +26575,10 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 5 0 5 - - - - 5 16 - - 5 5 - 0 5 16 @@ -28195,7 +26598,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 16 5 0 - 0 0 15 @@ -28212,8 +26614,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - - 5 5 5 @@ -28237,29 +26637,17 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 5 5 30 @@ -28288,29 +26676,23 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - 27 27 - 27 27 - 5 5 5 - 27 27 - - 5 0 5 @@ -28325,34 +26707,23 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 5 -42 5 0 0 -8 11 - +11 +27 +27 27 27 - - 27 27 - -27 - - -27 - - 23 - - 0 @@ -28391,26 +26762,17 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 30 30 - 0 0 19 - 11 - 5 - - - - - - 5 @@ -28523,11 +26885,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 20 - - 20 - - 0 5 19 @@ -28545,16 +26903,12 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - 28 5 16 16 15 - 0 - - 0 0 0 @@ -28585,11 +26939,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 14 16 5 - - - - - 5 0 0 @@ -28609,16 +26958,11 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - - 5 5 5 0 5 - - - 8 8 8 @@ -28627,10 +26971,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 27 - - - - 19 18 19 @@ -28644,8 +26984,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 5 - - 0 0 0 @@ -28656,34 +26994,24 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 33 - 0 0 5 - 27 27 - - 15 - - 15 - - 27 27 - - 16 16 5 @@ -28716,9 +27044,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 5 - - - 12 5 @@ -28753,8 +27078,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 5 - - 0 5 0 @@ -28774,93 +27097,48 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 16 - - - 5 5 16 - - 0 - - - 0 12 5 5 - - 5 5 5 5 5 - 16 0 0 - - 0 12 20 - - 20 - - - - 5 15 - - 0 - 16 - - - 15 - - - 0 15 - - 15 - - 0 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -28879,8 +27157,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 5 - - 0 5 0 @@ -28902,10 +27178,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 16 5 16 - - 0 - 5 5 0 @@ -28919,17 +27192,14 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 27 - 27 27 - 27 27 - 5 5 5 @@ -29526,7 +27796,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 39 5 -5 42 +5 37 37 @@ -30652,19 +28922,17 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 0 -42 5 5 5 0 5 -14 15 42 +14 15 0 5 0 0 0 0 -42 5 14 5 5 14 @@ -30694,9 +28962,9 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 0 -14 15 42 +14 15 30 -8 42 +8 5 5 24 @@ -30762,7 +29030,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 15 0 -0 42 +0 23 5 5 @@ -31067,14 +29335,12 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -31180,8 +29446,6 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf 0 18 0 -42 -42 0 12 35 @@ -31876,8 +30140,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi - - 0 @@ -31903,8 +30165,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi - - 0 0 0 @@ -31914,12 +30174,8 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - - 5 20 - - 5 0 0 @@ -31927,7 +30183,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - 27 27 @@ -31935,57 +30190,26 @@ mipsel-linux-gnueabi mips-linux-gnueabi - - 5 5 5 0 0 - - - - - - - - - - - - - - 0 15 - 5 5 - 5 - 0 0 0 16 - 0 - 27 27 - - - - - - - - - - 0 5 5 @@ -32013,50 +30237,29 @@ mipsel-linux-gnueabi mips-linux-gnueabi 20 - - 0 5 5 0 - - - 0 +27 - +27 27 27 - 27 27 -27 - -27 - - - 35 - - - - - - - - - - 5 0 27 @@ -32067,7 +30270,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi - 0 16 16 @@ -32095,17 +30297,10 @@ mipsel-linux-gnueabi mips-linux-gnueabi - - - - - - 27 27 - 0 5 5 @@ -32113,8 +30308,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 5 15 - - 0 5 0 @@ -32124,17 +30317,10 @@ mipsel-linux-gnueabi mips-linux-gnueabi 5 0 5 - - - - 5 16 - - 5 5 - 0 5 16 @@ -32154,7 +30340,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 16 5 0 - 0 0 15 @@ -32171,8 +30356,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - - 5 5 5 @@ -32196,29 +30379,17 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 5 5 30 @@ -32247,29 +30418,23 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - 27 27 - 27 27 - 5 5 5 - 27 27 - - 5 0 5 @@ -32284,34 +30449,23 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 5 -42 5 0 0 -8 11 - +11 +27 +27 27 27 - - 27 27 - -27 - - -27 - - 23 - - 0 @@ -32350,26 +30504,17 @@ mipsel-linux-gnueabi mips-linux-gnueabi - 0 0 19 - 11 - 5 - - - - - - 5 @@ -32482,11 +30627,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 20 - - 20 - - 0 5 19 @@ -32504,16 +30645,12 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - 28 5 16 16 15 - 0 - - 0 0 0 @@ -32544,11 +30681,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 14 16 5 - - - - - 5 0 0 @@ -32568,16 +30700,11 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - - 5 5 5 0 5 - - - 8 8 8 @@ -32586,10 +30713,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 27 - - - - 19 18 19 @@ -32603,8 +30726,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 5 - - 0 0 0 @@ -32615,34 +30736,24 @@ mipsel-linux-gnueabi mips-linux-gnueabi 33 - 0 0 5 - 27 27 - - 15 - - 15 - - 27 27 - - 16 16 5 @@ -32675,9 +30786,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 5 - - - 12 5 @@ -32712,8 +30820,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 5 - - 0 5 0 @@ -32733,93 +30839,48 @@ mipsel-linux-gnueabi mips-linux-gnueabi 16 - - - 5 5 16 - - 0 - - - 0 12 5 5 - - 5 5 5 5 5 - 16 0 0 - - 0 12 20 - - 20 - - - - 5 15 - - 0 - 16 - - - 15 - - - 0 15 - - 15 - - 0 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -32838,8 +30899,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 5 - - 0 5 0 @@ -32861,10 +30920,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 16 5 16 - - 0 - 5 5 0 @@ -32878,17 +30934,14 @@ mipsel-linux-gnueabi mips-linux-gnueabi 27 - 27 27 - 27 27 - 5 5 5 @@ -33485,7 +31538,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 39 5 -5 42 +5 37 37 @@ -34611,19 +32664,17 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 0 -42 5 5 5 0 5 -14 15 42 +14 15 0 5 0 0 0 0 -42 5 14 5 5 14 @@ -34653,9 +32704,9 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 0 -14 15 42 +14 15 30 -8 42 +8 5 5 24 @@ -34721,7 +32772,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 15 0 -0 42 +0 23 5 5 @@ -35026,14 +33077,12 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -35139,8 +33188,6 @@ mipsel-linux-gnueabi mips-linux-gnueabi 0 18 0 -42 -42 0 12 35 @@ -35831,9 +33878,7 @@ x86_64-linux-gnu 27 36 27 - 27 - 27 @@ -35862,8 +33907,6 @@ x86_64-linux-gnu 10 - - 10 10 10 @@ -35872,79 +33915,43 @@ x86_64-linux-gnu 27 36 27 - - 27 10 20 - - 10 10 10 27 36 27 - 27 27 36 27 - 27 - 10 10 10 10 10 - - - - - - - - - - - - - - 10 15 - 10 10 - 10 - 10 10 10 16 - 10 - 27 36 27 - 27 - - - - - - - - - 10 10 10 @@ -35972,50 +33979,29 @@ x86_64-linux-gnu 20 - - 10 10 10 10 - - - 10 - - - 27 36 27 - 27 27 36 27 - 27 27 36 27 - 27 35 - - - - - - - - - - 10 10 27 @@ -36025,7 +34011,6 @@ x86_64-linux-gnu - 25 10 16 @@ -36054,16 +34039,9 @@ x86_64-linux-gnu - - - - - - 27 36 27 - 27 10 10 @@ -36072,8 +34050,6 @@ x86_64-linux-gnu 10 10 15 - - 10 10 @@ -36083,17 +34059,10 @@ x86_64-linux-gnu 10 10 10 - - - - 10 16 - - 10 10 - 10 10 16 @@ -36113,7 +34082,6 @@ x86_64-linux-gnu 16 10 10 - 10 10 15 @@ -36129,9 +34097,7 @@ x86_64-linux-gnu 27 36 27 - 27 - 10 10 10 @@ -36155,29 +34121,17 @@ x86_64-linux-gnu 36 10 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 10 10 30 @@ -36205,29 +34159,23 @@ x86_64-linux-gnu 27 36 27 - 27 27 36 27 - 27 27 36 27 - 27 10 10 10 - 27 36 27 - - 27 10 10 @@ -36243,34 +34191,23 @@ x86_64-linux-gnu 10 10 10 -42 10 10 10 11 - - - 27 36 27 - 27 - 27 36 27 - 27 27 - 36 27 - 27 23 - - 10 @@ -36309,26 +34246,17 @@ x86_64-linux-gnu - 10 10 19 - 11 - 10 - - - - - - 10 @@ -36441,11 +34369,7 @@ x86_64-linux-gnu 10 10 20 - - 20 - - 10 10 19 @@ -36461,7 +34385,6 @@ x86_64-linux-gnu 27 36 27 - 27 28 @@ -36469,10 +34392,7 @@ x86_64-linux-gnu 16 16 15 - 10 - - 10 10 10 @@ -36503,11 +34423,6 @@ x86_64-linux-gnu 14 16 10 - - - - - 10 10 10 @@ -36526,17 +34441,12 @@ x86_64-linux-gnu 27 36 27 - 27 - 10 10 10 10 10 - - - 10 10 10 @@ -36544,11 +34454,7 @@ x86_64-linux-gnu 10 27 27 - 27 - - - 19 18 19 @@ -36562,8 +34468,6 @@ x86_64-linux-gnu 10 10 10 - - 10 10 10 @@ -36574,34 +34478,24 @@ x86_64-linux-gnu 36 10 33 - 10 10 10 - 27 36 27 - 27 - 15 - - 15 - - 27 36 27 - 27 - 16 10 @@ -36634,9 +34528,6 @@ x86_64-linux-gnu 10 10 10 - - - 12 10 @@ -36671,8 +34562,6 @@ x86_64-linux-gnu 36 10 10 - - 10 10 10 @@ -36692,93 +34581,48 @@ x86_64-linux-gnu 16 - - - 10 10 16 - - 10 - - - 10 12 10 10 - - 10 10 10 10 10 - 16 10 10 - - 10 12 20 - - 20 - - - - 10 15 - - 10 - 16 - - - 15 - - - 10 15 - - 15 - - 10 - 16 - - - 16 - - - - 16 - - - 10 10 - - 16 16 16 @@ -36797,8 +34641,6 @@ x86_64-linux-gnu 36 10 10 - - 10 10 10 @@ -36820,10 +34662,7 @@ x86_64-linux-gnu 16 10 16 - - 10 - 10 10 10 @@ -36836,17 +34675,14 @@ x86_64-linux-gnu 27 36 27 - 27 27 36 27 - 27 27 36 27 - 27 10 10 @@ -37444,7 +35280,7 @@ x86_64-linux-gnu 10 10 39 10 -10 42 +10 36 37 37 @@ -38570,19 +36406,17 @@ x86_64-linux-gnu 10 10 10 -42 10 10 10 10 -14 15 42 +14 15 10 10 10 10 10 10 -42 10 10 10 @@ -38612,9 +36446,9 @@ x86_64-linux-gnu 10 10 10 -14 15 42 +14 15 30 -10 42 +10 10 10 24 @@ -38680,7 +36514,7 @@ x86_64-linux-gnu 10 15 10 -10 42 +10 23 10 10 @@ -38985,14 +36819,12 @@ x86_64-linux-gnu 10 10 10 -42 10 10 10 10 10 10 -42 10 10 10 @@ -39098,8 +36930,6 @@ x86_64-linux-gnu 10 18 10 -42 -42 10 12 35 @@ -39790,9 +37620,7 @@ x86_64-linux-gnux32 28 36 28 - 28 - 28 @@ -39821,8 +37649,6 @@ x86_64-linux-gnux32 28 - - 28 28 28 @@ -39831,12 +37657,35 @@ x86_64-linux-gnux32 28 36 28 +28 +28 +28 +28 +28 +28 +28 +36 +28 +28 +28 +36 +28 +28 + 28 28 28 - +28 +28 +28 +28 +28 +28 +28 +28 +28 28 28 @@ -39844,66 +37693,7 @@ x86_64-linux-gnux32 28 36 28 - 28 -28 -36 -28 - -28 - - - - -28 -28 -28 -28 -28 - - - - - - - - - - - - - - -28 -28 - -28 -28 - -28 - -28 -28 - -28 -28 - -28 - -28 -36 -28 - -28 - - - - - - - - - @@ -39931,50 +37721,29 @@ x86_64-linux-gnux32 28 - - 28 28 28 28 - - - -28 - - - -28 -36 -28 - 28 28 36 28 - 28 28 36 28 - +28 +28 +36 +28 28 35 - - - - - - - - - - 28 28 28 @@ -39984,7 +37753,6 @@ x86_64-linux-gnux32 - 28 28 28 @@ -40013,16 +37781,9 @@ x86_64-linux-gnux32 - - - - - - 28 36 28 - 28 28 28 @@ -40031,8 +37792,6 @@ x86_64-linux-gnux32 28 28 28 - - 28 28 @@ -40042,17 +37801,10 @@ x86_64-linux-gnux32 28 28 28 - - - - 28 28 - - 28 28 - 28 28 28 @@ -40072,7 +37824,6 @@ x86_64-linux-gnux32 28 28 28 - 28 28 28 @@ -40088,9 +37839,7 @@ x86_64-linux-gnux32 28 36 28 - 28 - 28 28 28 @@ -40114,29 +37863,17 @@ x86_64-linux-gnux32 36 28 28 - 28 - 28 - 28 - 28 - 28 - 28 - 28 - 28 - 28 - 28 - 28 - 28 28 30 @@ -40164,29 +37901,23 @@ x86_64-linux-gnux32 28 36 28 - 28 28 36 28 - 28 28 36 28 - 28 28 28 28 - 28 36 28 - - 28 28 28 @@ -40202,34 +37933,23 @@ x86_64-linux-gnux32 28 28 28 -42 28 28 28 - - - -28 -36 -28 - -28 - 28 36 28 - 28 28 - 36 28 - 28 28 - - +36 +28 +28 +28 28 @@ -40268,26 +37988,17 @@ x86_64-linux-gnux32 - 28 28 28 - 28 - 28 - - - - - - 28 @@ -40400,11 +38111,7 @@ x86_64-linux-gnux32 28 28 28 - - 28 - - 28 28 28 @@ -40420,7 +38127,6 @@ x86_64-linux-gnux32 28 36 28 - 28 28 @@ -40428,10 +38134,6 @@ x86_64-linux-gnux32 28 28 28 - -28 - - 28 28 28 @@ -40462,11 +38164,7 @@ x86_64-linux-gnux32 28 28 28 - - - - - +28 28 28 28 @@ -40485,29 +38183,6 @@ x86_64-linux-gnux32 28 36 28 - -28 - -28 -28 -28 -28 -28 - - - -28 -28 -28 -28 -28 -28 -28 - -28 - - - 28 28 28 @@ -40521,8 +38196,20 @@ x86_64-linux-gnux32 28 28 28 - - +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 28 28 28 @@ -40533,34 +38220,24 @@ x86_64-linux-gnux32 36 28 33 - 28 28 28 - 28 36 28 - 28 - 28 - - 28 - - 28 36 28 - 28 - 28 28 @@ -40593,9 +38270,6 @@ x86_64-linux-gnux32 28 28 28 - - - 28 28 @@ -40630,8 +38304,6 @@ x86_64-linux-gnux32 36 28 28 - - 28 28 28 @@ -40651,22 +38323,10 @@ x86_64-linux-gnux32 28 - - - 28 28 - - 28 - - - -28 -28 - - 28 28 @@ -40676,28 +38336,9 @@ x86_64-linux-gnux32 28 28 28 - - 28 28 - -28 - - - -28 - - -28 -28 - - -28 - - - - 28 28 @@ -40707,37 +38348,23 @@ x86_64-linux-gnux32 28 - -28 - - - 28 28 - - -28 - - -28 - -28 - - - -28 - - - - -28 - - - 28 28 - - +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 +28 28 28 28 @@ -40756,8 +38383,6 @@ x86_64-linux-gnux32 36 28 28 - - 28 28 28 @@ -40779,10 +38404,7 @@ x86_64-linux-gnux32 28 28 28 - - 28 - 28 28 28 @@ -40795,17 +38417,14 @@ x86_64-linux-gnux32 28 36 28 - 28 28 36 28 - 28 28 36 28 - 28 28 28 @@ -41403,7 +39022,7 @@ x86_64-linux-gnux32 28 28 39 28 -28 42 +28 36 37 37 @@ -42529,19 +40148,17 @@ x86_64-linux-gnux32 28 28 28 -42 -28 -28 -28 -28 -28 42 28 28 28 28 28 28 -42 +28 +28 +28 +28 +28 28 28 28 @@ -42571,9 +40188,9 @@ x86_64-linux-gnux32 28 28 28 -28 42 +28 30 -28 42 +28 28 28 28 @@ -42639,7 +40256,7 @@ x86_64-linux-gnux32 28 28 28 -28 42 +28 28 28 28 @@ -42944,14 +40561,12 @@ x86_64-linux-gnux32 28 28 28 -42 28 28 28 28 28 28 -42 28 28 28 @@ -43057,8 +40672,6 @@ x86_64-linux-gnux32 28 28 28 -42 -42 28 28 35 @@ -43749,9 +41362,7 @@ i386-linux-gnu 27 36 27 - 27 - 27 @@ -43780,8 +41391,6 @@ i386-linux-gnu - - 0 0 0 @@ -43790,79 +41399,43 @@ i386-linux-gnu 27 36 27 - - 27 1 20 - - 5 0 0 27 36 27 - 27 27 36 27 - 27 - 1 1 1 0 0 - - - - - - - - - - - - - - 0 15 - 1 1 - 1 - 0 0 0 16 - 0 - 27 36 27 - 27 - - - - - - - - - 0 5 5 @@ -43890,50 +41463,29 @@ i386-linux-gnu 0 20 - - 0 1 5 0 - - - 0 - - - 27 36 27 - 27 27 36 27 - 27 27 36 27 - 5 27 35 - 5 - - - - - - - - - 5 0 27 @@ -43943,7 +41495,6 @@ i386-linux-gnu - 25 0 16 @@ -43972,16 +41523,9 @@ i386-linux-gnu - - - - - - 27 36 27 - 27 0 1 @@ -43990,8 +41534,6 @@ i386-linux-gnu 1 5 15 - - 0 5 0 @@ -44001,17 +41543,10 @@ i386-linux-gnu 5 0 1 - - - - 5 16 - - 5 5 - 0 1 5 16 @@ -44031,7 +41566,6 @@ i386-linux-gnu 16 5 0 - 0 0 15 @@ -44047,9 +41581,7 @@ i386-linux-gnu 27 36 27 - 27 - 1 1 1 @@ -44073,29 +41605,17 @@ i386-linux-gnu 36 0 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 1 1 30 @@ -44123,29 +41643,23 @@ i386-linux-gnu 27 36 27 - 27 27 36 27 - 27 27 36 27 - 27 1 1 1 - 27 36 27 - - 27 1 0 @@ -44161,34 +41675,23 @@ i386-linux-gnu 0 0 1 -42 1 0 0 -3 8 11 - - - +3 11 27 36 27 - 27 - 27 36 27 - 27 27 - 36 27 - 27 23 - - 0 @@ -44227,26 +41730,17 @@ i386-linux-gnu 0 - 0 0 19 - 11 - 1 - - - - - - 5 @@ -44359,11 +41853,7 @@ i386-linux-gnu 0 0 20 - - 20 - - 0 5 19 @@ -44379,7 +41869,6 @@ i386-linux-gnu 27 36 27 - 27 28 @@ -44387,10 +41876,7 @@ i386-linux-gnu 16 16 15 - 0 - - 0 0 0 @@ -44421,11 +41907,6 @@ i386-linux-gnu 14 16 1 5 - - - - - 1 0 0 @@ -44444,17 +41925,12 @@ i386-linux-gnu 27 36 27 - 27 - 5 5 5 0 5 - - - 8 8 8 @@ -44462,11 +41938,7 @@ i386-linux-gnu 0 27 27 - 27 - - - 19 18 19 @@ -44480,8 +41952,6 @@ i386-linux-gnu 0 0 5 - - 0 0 0 @@ -44492,34 +41962,24 @@ i386-linux-gnu 36 1 33 - 0 0 4 - 27 36 27 - 27 - 15 - - 15 - - 27 36 27 - 27 - 16 5 @@ -44552,9 +42012,6 @@ i386-linux-gnu 0 0 1 - - - 12 2 1 @@ -44589,8 +42046,6 @@ i386-linux-gnu 36 0 1 - - 0 2 0 @@ -44610,93 +42065,48 @@ i386-linux-gnu 16 - - - 5 5 16 - - 0 - - - 0 12 1 1 - - 1 1 1 1 1 - 16 0 0 0 - - 0 0 12 20 - - 20 - - - - 3 15 - - 0 - 16 - - - 15 - - - 0 15 - - 15 - - 0 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -44715,8 +42125,6 @@ i386-linux-gnu 36 0 1 - - 0 1 0 @@ -44738,10 +42146,7 @@ i386-linux-gnu 16 5 16 - - 0 - 5 5 0 @@ -44754,17 +42159,14 @@ i386-linux-gnu 27 36 27 - 27 27 36 27 - 27 27 36 27 - 27 1 1 @@ -45362,7 +42764,7 @@ i386-linux-gnu 0 0 39 1 -1 42 +1 36 37 37 @@ -46488,19 +43890,17 @@ i386-linux-gnu 0 0 0 -42 5 1 1 0 1 -14 15 42 +14 15 0 1 0 0 0 0 -42 5 1 1 @@ -46530,9 +43930,9 @@ i386-linux-gnu 0 0 0 -14 15 42 +14 15 30 -8 42 +8 1 5 24 @@ -46598,7 +43998,7 @@ i386-linux-gnu 0 15 0 -0 42 +0 23 5 5 @@ -46903,14 +44303,12 @@ i386-linux-gnu 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -47016,8 +44414,6 @@ i386-linux-gnu 0 18 0 -42 -42 0 12 35 @@ -47708,9 +45104,7 @@ powerpc64le-linux-gnu 29 36 29 -42 29 -42 29 @@ -47739,8 +45133,6 @@ powerpc64le-linux-gnu -42 -42 29 29 29 @@ -47749,27 +45141,20 @@ powerpc64le-linux-gnu 29 36 29 -42 -42 29 29 29 -42 -42 29 29 29 29 36 29 -42 29 29 36 29 -42 29 -42 @@ -47778,50 +45163,21 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 29 29 -42 29 29 -42 29 -42 29 29 29 29 -42 29 -42 29 36 29 -42 29 -42 -42 -42 -42 -42 -42 -42 -42 -42 @@ -47849,55 +45205,33 @@ powerpc64le-linux-gnu 29 -42 -42 29 29 29 29 -42 -42 -42 -29 -42 -42 -42 -29 -36 -29 -42 29 29 36 29 -42 29 29 36 29 -42 +29 +29 +36 +29 29 35 -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 29 29 29 29 -42 29 35 29 @@ -47930,17 +45264,10 @@ powerpc64le-linux-gnu -42 -42 -42 -42 -42 -42 29 36 29 -42 29 29 29 @@ -47949,8 +45276,6 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 29 29 @@ -47960,17 +45285,10 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 -42 -42 29 29 -42 -42 29 29 -42 29 29 29 @@ -47990,7 +45308,6 @@ powerpc64le-linux-gnu 29 29 29 -42 29 29 29 @@ -48006,9 +45323,7 @@ powerpc64le-linux-gnu 29 36 29 -42 29 -42 29 29 29 @@ -48032,29 +45347,17 @@ powerpc64le-linux-gnu 36 29 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 -42 29 29 30 @@ -48082,29 +45385,23 @@ powerpc64le-linux-gnu 29 36 29 -42 29 29 36 29 -42 29 29 36 29 -42 29 29 29 29 -42 29 36 29 -42 -42 29 29 29 @@ -48120,34 +45417,23 @@ powerpc64le-linux-gnu 29 29 29 -42 29 29 29 -42 -42 -42 29 36 29 -42 29 -42 29 36 29 -42 29 29 -42 36 29 -42 29 29 -42 -42 29 @@ -48186,26 +45472,17 @@ powerpc64le-linux-gnu -42 29 29 29 -42 29 -42 29 -42 -42 -42 -42 -42 -42 29 29 29 @@ -48318,11 +45595,7 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 29 -42 -42 29 29 29 @@ -48338,18 +45611,6 @@ powerpc64le-linux-gnu 29 36 29 -42 -29 -29 -29 -29 -29 -29 -29 -42 -29 -42 -42 29 29 29 @@ -48380,11 +45641,14 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 -42 -42 -42 +29 +29 +29 +29 +29 +29 +29 +29 29 29 29 @@ -48403,17 +45667,6 @@ powerpc64le-linux-gnu 29 36 29 -42 -29 -42 -29 -29 -29 -29 -29 -42 -42 -42 29 29 29 @@ -48421,11 +45674,13 @@ powerpc64le-linux-gnu 29 29 29 -42 29 -42 -42 -42 +29 +29 +29 +29 +29 +29 29 29 29 @@ -48439,8 +45694,6 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 29 29 29 @@ -48451,34 +45704,24 @@ powerpc64le-linux-gnu 36 29 33 -42 29 29 29 -42 29 36 29 -42 29 -42 29 -42 -42 29 -42 -42 29 36 29 -42 29 -42 29 29 @@ -48511,9 +45754,6 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 -42 29 29 @@ -48548,8 +45788,6 @@ powerpc64le-linux-gnu 36 29 29 -42 -42 29 29 29 @@ -48569,93 +45807,48 @@ powerpc64le-linux-gnu 29 -42 -42 -42 29 29 29 -42 -42 29 -42 -42 -42 29 29 32 29 29 -42 -42 29 29 29 29 29 -42 29 29 29 -42 -42 29 29 29 -42 -42 -29 -42 -42 -42 -42 29 29 -42 -42 -29 -42 -29 -42 -42 -42 -29 -42 -42 -42 29 29 -42 -42 -29 -42 -42 -29 -42 -29 -42 -42 -42 -29 -42 -42 -42 -42 -29 -42 -42 -42 29 29 -42 -42 +29 +29 +29 +29 +29 +29 +29 +29 +29 29 29 29 @@ -48674,8 +45867,6 @@ powerpc64le-linux-gnu 36 29 29 -42 -42 29 29 29 @@ -48697,10 +45888,7 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 29 -42 29 29 29 @@ -48713,17 +45901,14 @@ powerpc64le-linux-gnu 29 36 29 -42 29 29 36 29 -42 29 29 36 29 -42 29 29 29 @@ -49321,7 +46506,7 @@ powerpc64le-linux-gnu 29 29 39 29 -29 42 +29 36 37 37 @@ -50447,19 +47632,17 @@ powerpc64le-linux-gnu 29 29 29 -42 -29 -29 -29 -29 -29 42 29 29 29 29 29 29 -42 +29 +29 +29 +29 +29 29 29 29 @@ -50489,9 +47672,9 @@ powerpc64le-linux-gnu 29 29 29 -29 42 +29 30 -29 42 +29 29 29 29 @@ -50557,7 +47740,7 @@ powerpc64le-linux-gnu 29 29 29 -29 42 +29 29 29 29 @@ -50862,14 +48045,12 @@ powerpc64le-linux-gnu 29 29 29 -42 29 29 29 29 29 29 -42 29 29 29 @@ -50975,8 +48156,6 @@ powerpc64le-linux-gnu 29 29 29 -42 -42 29 29 35 @@ -51667,9 +48846,7 @@ powerpc64-linux-gnu 27 27 - 27 - 27 @@ -51698,8 +48875,6 @@ powerpc64-linux-gnu - - 12 12 12 @@ -51708,83 +48883,47 @@ powerpc64-linux-gnu 27 27 - - 27 12 16 20 - - 12 12 12 27 27 - 27 27 27 - 27 - 12 12 12 12 12 - - - - - - - - - - - - - - 12 15 - 12 12 - 12 16 - 12 12 12 16 - 12 - 27 27 - 27 - - - - - - - - - 12 12 @@ -51808,55 +48947,33 @@ powerpc64-linux-gnu 20 - - 12 12 12 12 - - - 12 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - - - - - - - - - - 12 12 27 27 - 12 35 12 @@ -51890,16 +49007,9 @@ powerpc64-linux-gnu - - - - - - 27 27 - 27 12 12 @@ -51908,8 +49018,6 @@ powerpc64-linux-gnu 16 12 15 16 - - 12 12 @@ -51919,17 +49027,10 @@ powerpc64-linux-gnu 12 12 12 - - - - 12 16 - - 12 12 - 12 12 16 @@ -51949,7 +49050,6 @@ powerpc64-linux-gnu 16 12 12 - 12 12 15 @@ -51965,9 +49065,7 @@ powerpc64-linux-gnu 27 27 - 27 - 12 12 12 @@ -51991,29 +49089,17 @@ powerpc64-linux-gnu 12 16 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 12 12 30 @@ -52041,29 +49127,23 @@ powerpc64-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 12 12 12 - 27 27 - - 27 12 12 @@ -52079,34 +49159,23 @@ powerpc64-linux-gnu 12 12 12 -42 12 12 12 - - - -27 - -27 - -27 - -27 - 27 27 27 - - 27 +27 +27 +27 + +27 27 23 - - 12 @@ -52145,26 +49214,17 @@ powerpc64-linux-gnu - 12 12 19 - 12 - 12 - - - - - - 12 16 16 @@ -52277,11 +49337,7 @@ powerpc64-linux-gnu 12 12 20 - - 20 - - 12 12 19 @@ -52297,7 +49353,6 @@ powerpc64-linux-gnu 27 27 - 27 29 28 @@ -52305,10 +49360,7 @@ powerpc64-linux-gnu 16 16 15 16 - 12 16 - - 12 12 12 @@ -52339,11 +49391,6 @@ powerpc64-linux-gnu 14 16 12 - - - - - 12 12 12 @@ -52362,17 +49409,12 @@ powerpc64-linux-gnu 27 27 - 27 - 12 12 12 12 12 - - - 12 12 12 @@ -52380,11 +49422,7 @@ powerpc64-linux-gnu 12 27 27 - 27 - - - 19 18 19 @@ -52398,8 +49436,6 @@ powerpc64-linux-gnu 12 12 12 - - 12 12 12 @@ -52410,34 +49446,24 @@ powerpc64-linux-gnu 16 33 - 12 12 15 12 - 27 27 - 27 - 15 16 - - 15 16 - - 27 27 - 27 - 16 12 @@ -52470,9 +49496,6 @@ powerpc64-linux-gnu 12 12 12 16 - - - 12 12 @@ -52507,8 +49530,6 @@ powerpc64-linux-gnu 12 12 - - 12 12 12 @@ -52528,93 +49549,48 @@ powerpc64-linux-gnu 16 - - - 12 12 16 - - 12 - - - 12 12 32 12 12 - - 12 12 12 12 12 - 16 12 12 - - 12 12 20 - - 20 - - - - 12 15 16 - - 12 16 - 16 - - - 15 16 - - - 12 16 15 16 - - 15 16 - - 12 16 - 16 - - - 16 - - - - 16 - - - 12 12 - - 16 16 16 @@ -52633,8 +49609,6 @@ powerpc64-linux-gnu 12 12 - - 12 12 12 16 @@ -52656,10 +49630,7 @@ powerpc64-linux-gnu 16 12 16 - - 12 - 12 12 12 @@ -52672,17 +49643,14 @@ powerpc64-linux-gnu 27 27 - 27 27 27 - 27 27 27 - 27 12 12 @@ -53280,7 +50248,7 @@ powerpc64-linux-gnu 12 39 12 12 -12 42 +12 37 37 @@ -54406,19 +51374,17 @@ powerpc64-linux-gnu 12 12 12 -42 12 12 12 12 -14 15 42 +14 15 12 12 12 12 12 12 -42 12 18 12 12 18 @@ -54448,9 +51414,9 @@ powerpc64-linux-gnu 12 12 12 -14 15 42 +14 15 30 -12 42 +12 12 12 24 @@ -54516,7 +51482,7 @@ powerpc64-linux-gnu 12 15 12 -12 42 +12 23 12 12 @@ -54821,14 +51787,12 @@ powerpc64-linux-gnu 12 12 12 -42 12 12 12 12 12 12 -42 12 12 12 @@ -54934,8 +51898,6 @@ powerpc64-linux-gnu 12 18 12 -42 -42 12 16 12 16 35 @@ -55626,9 +52588,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - 27 - 27 13 13 @@ -55657,8 +52617,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf - - 0 0 0 @@ -55667,27 +52625,20 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - - 27 1 16 20 - - 5 0 0 27 27 - 27 27 27 - 27 - 31 31 31 @@ -55696,50 +52647,21 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 1 0 0 - - - - - - - - - - - - - - 0 15 - 1 1 - 1 16 - 0 0 0 0 16 - 0 - 27 27 - 27 - - - - - - - - - 0 5 5 @@ -55767,55 +52689,33 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 13 20 - - 0 1 5 0 13 13 - - - 0 - - - 27 27 - 27 27 27 - 27 27 27 - 27 35 - 13 - - - - - - - - - 5 0 27 27 - 1 35 1 @@ -55848,17 +52748,10 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 16 16 - 31 - - - - - 27 27 - 27 0 1 @@ -55867,8 +52760,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 5 15 16 - - 0 5 0 @@ -55878,17 +52769,10 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 5 0 1 - - - - 5 16 - - 5 5 - 0 1 5 16 @@ -55908,7 +52792,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 5 0 - 0 0 15 @@ -55924,9 +52807,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - 27 - 1 1 1 @@ -55950,29 +52831,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 16 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 19 - 1 1 30 @@ -56000,29 +52869,23 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - 27 27 27 - 27 27 27 - 27 1 1 1 - 13 13 27 27 - - 27 1 0 @@ -56038,34 +52901,23 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 1 -42 1 0 0 -3 8 11 - - - -27 - -27 - -27 - -27 - +3 11 27 27 27 - - 27 +27 +27 +27 + +27 27 23 - - 0 0 16 @@ -56104,26 +52956,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 - 0 0 19 13 13 - 11 - 16 13 13 16 1 - - - - - - 5 16 16 @@ -56236,11 +53079,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 20 - - 20 - - 0 5 19 @@ -56256,7 +53095,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - 27 29 28 @@ -56264,10 +53102,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 16 15 16 - 0 16 - - 0 0 0 @@ -56298,11 +53133,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 14 16 1 5 - - - - - 1 0 0 @@ -56321,17 +53151,12 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - 27 - 5 5 5 0 5 - - - 8 8 8 @@ -56339,11 +53164,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 27 27 - 27 - - - 19 18 19 @@ -56357,8 +53178,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 5 - - 0 0 0 @@ -56369,34 +53188,24 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 33 - 0 0 15 4 13 13 13 - 27 27 - 27 - 15 16 - - 15 16 - - 27 13 27 - 27 13 - 16 5 @@ -56429,9 +53238,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 1 16 - - - 12 1 @@ -56466,8 +53272,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 1 - - 0 2 0 @@ -56487,93 +53291,48 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 13 13 16 - - - 5 5 16 - - 0 - - - 0 12 32 1 1 - - 1 1 1 1 1 13 - 16 0 0 0 0 - - 0 0 16 16 12 20 - - 20 - - - - 3 15 16 - - 0 16 - 16 - - - 15 16 - - - 0 16 15 16 - - 15 16 - - 0 16 - 16 - - - 16 - - - - 16 - - - 0 0 - - 16 16 16 @@ -56592,8 +53351,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 1 - - 0 1 0 16 @@ -56615,10 +53372,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 16 5 16 - - 0 - 5 5 0 @@ -56631,17 +53385,14 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 27 27 - 27 27 27 - 27 27 27 - 27 1 1 @@ -57239,7 +53990,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 39 1 -1 42 +1 37 37 @@ -58365,19 +55116,17 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 0 -42 5 1 1 0 1 -14 15 42 +14 15 0 1 0 0 0 0 -42 5 18 1 1 18 @@ -58407,9 +55156,9 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 0 -14 15 42 +14 15 30 -8 42 +8 1 5 24 @@ -58475,7 +55224,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 15 0 -0 42 +0 23 5 5 @@ -58780,14 +55529,12 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 0 0 -42 0 0 0 0 0 0 -42 0 0 0 @@ -58893,8 +55640,6 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf 0 18 0 -42 -42 0 16 12 16 35 diff --git a/lib/libc/glibc/fns.txt b/lib/libc/glibc/fns.txt index 5d274d178e..a1dd9b18e1 100644 --- a/lib/libc/glibc/fns.txt +++ b/lib/libc/glibc/fns.txt @@ -199,9 +199,7 @@ __acosf_finite m __acosh_finite m __acoshf128_finite m __acoshf_finite m -__acoshieee128 m __acoshl_finite m -__acosieee128 m __acosl_finite m __adddf3 c __addsf3 c @@ -230,8 +228,6 @@ __align_cpy_2 c __align_cpy_4 c __align_cpy_8 c __arch_prctl c -__argp_errorieee128 c -__argp_failureieee128 c __argz_count c __argz_next c __argz_stringify c @@ -240,27 +236,20 @@ __ashrdi3 c __asin_finite m __asinf128_finite m __asinf_finite m -__asinhieee128 m -__asinieee128 m __asinl_finite m __asprintf c __asprintf_chk c -__asprintf_chkieee128 c -__asprintfieee128 c __assert c __assert_fail c __assert_perror_fail c __atan2_finite m __atan2f128_finite m __atan2f_finite m -__atan2ieee128 m __atan2l_finite m __atanh_finite m __atanhf128_finite m __atanhf_finite m -__atanhieee128 m __atanhl_finite m -__atanieee128 m __atomic_feclearexcept c __atomic_feholdexcept c __atomic_feupdateenv c @@ -269,50 +258,21 @@ __backtrace_symbols c __backtrace_symbols_fd c __bsd_getpgrp c __bzero c -__cabsieee128 m -__cacoshieee128 m -__cacosieee128 m -__canonicalizeieee128 m -__cargieee128 m -__casinhieee128 m -__casinieee128 m -__catanhieee128 m -__catanieee128 m -__cbrtieee128 m -__ccoshieee128 m -__ccosieee128 m -__ceilieee128 m -__cexpieee128 m __check_rhosts_file c __chk_fail c -__cimagieee128 m __clog10 m __clog10f m -__clog10ieee128 m __clog10l m -__clogieee128 m __clone c __close c __cmpdi2 c __cmsg_nxthdr c __confstr_chk c -__conjieee128 m __connect c -__copysignieee128 m __cosh_finite m __coshf128_finite m __coshf_finite m -__coshieee128 m __coshl_finite m -__cosieee128 m -__cpowieee128 m -__cprojieee128 m -__crealieee128 m -__csinhieee128 m -__csinieee128 m -__csqrtieee128 m -__ctanhieee128 m -__ctanieee128 m __ctype32_b c __ctype32_tolower c __ctype32_toupper c @@ -340,55 +300,33 @@ __divdf3 c __divdi3 c __divsf3 c __dprintf_chk c -__dprintf_chkieee128 c -__dprintfieee128 c __dup2 c __duplocale c __endmntent c __environ c __eqdf2 c __eqsf2 c -__erfcieee128 m -__erfieee128 m -__errieee128 c __errno_location c -__error_at_lineieee128 c -__errorieee128 c -__errxieee128 c __exp10_finite m __exp10f128_finite m __exp10f_finite m -__exp10ieee128 m __exp10l_finite m __exp2_finite m __exp2f128_finite m __exp2f_finite m -__exp2ieee128 m __exp2l_finite m __exp_finite m __expf128_finite m __expf_finite m -__expieee128 m __expl m __expl_finite m __explicit_bzero_chk c -__expm1ieee128 m __expm1l m __extendsfdf2 c -__f32addieee128 m -__f32divieee128 m -__f32mulieee128 m -__f32subieee128 m -__f64addieee128 m -__f64divieee128 m -__f64mulieee128 m -__f64subieee128 m -__fabsieee128 m __fbufsize c __fcntl c __fdelt_chk c __fdelt_warn c -__fdimieee128 m __fe_dfl_env m __fe_dfl_mode m __fe_enabled_env m @@ -421,17 +359,10 @@ __floatundidf c __floatundisf c __floatunsidf c __floatunsisf c -__floorieee128 m __flt_rounds c -__fmaieee128 m -__fmaxieee128 m -__fmaxmagieee128 m -__fminieee128 m -__fminmagieee128 m __fmod_finite m __fmodf128_finite m __fmodf_finite m -__fmodieee128 m __fmodl_finite m __fork c __fpclassify m @@ -440,8 +371,6 @@ __fpclassifyf128 m __fpclassifyl m __fpending c __fprintf_chk c -__fprintf_chkieee128 c -__fprintfieee128 c __fpu_control c __fpurge c __frame_state_for c @@ -451,17 +380,10 @@ __freadable c __freading c __free_hook c __freelocale c -__frexpieee128 m -__fromfpieee128 m -__fromfpxieee128 m -__fscanfieee128 c __fsetlocking c __fwprintf_chk c -__fwprintf_chkieee128 c -__fwprintfieee128 c __fwritable c __fwriting c -__fwscanfieee128 c __fxstat c __fxstat64 c __fxstatat c @@ -481,7 +403,6 @@ __gethostname_chk c __getlogin_r_chk c __getmntent_r c __getpagesize c -__getpayloadieee128 m __getpgid c __getpid c __gets_chk c @@ -497,9 +418,7 @@ __h_errno_location c __hypot_finite m __hypotf128_finite m __hypotf_finite m -__hypotieee128 m __hypotl_finite m -__ilogbieee128 m __isalnum_l c __isalpha_l c __isascii_l c @@ -523,29 +442,17 @@ __isnanf c __isnanf128 m __isnanl c __isoc99_fscanf c -__isoc99_fscanfieee128 c __isoc99_fwscanf c -__isoc99_fwscanfieee128 c __isoc99_scanf c -__isoc99_scanfieee128 c __isoc99_sscanf c -__isoc99_sscanfieee128 c __isoc99_swscanf c -__isoc99_swscanfieee128 c __isoc99_vfscanf c -__isoc99_vfscanfieee128 c __isoc99_vfwscanf c -__isoc99_vfwscanfieee128 c __isoc99_vscanf c -__isoc99_vscanfieee128 c __isoc99_vsscanf c -__isoc99_vsscanfieee128 c __isoc99_vswscanf c -__isoc99_vswscanfieee128 c __isoc99_vwscanf c -__isoc99_vwscanfieee128 c __isoc99_wscanf c -__isoc99_wscanfieee128 c __isprint_l c __ispunct_l c __issignaling m @@ -573,29 +480,23 @@ __ivaliduser c __j0_finite m __j0f128_finite m __j0f_finite m -__j0ieee128 m __j0l_finite m __j1_finite m __j1f128_finite m __j1f_finite m -__j1ieee128 m __j1l_finite m __jn_finite m __jnf128_finite m __jnf_finite m -__jnieee128 m __jnl_finite m __key_decryptsession_pk_LOCAL c __key_encryptsession_pk_LOCAL c __key_gendes_LOCAL c -__ldexpieee128 m __ledf2 c __lesf2 c __lgamma_r_finite m __lgammaf128_r_finite m __lgammaf_r_finite m -__lgammaieee128 m -__lgammaieee128_r m __lgammal_r_finite m __libc_allocate_rtsig c __libc_calloc c @@ -611,34 +512,23 @@ __libc_memalign c __libc_pvalloc c __libc_realloc c __libc_sa_len c -__libc_single_threaded c __libc_stack_end ld __libc_start_main c __libc_valloc c __libpthread_version_placeholder pthread -__llogbieee128 m -__llrintieee128 m -__llroundieee128 m __log10_finite m __log10f128_finite m __log10f_finite m -__log10ieee128 m __log10l_finite m -__log1pieee128 m __log2_finite m __log2f128_finite m __log2f_finite m -__log2ieee128 m __log2l_finite m __log_finite m -__logbieee128 m __logf128_finite m __logf_finite m -__logieee128 m __logl_finite m __longjmp_chk c -__lrintieee128 m -__lroundieee128 m __lseek c __lshrdi3 c __ltdf2 c @@ -677,26 +567,17 @@ __memset_gg c __mips_fpu_getcw c __mips_fpu_setcw c __moddi3 c -__modfieee128 m __monstartup c __morecore c __mq_open_2 rt __muldf3 c __mulsf3 c -__nanieee128 m __nanosleep c -__nearbyintieee128 m __nedf2 c __negdf2 c __negsf2 c __nesf2 c __newlocale c -__nextafterieee128 m -__nextdownieee128 m -__nexttoward_to_ieee128 m -__nexttowardf_to_ieee128 m -__nexttowardieee128 m -__nextupieee128 m __nl_langinfo_l c __nldbl__IO_fprintf c __nldbl__IO_printf c @@ -809,11 +690,7 @@ __nss_hosts_lookup c __nss_next c __nss_passwd_lookup c __obstack_printf_chk c -__obstack_printf_chkieee128 c -__obstack_printfieee128 c __obstack_vprintf_chk c -__obstack_vprintf_chkieee128 c -__obstack_vprintfieee128 c __open c __open64 c __open64_2 c @@ -829,7 +706,6 @@ __posix_getopt c __pow_finite m __powf128_finite m __powf_finite m -__powieee128 m __powl_finite m __ppc_get_timebase_freq c __ppoll_chk c @@ -837,10 +713,7 @@ __pread64 c __pread64_chk c __pread_chk c __printf_chk c -__printf_chkieee128 c __printf_fp c -__printf_sizeieee128 c -__printfieee128 c __profile_frequency c __progname c __progname_full c @@ -871,11 +744,6 @@ __pthread_unregister_cancel_restore pthread __pthread_unwind_next pthread __ptsname_r_chk c __pwrite64 c -__qecvtieee128 c -__qecvtieee128_r c -__qfcvtieee128 c -__qfcvtieee128_r c -__qgcvtieee128 c __rawmemchr c __rcmd_errstr c __read c @@ -894,17 +762,12 @@ __register_frame_table c __remainder_finite m __remainderf128_finite m __remainderf_finite m -__remainderieee128 m __remainderl_finite m -__remquoieee128 m __res_init c __res_nclose c __res_ninit c __res_randomid c __res_state c -__rintieee128 m -__roundevenieee128 m -__roundieee128 m __rpc_thread_createerr c __rpc_thread_svc_fdset c __rpc_thread_svc_max_pollfd c @@ -912,11 +775,7 @@ __rpc_thread_svc_pollfd c __sbrk c __scalb_finite m __scalbf_finite m -__scalbieee128 m __scalbl_finite m -__scalblnieee128 m -__scalbnieee128 m -__scanfieee128 c __sched_cpualloc c __sched_cpucount c __sched_cpufree c @@ -930,8 +789,6 @@ __secure_getenv c __select c __send c __setmntent c -__setpayloadieee128 m -__setpayloadsigieee128 m __setpgid c __sigaction c __sigaddset c @@ -942,34 +799,24 @@ __signbitf c __signbitf128 m __signbitl c __signgam m -__significandieee128 m __sigpause c __sigsetjmp c __sigsuspend c __sim_disabled_exceptions c __sim_exceptions c __sim_round_mode c -__sincosieee128 m __sinh_finite m __sinhf128_finite m __sinhf_finite m -__sinhieee128 m __sinhl_finite m -__sinieee128 m __snprintf_chk c -__snprintf_chkieee128 c -__snprintfieee128 c __sprintf_chk c -__sprintf_chkieee128 c -__sprintfieee128 c __sqrt_finite m __sqrtdf2 c __sqrtf128_finite m __sqrtf_finite m -__sqrtieee128 m __sqrtl_finite m __sqrtsf2 c -__sscanfieee128 c __stack_chk_fail c __stack_chk_guard ld __statfs c @@ -1002,9 +849,6 @@ __strcspn_g c __strdup c __strerror_r c __strfmon_l c -__strfmon_lieee128 c -__strfmonieee128 c -__strfromieee128 c __strftime_l c __strlen_g c __strncasecmp_l c @@ -1039,8 +883,6 @@ __strtod_l c __strtof128_internal c __strtof_internal c __strtof_l c -__strtoieee128 c -__strtoieee128_l c __strtok_r c __strtok_r_1c c __strtol_internal c @@ -1060,93 +902,48 @@ __strxfrm_l c __subdf3 c __subsf3 c __swprintf_chk c -__swprintf_chkieee128 c -__swprintfieee128 c -__swscanfieee128 c __sysconf c __sysctl c __syslog_chk c -__syslog_chkieee128 c -__syslogieee128 c __sysv_signal c -__tanhieee128 m -__tanieee128 m -__tgammaieee128 m __timezone c __tls_get_addr ld __tls_get_addr_opt ld __tls_get_offset ld __toascii_l c __tolower_l c -__totalorderieee128 m -__totalordermagieee128 m __toupper_l c __towctrans c __towctrans_l c __towlower_l c __towupper_l c __truncdfsf2 c -__truncieee128 m __ttyname_r_chk c __tzname c __ucmpdi2 c __udivdi3 c __uflow c -__ufromfpieee128 m -__ufromfpxieee128 m __umoddi3 c __underflow c __unorddf2 c __unordsf2 c __uselocale c __vasprintf_chk c -__vasprintf_chkieee128 c -__vasprintfieee128 c __vdprintf_chk c -__vdprintf_chkieee128 c -__vdprintfieee128 c -__verrieee128 c -__verrxieee128 c __vfork c __vfprintf_chk c -__vfprintf_chkieee128 c -__vfprintfieee128 c __vfscanf c -__vfscanfieee128 c __vfwprintf_chk c -__vfwprintf_chkieee128 c -__vfwprintfieee128 c -__vfwscanfieee128 c __vprintf_chk c -__vprintf_chkieee128 c -__vprintfieee128 c -__vscanfieee128 c __vsnprintf c __vsnprintf_chk c -__vsnprintf_chkieee128 c -__vsnprintfieee128 c __vsprintf_chk c -__vsprintf_chkieee128 c -__vsprintfieee128 c __vsscanf c -__vsscanfieee128 c __vswprintf_chk c -__vswprintf_chkieee128 c -__vswprintfieee128 c -__vswscanfieee128 c __vsyslog_chk c -__vsyslog_chkieee128 c -__vsyslogieee128 c -__vwarnieee128 c -__vwarnxieee128 c __vwprintf_chk c -__vwprintf_chkieee128 c -__vwprintfieee128 c -__vwscanfieee128 c __wait c __waitpid c -__warnieee128 c -__warnxieee128 c __wcpcpy_chk c __wcpncpy_chk c __wcrtomb_chk c @@ -1165,8 +962,6 @@ __wcstod_l c __wcstof128_internal c __wcstof_internal c __wcstof_l c -__wcstoieee128 c -__wcstoieee128_l c __wcstol_internal c __wcstol_l c __wcstold_internal c @@ -1188,10 +983,7 @@ __wmempcpy_chk c __wmemset_chk c __woverflow c __wprintf_chk c -__wprintf_chkieee128 c -__wprintfieee128 c __write c -__wscanfieee128 c __wuflow c __wunderflow c __xmknod c @@ -1204,17 +996,14 @@ __xstat64 c __y0_finite m __y0f128_finite m __y0f_finite m -__y0ieee128 m __y0l_finite m __y1_finite m __y1f128_finite m __y1f_finite m -__y1ieee128 m __y1l_finite m __yn_finite m __ynf128_finite m __ynf_finite m -__ynieee128 m __ynl_finite m _authenticate c _dl_mcount ld @@ -2938,19 +2727,17 @@ pthread_attr_getinheritsched c pthread_attr_getschedparam c pthread_attr_getschedpolicy c pthread_attr_getscope c -pthread_attr_getsigmask_np c pthread_attr_getstack pthread pthread_attr_getstackaddr pthread pthread_attr_getstacksize pthread pthread_attr_init c -pthread_attr_setaffinity_np c +pthread_attr_setaffinity_np pthread pthread_attr_setdetachstate c pthread_attr_setguardsize pthread pthread_attr_setinheritsched c pthread_attr_setschedparam c pthread_attr_setschedpolicy c pthread_attr_setscope c -pthread_attr_setsigmask_np c pthread_attr_setstack pthread pthread_attr_setstackaddr pthread pthread_attr_setstacksize pthread @@ -2980,9 +2767,9 @@ pthread_create pthread pthread_detach pthread pthread_equal c pthread_exit c -pthread_getaffinity_np c +pthread_getaffinity_np pthread pthread_getattr_default_np pthread -pthread_getattr_np c +pthread_getattr_np pthread pthread_getconcurrency pthread pthread_getcpuclockid pthread pthread_getname_np pthread @@ -3048,7 +2835,7 @@ pthread_setname_np pthread pthread_setschedparam c pthread_setschedprio pthread pthread_setspecific pthread -pthread_sigmask c +pthread_sigmask pthread pthread_sigqueue pthread pthread_spin_destroy pthread pthread_spin_init pthread @@ -3353,14 +3140,12 @@ shmctl c shmdt c shmget c shutdown c -sigabbrev_np c sigaction c sigaddset c sigaltstack c sigandset c sigblock c sigdelset c -sigdescr_np c sigemptyset c sigfillset c siggetmask c @@ -3466,8 +3251,6 @@ strdup c strerror c strerror_l c strerror_r c -strerrordesc_np c -strerrorname_np c strfmon c strfmon_l c strfromd c diff --git a/lib/libc/glibc/vers.txt b/lib/libc/glibc/vers.txt index 185bd5195f..a76ef9b25d 100644 --- a/lib/libc/glibc/vers.txt +++ b/lib/libc/glibc/vers.txt @@ -40,4 +40,3 @@ GLIBC_2.28 GLIBC_2.29 GLIBC_2.30 GLIBC_2.31 -GLIBC_2.32 diff --git a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h index 9f3cadf056..cf38b9d8b7 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h @@ -53,23 +53,4 @@ #define HWCAP_SSBS (1 << 28) #define HWCAP_SB (1 << 29) #define HWCAP_PACA (1 << 30) -#define HWCAP_PACG (1UL << 31) - -#define HWCAP2_DCPODP (1 << 0) -#define HWCAP2_SVE2 (1 << 1) -#define HWCAP2_SVEAES (1 << 2) -#define HWCAP2_SVEPMULL (1 << 3) -#define HWCAP2_SVEBITPERM (1 << 4) -#define HWCAP2_SVESHA3 (1 << 5) -#define HWCAP2_SVESM4 (1 << 6) -#define HWCAP2_FLAGM2 (1 << 7) -#define HWCAP2_FRINT (1 << 8) -#define HWCAP2_SVEI8MM (1 << 9) -#define HWCAP2_SVEF32MM (1 << 10) -#define HWCAP2_SVEF64MM (1 << 11) -#define HWCAP2_SVEBF16 (1 << 12) -#define HWCAP2_I8MM (1 << 13) -#define HWCAP2_BF16 (1 << 14) -#define HWCAP2_DGH (1 << 15) -#define HWCAP2_RNG (1 << 16) -#define HWCAP2_BTI (1 << 17) \ No newline at end of file +#define HWCAP_PACG (1UL << 31) \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h index f95b24f8e7..ce06962796 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h b/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h index a5f4c78b94..d9e9b274ac 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h @@ -26,45 +26,31 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ -#if __TIMESIZE == 64 && __WORDSIZE == 32 -/* These are the "new" y2038 types defined for architectures added after - the 5.1 kernel. */ -# define __INO_T_TYPE __UQUAD_TYPE -# define __OFF_T_TYPE __SQUAD_TYPE -# define __RLIM_T_TYPE __UQUAD_TYPE -# define __BLKCNT_T_TYPE __SQUAD_TYPE -# define __FSBLKCNT_T_TYPE __UQUAD_TYPE -# define __FSFILCNT_T_TYPE __UQUAD_TYPE -# define __TIME_T_TYPE __SQUAD_TYPE -# define __SUSECONDS_T_TYPE __SQUAD_TYPE -#else -# define __INO_T_TYPE __ULONGWORD_TYPE -# define __OFF_T_TYPE __SLONGWORD_TYPE -# define __RLIM_T_TYPE __ULONGWORD_TYPE -# define __BLKCNT_T_TYPE __SLONGWORD_TYPE -# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -# define __TIME_T_TYPE __SLONGWORD_TYPE -# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -76,7 +62,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#ifdef __LP64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -90,17 +76,11 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif - /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h index d25085e24f..f1923e9517 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h index 4c2911dd6d..342cde4c98 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h @@ -15,7 +15,10 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_stty \ No newline at end of file +#define __stub_sstk +#define __stub_stty +#define __stub_sysctl \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h index 9f3cadf056..cf38b9d8b7 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h @@ -53,23 +53,4 @@ #define HWCAP_SSBS (1 << 28) #define HWCAP_SB (1 << 29) #define HWCAP_PACA (1 << 30) -#define HWCAP_PACG (1UL << 31) - -#define HWCAP2_DCPODP (1 << 0) -#define HWCAP2_SVE2 (1 << 1) -#define HWCAP2_SVEAES (1 << 2) -#define HWCAP2_SVEPMULL (1 << 3) -#define HWCAP2_SVEBITPERM (1 << 4) -#define HWCAP2_SVESHA3 (1 << 5) -#define HWCAP2_SVESM4 (1 << 6) -#define HWCAP2_FLAGM2 (1 << 7) -#define HWCAP2_FRINT (1 << 8) -#define HWCAP2_SVEI8MM (1 << 9) -#define HWCAP2_SVEF32MM (1 << 10) -#define HWCAP2_SVEF64MM (1 << 11) -#define HWCAP2_SVEBF16 (1 << 12) -#define HWCAP2_I8MM (1 << 13) -#define HWCAP2_BF16 (1 << 14) -#define HWCAP2_DGH (1 << 15) -#define HWCAP2_RNG (1 << 16) -#define HWCAP2_BTI (1 << 17) \ No newline at end of file +#define HWCAP_PACG (1UL << 31) \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h index f95b24f8e7..ce06962796 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h b/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h index a5f4c78b94..d9e9b274ac 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h @@ -26,45 +26,31 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ -#if __TIMESIZE == 64 && __WORDSIZE == 32 -/* These are the "new" y2038 types defined for architectures added after - the 5.1 kernel. */ -# define __INO_T_TYPE __UQUAD_TYPE -# define __OFF_T_TYPE __SQUAD_TYPE -# define __RLIM_T_TYPE __UQUAD_TYPE -# define __BLKCNT_T_TYPE __SQUAD_TYPE -# define __FSBLKCNT_T_TYPE __UQUAD_TYPE -# define __FSFILCNT_T_TYPE __UQUAD_TYPE -# define __TIME_T_TYPE __SQUAD_TYPE -# define __SUSECONDS_T_TYPE __SQUAD_TYPE -#else -# define __INO_T_TYPE __ULONGWORD_TYPE -# define __OFF_T_TYPE __SLONGWORD_TYPE -# define __RLIM_T_TYPE __ULONGWORD_TYPE -# define __BLKCNT_T_TYPE __SLONGWORD_TYPE -# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -# define __TIME_T_TYPE __SLONGWORD_TYPE -# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -76,7 +62,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#ifdef __LP64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -90,17 +76,11 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif - /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h b/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h index fb1dd8a26c..f5cf894313 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h +++ b/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h b/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h index 4c2911dd6d..342cde4c98 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h +++ b/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h @@ -15,7 +15,10 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_stty \ No newline at end of file +#define __stub_sstk +#define __stub_stty +#define __stub_sysctl \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/long-double.h b/lib/libc/include/arm-linux-gnueabi/bits/long-double.h index 088c7a2a06..13e74241e1 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/long-double.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/long-double.h @@ -37,17 +37,4 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif - -/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the - choice of the underlying ABI of long double. It will always assume - a constant value for each translation unit. - - If the value is non-zero, any API which is parameterized by the long - double type (i.e the scanf/printf family of functions or the explicitly - parameterized math.h functions) will be redirected to a compatible - implementation using _Float128 ABI via symbols suffixed with ieee128. - - The mechanism this macro uses to acquire may be a function - of architecture, or target specific options used to invoke the - compiler. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h b/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h index 97292723c8..3dd94baf34 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h @@ -1,5 +1,4 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,20 +12,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#include -#if __WORDSIZE == 64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif +#define __SIZEOF_SEM_T 16 + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h b/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h index 088c7a2a06..13e74241e1 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h @@ -37,17 +37,4 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif - -/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the - choice of the underlying ABI of long double. It will always assume - a constant value for each translation unit. - - If the value is non-zero, any API which is parameterized by the long - double type (i.e the scanf/printf family of functions or the explicitly - parameterized math.h functions) will be redirected to a compatible - implementation using _Float128 ABI via symbols suffixed with ieee128. - - The mechanism this macro uses to acquire may be a function - of architecture, or target specific options used to invoke the - compiler. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h b/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h index 97292723c8..3dd94baf34 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h @@ -1,5 +1,4 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,20 +12,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#include -#if __WORDSIZE == 64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif +#define __SIZEOF_SEM_T 16 + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h b/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h index 088c7a2a06..13e74241e1 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h @@ -37,17 +37,4 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif - -/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the - choice of the underlying ABI of long double. It will always assume - a constant value for each translation unit. - - If the value is non-zero, any API which is parameterized by the long - double type (i.e the scanf/printf family of functions or the explicitly - parameterized math.h functions) will be redirected to a compatible - implementation using _Float128 ABI via symbols suffixed with ieee128. - - The mechanism this macro uses to acquire may be a function - of architecture, or target specific options used to invoke the - compiler. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h b/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h index 97292723c8..3dd94baf34 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h @@ -1,5 +1,4 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,20 +12,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#include -#if __WORDSIZE == 64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif +#define __SIZEOF_SEM_T 16 + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h b/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h index 088c7a2a06..13e74241e1 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h @@ -37,17 +37,4 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif - -/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the - choice of the underlying ABI of long double. It will always assume - a constant value for each translation unit. - - If the value is non-zero, any API which is parameterized by the long - double type (i.e the scanf/printf family of functions or the explicitly - parameterized math.h functions) will be redirected to a compatible - implementation using _Float128 ABI via symbols suffixed with ieee128. - - The mechanism this macro uses to acquire may be a function - of architecture, or target specific options used to invoke the - compiler. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h b/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h index 97292723c8..3dd94baf34 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h @@ -1,5 +1,4 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,20 +12,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#include -#if __WORDSIZE == 64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif +#define __SIZEOF_SEM_T 16 + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/generic-glibc/argp.h b/lib/libc/include/generic-glibc/argp.h index 8101648163..0bb8d732f5 100644 --- a/lib/libc/include/generic-glibc/argp.h +++ b/lib/libc/include/generic-glibc/argp.h @@ -554,8 +554,7 @@ __NTH (__option_is_end (const struct argp_option *__opt)) # endif #endif /* Use extern inlines. */ -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/bits/a.out.h b/lib/libc/include/generic-glibc/bits/a.out.h index 3c81a52dbb..c075e94124 100644 --- a/lib/libc/include/generic-glibc/bits/a.out.h +++ b/lib/libc/include/generic-glibc/bits/a.out.h @@ -2,10 +2,6 @@ # error "Never use directly; include instead." #endif -#ifdef __x86_64__ - /* Signal to users of this header that this architecture really doesn't support a.out binary format. */ -#define __NO_A_OUT_SUPPORT 1 - -#endif \ No newline at end of file +#define __NO_A_OUT_SUPPORT 1 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/endianness.h b/lib/libc/include/generic-glibc/bits/endianness.h index 80180b782e..5a0a871460 100644 --- a/lib/libc/include/generic-glibc/bits/endianness.h +++ b/lib/libc/include/generic-glibc/bits/endianness.h @@ -5,7 +5,12 @@ # error "Never use directly; include instead." #endif -/* i386/x86_64 are little-endian. */ -#define __BYTE_ORDER __LITTLE_ENDIAN +/* MIPS has selectable endianness. */ +#ifdef __MIPSEB +# define __BYTE_ORDER __BIG_ENDIAN +#endif +#ifdef __MIPSEL +# define __BYTE_ORDER __LITTLE_ENDIAN +#endif #endif /* bits/endianness.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/environments.h b/lib/libc/include/generic-glibc/bits/environments.h index 2b18837e58..1b5e74a08e 100644 --- a/lib/libc/include/generic-glibc/bits/environments.h +++ b/lib/libc/include/generic-glibc/bits/environments.h @@ -41,16 +41,13 @@ #if __WORDSIZE == 64 -/* Environments with 32-bit wide pointers are optionally provided. - Therefore following macros aren't defined: - # undef _POSIX_V7_ILP32_OFF32 - # undef _POSIX_V7_ILP32_OFFBIG - # undef _POSIX_V6_ILP32_OFF32 - # undef _POSIX_V6_ILP32_OFFBIG - # undef _XBS5_ILP32_OFF32 - # undef _XBS5_ILP32_OFFBIG - and users need to check at runtime. */ - +/* We can never provide environments with 32-bit wide pointers. */ +# define _POSIX_V7_ILP32_OFF32 -1 +# define _POSIX_V7_ILP32_OFFBIG -1 +# define _POSIX_V6_ILP32_OFF32 -1 +# define _POSIX_V6_ILP32_OFFBIG -1 +# define _XBS5_ILP32_OFF32 -1 +# define _XBS5_ILP32_OFFBIG -1 /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 @@ -64,42 +61,27 @@ #else /* __WORDSIZE == 32 */ -/* We have 32-bit wide `int', `long int' and pointers and all platforms - support LFS. -mx32 has 64-bit wide `off_t'. */ +/* By default we have 32-bit wide `int', `long int', pointers and `off_t' + and all platforms support LFS. */ +# define _POSIX_V7_ILP32_OFF32 1 # define _POSIX_V7_ILP32_OFFBIG 1 -# define _POSIX_V6_ILP32_OFFBIG 1 +# define _POSIX_V6_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFFBIG 1 +# define _XBS5_ILP32_OFF32 1 # define _XBS5_ILP32_OFFBIG 1 -# ifndef __x86_64__ -/* -m32 has 32-bit wide `off_t'. */ -# define _POSIX_V7_ILP32_OFF32 1 -# define _POSIX_V6_ILP32_OFF32 1 -# define _XBS5_ILP32_OFF32 1 -# endif - /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ -/* Environments with 64-bit wide pointers can be provided, - so these macros aren't defined: - # undef _POSIX_V7_LP64_OFF64 - # undef _POSIX_V7_LPBIG_OFFBIG - # undef _POSIX_V6_LP64_OFF64 - # undef _POSIX_V6_LPBIG_OFFBIG - # undef _XBS5_LP64_OFF64 - # undef _XBS5_LPBIG_OFFBIG - and sysconf tests for it at runtime. */ +/* We can never provide environments with 64-bit wide pointers. */ +# define _POSIX_V7_LP64_OFF64 -1 +# define _POSIX_V7_LPBIG_OFFBIG -1 +# define _POSIX_V6_LP64_OFF64 -1 +# define _POSIX_V6_LPBIG_OFFBIG -1 +# define _XBS5_LP64_OFF64 -1 +# define _XBS5_LPBIG_OFFBIG -1 -#endif /* __WORDSIZE == 32 */ +/* CFLAGS. */ +#define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -#define __ILP32_OFF32_CFLAGS "-m32" -#define __ILP32_OFF32_LDFLAGS "-m32" -#if defined __x86_64__ && defined __ILP32__ -# define __ILP32_OFFBIG_CFLAGS "-mx32" -# define __ILP32_OFFBIG_LDFLAGS "-mx32" -#else -# define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -# define __ILP32_OFFBIG_LDFLAGS "-m32" -#endif -#define __LP64_OFF64_CFLAGS "-m64" -#define __LP64_OFF64_LDFLAGS "-m64" \ No newline at end of file +#endif /* __WORDSIZE == 32 */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/epoll.h b/lib/libc/include/generic-glibc/bits/epoll.h index 5f23749272..6d92d7ce11 100644 --- a/lib/libc/include/generic-glibc/bits/epoll.h +++ b/lib/libc/include/generic-glibc/bits/epoll.h @@ -24,6 +24,4 @@ enum { EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC - }; - -#define __EPOLL_PACKED __attribute__ ((__packed__)) \ No newline at end of file + }; \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fcntl-linux.h b/lib/libc/include/generic-glibc/bits/fcntl-linux.h index 14d7e72f01..4e3813d8c4 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl-linux.h +++ b/lib/libc/include/generic-glibc/bits/fcntl-linux.h @@ -290,8 +290,7 @@ struct f_owner_ex #ifdef __USE_GNU /* Hint values for F_{GET,SET}_RW_HINT. */ -# define RWH_WRITE_LIFE_NOT_SET 0 -# define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET +# define RWF_WRITE_LIFE_NOT_SET 0 # define RWH_WRITE_LIFE_NONE 1 # define RWH_WRITE_LIFE_SHORT 2 # define RWH_WRITE_LIFE_MEDIUM 3 diff --git a/lib/libc/include/generic-glibc/bits/fcntl.h b/lib/libc/include/generic-glibc/bits/fcntl.h index 4eb8fa0b6f..b9fa29e200 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl.h +++ b/lib/libc/include/generic-glibc/bits/fcntl.h @@ -1,5 +1,5 @@ -/* O_*, F_*, FD_* bit values for Linux/x86. - Copyright (C) 2001-2020 Free Software Foundation, Inc. +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,24 +13,56 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ -#ifndef _FCNTL_H +#ifndef _FCNTL_H # error "Never use directly; include instead." #endif -#ifdef __x86_64__ -# define __O_LARGEFILE 0 +#include + +#define O_APPEND 0x0008 +#define O_SYNC 0x4010 +#define O_NONBLOCK 0x0080 +#define O_CREAT 0x0100 /* not fcntl */ +#define O_TRUNC 0x0200 /* not fcntl */ +#define O_EXCL 0x0400 /* not fcntl */ +#define O_NOCTTY 0x0800 /* not fcntl */ +#define O_ASYNC 0x1000 + +#define __O_DIRECT 0x8000 /* Direct disk access hint. */ +#define __O_DSYNC 0x0010 /* Synchronize data. */ + +#if _MIPS_SIM == _ABI64 +/* Not necessary, files are always with 64bit off_t. */ +# define __O_LARGEFILE 0 +#else +# define __O_LARGEFILE 0x2000 /* Allow large file opens. */ #endif -#ifdef __x86_64__ -/* Not necessary, we always have 64-bit offsets. */ -# define F_GETLK64 5 /* Get record locking info. */ -# define F_SETLK64 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW64 7 /* Set record locking info (blocking). */ +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 14 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ #endif +#if _MIPS_SIM != _ABI64 +# define F_GETLK64 33 /* Get record locking info. */ +# define F_SETLK64 34 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 35 /* Set record locking info (blocking). */ +#else +# define F_GETLK64 14 /* Get record locking info. */ +# define F_SETLK64 6 /* Set record locking info (non-blocking).*/ +# define F_SETLKW64 7 /* Set record locking info (blocking). */ +#endif + +#define __F_SETOWN 24 /* Get owner (process receiving SIGIO). */ +#define __F_GETOWN 23 /* Set owner (process receiving SIGIO). */ struct flock { @@ -39,12 +71,23 @@ struct flock #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#if _MIPS_SIM != _ABI64 + /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit + fcntls in o32 and n32, never has this field. */ + long int l_sysid; +#endif #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ +#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64 + /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit + flock in o32 and n32, never has this field. */ + long int __glibc_reserved0[4]; +#endif }; +typedef struct flock flock_t; #ifdef __USE_LARGEFILE64 struct flock64 diff --git a/lib/libc/include/generic-glibc/bits/fenv.h b/lib/libc/include/generic-glibc/bits/fenv.h index b504e27b15..cdf79211de 100644 --- a/lib/libc/include/generic-glibc/bits/fenv.h +++ b/lib/libc/include/generic-glibc/bits/fenv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. +/* Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,104 +12,101 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _FENV_H # error "Never use directly; include instead." #endif + +#ifdef __mips_hard_float + /* Define bits representing the exception. We use the bit positions of the appropriate bits in the FPU control word. */ enum { - FE_INVALID = -#define FE_INVALID 0x01 - FE_INVALID, - __FE_DENORM = 0x02, - FE_DIVBYZERO = -#define FE_DIVBYZERO 0x04 - FE_DIVBYZERO, - FE_OVERFLOW = -#define FE_OVERFLOW 0x08 - FE_OVERFLOW, - FE_UNDERFLOW = -#define FE_UNDERFLOW 0x10 - FE_UNDERFLOW, FE_INEXACT = -#define FE_INEXACT 0x20 - FE_INEXACT +# define FE_INEXACT 0x04 + FE_INEXACT, + FE_UNDERFLOW = +# define FE_UNDERFLOW 0x08 + FE_UNDERFLOW, + FE_OVERFLOW = +# define FE_OVERFLOW 0x10 + FE_OVERFLOW, + FE_DIVBYZERO = +# define FE_DIVBYZERO 0x20 + FE_DIVBYZERO, + FE_INVALID = +# define FE_INVALID 0x40 + FE_INVALID, }; -#define FE_ALL_EXCEPT \ +# define FE_ALL_EXCEPT \ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) -/* The ix87 FPU supports all of the four defined rounding modes. We +/* The MIPS FPU supports all of the four defined rounding modes. We use again the bit positions in the FPU control word as the values for the appropriate macros. */ enum { FE_TONEAREST = -#define FE_TONEAREST 0 +# define FE_TONEAREST 0x0 FE_TONEAREST, - FE_DOWNWARD = -#define FE_DOWNWARD 0x400 - FE_DOWNWARD, - FE_UPWARD = -#define FE_UPWARD 0x800 - FE_UPWARD, FE_TOWARDZERO = -#define FE_TOWARDZERO 0xc00 - FE_TOWARDZERO +# define FE_TOWARDZERO 0x1 + FE_TOWARDZERO, + FE_UPWARD = +# define FE_UPWARD 0x2 + FE_UPWARD, + FE_DOWNWARD = +# define FE_DOWNWARD 0x3 + FE_DOWNWARD }; +#else + +/* In the soft-float case, only rounding to nearest is supported, with + no exceptions. */ + +enum + { + __FE_UNDEFINED = -1, + + FE_TONEAREST = +# define FE_TONEAREST 0x0 + FE_TONEAREST + }; + +# define FE_ALL_EXCEPT 0 + +#endif + /* Type representing exception flags. */ typedef unsigned short int fexcept_t; -/* Type representing floating-point environment. This structure - corresponds to the layout of the block written by the `fstenv' - instruction and has additional fields for the contents of the MXCSR - register as written by the `stmxcsr' instruction. */ +/* Type representing floating-point environment. This function corresponds + to the layout of the block written by the `fstenv'. */ typedef struct { - unsigned short int __control_word; - unsigned short int __glibc_reserved1; - unsigned short int __status_word; - unsigned short int __glibc_reserved2; - unsigned short int __tags; - unsigned short int __glibc_reserved3; - unsigned int __eip; - unsigned short int __cs_selector; - unsigned int __opcode:11; - unsigned int __glibc_reserved4:5; - unsigned int __data_offset; - unsigned short int __data_selector; - unsigned short int __glibc_reserved5; -#ifdef __x86_64__ - unsigned int __mxcsr; -#endif + unsigned int __fp_control_register; } fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1) -#ifdef __USE_GNU +#if defined __USE_GNU && defined __mips_hard_float /* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((const fenv_t *) -2) +# define FE_NOMASK_ENV ((const fenv_t *) -2) #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ -typedef struct - { - unsigned short int __control_word; - unsigned short int __glibc_reserved; - unsigned int __mxcsr; - } -femode_t; +typedef unsigned int femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) diff --git a/lib/libc/include/generic-glibc/bits/fenvinline.h b/lib/libc/include/generic-glibc/bits/fenvinline.h new file mode 100644 index 0000000000..1367c80eaf --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/fenvinline.h @@ -0,0 +1,8 @@ +/* This file provides inline versions of floating-pint environment + handling functions. If there were any. */ + +#ifndef __NO_MATH_INLINES + +/* Here is where the code would go. */ + +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/floatn.h b/lib/libc/include/generic-glibc/bits/floatn.h index 36d64c23ec..68a17ab2c7 100644 --- a/lib/libc/include/generic-glibc/bits/floatn.h +++ b/lib/libc/include/generic-glibc/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on x86. +/* Macros to control TS 18661-3 glibc features on MIPS platforms. Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,38 +20,35 @@ #define _BITS_FLOATN_H #include +#include /* Defined to 1 if the current compiler invocation provides a floating-point type with the IEEE 754 binary128 format, and this - glibc includes corresponding *f128 interfaces for it. The required - libgcc support was added some time after the basic compiler - support, for x86_64 and x86. */ -#if (defined __x86_64__ \ - ? __GNUC_PREREQ (4, 3) \ - : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) + glibc includes corresponding *f128 interfaces for it. */ +#ifndef __NO_LONG_DOUBLE_MATH # define __HAVE_FLOAT128 1 #else +/* glibc does not support _Float128 for platforms where long double is + normally binary128 when building with long double as binary64. + GCC's default for supported scalar modes does not support it either + in that case. */ # define __HAVE_FLOAT128 0 #endif /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct from the default float, double and long double types in this glibc. */ -#if __HAVE_FLOAT128 -# define __HAVE_DISTINCT_FLOAT128 1 -#else -# define __HAVE_DISTINCT_FLOAT128 0 -#endif +#define __HAVE_DISTINCT_FLOAT128 0 /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for _Float64x, and this glibc includes corresponding *f64x interfaces for it. */ -#define __HAVE_FLOAT64X 1 +#define __HAVE_FLOAT64X __HAVE_FLOAT128 /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has the format of _Float128, which must be different from that of long double. */ -#define __HAVE_FLOAT64X_LONG_DOUBLE 1 +#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 #ifndef __ASSEMBLER__ @@ -60,7 +57,7 @@ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* The literal suffix f128 exists only since GCC 7.0. */ -# define __f128(x) x##q +# define __f128(x) x##l # else # define __f128(x) x##f128 # endif @@ -69,10 +66,7 @@ /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus -/* Add a typedef for older GCC compilers which don't natively support - _Complex _Float128. */ -typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); -# define __CFLOAT128 __cfloat128 +# define __CFLOAT128 _Complex long double # else # define __CFLOAT128 _Complex _Float128 # endif @@ -83,33 +77,15 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) || defined __cplusplus -typedef __float128 _Float128; +typedef long double _Float128; # endif -/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */ +/* Various built-in functions do not exist before GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) -# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) -# endif - -/* Older GCC has only a subset of built-in functions for _Float128 on - x86, and __builtin_infq is not usable in static initializers. - Converting a narrower sNaN to _Float128 produces a quiet NaN, so - attempts to use _Float128 sNaNs will not work properly with older - compilers. */ -# if !__GNUC_PREREQ (7, 0) -# define __builtin_copysignf128 __builtin_copysignq -# define __builtin_fabsf128 __builtin_fabsq -# define __builtin_inff128() ((_Float128) __builtin_inf ()) -# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x)) -# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x)) -# endif - -/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, - e.g.: __builtin_signbitf128, before GCC 6. However, there has never - been a __builtin_signbitf128 in GCC and the type-generic builtin is - only available since GCC 6. */ -# if !__GNUC_PREREQ (6, 0) -# define __builtin_signbitf128 __signbitf128 +# define __builtin_huge_valf128() (__builtin_huge_vall ()) +# define __builtin_inff128() (__builtin_infl ()) +# define __builtin_nanf128(x) (__builtin_nanl (x)) +# define __builtin_nansf128(x) (__builtin_nansl (x)) # endif # endif diff --git a/lib/libc/include/generic-glibc/bits/flt-eval-method.h b/lib/libc/include/generic-glibc/bits/flt-eval-method.h index 9da0307897..11297d9c17 100644 --- a/lib/libc/include/generic-glibc/bits/flt-eval-method.h +++ b/lib/libc/include/generic-glibc/bits/flt-eval-method.h @@ -1,4 +1,4 @@ -/* Define __GLIBC_FLT_EVAL_METHOD. x86 version. +/* Define __GLIBC_FLT_EVAL_METHOD. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,14 +20,23 @@ # error "Never use directly; include instead." #endif +/* __GLIBC_FLT_EVAL_METHOD is the value of FLT_EVAL_METHOD used to + determine the evaluation method typedefs such as float_t and + double_t. It must be a value from C11 or TS 18661-3:2015, and not + -1. */ + +/* In the default version of this header, follow __FLT_EVAL_METHOD__. + -1 is mapped to 2 (considering evaluation as long double to be a + conservatively safe assumption), and if __FLT_EVAL_METHOD__ is not + defined then assume there is no excess precision and use the value + 0. */ + #ifdef __FLT_EVAL_METHOD__ # if __FLT_EVAL_METHOD__ == -1 # define __GLIBC_FLT_EVAL_METHOD 2 # else # define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ # endif -#elif defined __x86_64__ -# define __GLIBC_FLT_EVAL_METHOD 0 #else -# define __GLIBC_FLT_EVAL_METHOD 2 +# define __GLIBC_FLT_EVAL_METHOD 0 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fp-logb.h b/lib/libc/include/generic-glibc/bits/fp-logb.h index 5f2e2a9f88..efc488bc27 100644 --- a/lib/libc/include/generic-glibc/bits/fp-logb.h +++ b/lib/libc/include/generic-glibc/bits/fp-logb.h @@ -1,4 +1,4 @@ -/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version. +/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,5 +20,9 @@ # error "Never use directly; include instead." #endif -#define __FP_LOGB0_IS_MIN 1 -#define __FP_LOGBNAN_IS_MIN 1 \ No newline at end of file +/* __FP_LOGB0_IS_MIN is defined to 1 if FP_ILOGB0 is INT_MIN, and 0 if + it is -INT_MAX. __FP_LOGBNAN_IS_MIN is defined to 1 if FP_ILOGBNAN + is INT_MIN, and 0 if it is INT_MAX. */ + +#define __FP_LOGB0_IS_MIN 0 +#define __FP_LOGBNAN_IS_MIN 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/indirect-return.h b/lib/libc/include/generic-glibc/bits/indirect-return.h index e74139721c..5a7beddda9 100644 --- a/lib/libc/include/generic-glibc/bits/indirect-return.h +++ b/lib/libc/include/generic-glibc/bits/indirect-return.h @@ -1,4 +1,4 @@ -/* Definition of __INDIRECT_RETURN. x86 version. +/* Definition of __INDIRECT_RETURN. Generic version. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,18 +20,6 @@ # error "Never include directly; use instead." #endif -/* On x86, swapcontext returns via indirect branch when the shadow stack - is enabled. Define __INDIRECT_RETURN to indicate whether swapcontext - returns via indirect branch. */ -#if defined __CET__ && (__CET__ & 2) != 0 -# if __glibc_has_attribute (__indirect_return__) -# define __INDIRECT_RETURN __attribute__ ((__indirect_return__)) -# else -/* Newer compilers provide the indirect_return attribute, but without - it we can use returns_twice to affect the optimizer in the same - way and avoid unsafe optimizations. */ -# define __INDIRECT_RETURN __attribute__ ((__returns_twice__)) -# endif -#else -# define __INDIRECT_RETURN -#endif \ No newline at end of file +/* __INDIRECT_RETURN is used on swapcontext to indicate if it requires + special compiler treatment. */ +#define __INDIRECT_RETURN \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/ipctypes.h b/lib/libc/include/generic-glibc/bits/ipctypes.h index 7f6bb7662d..2fce70dab0 100644 --- a/lib/libc/include/generic-glibc/bits/ipctypes.h +++ b/lib/libc/include/generic-glibc/bits/ipctypes.h @@ -1,5 +1,5 @@ -/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. - Copyright (C) 2012-2020 Free Software Foundation, Inc. +/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic. + Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,18 +16,21 @@ License along with the GNU C Library; if not, see . */ -#ifndef _SYS_IPC_H -# error "Never use directly; include instead." -#endif +/* + * Never include directly. + */ #ifndef _BITS_IPCTYPES_H #define _BITS_IPCTYPES_H 1 +#include + /* Used in `struct shmid_ds'. */ -# ifdef __x86_64__ -typedef int __ipc_pid_t; -# else +# if __WORDSIZE == 32 typedef unsigned short int __ipc_pid_t; +# else +typedef int __ipc_pid_t; # endif + #endif /* bits/ipctypes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/iscanonical.h b/lib/libc/include/generic-glibc/bits/iscanonical.h index ee0d8720f9..446a24d01b 100644 --- a/lib/libc/include/generic-glibc/bits/iscanonical.h +++ b/lib/libc/include/generic-glibc/bits/iscanonical.h @@ -1,4 +1,4 @@ -/* Define iscanonical macro. ldbl-96 version. +/* Define iscanonical macro. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,35 +20,9 @@ # error "Never use directly; include instead." #endif -extern int __iscanonicall (long double __x) - __THROW __attribute__ ((__const__)); -#define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) -#define __iscanonical(x) ((void) (__typeof (x)) (x), 1) -#if __HAVE_DISTINCT_FLOAT128 -# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) -#endif - -/* Return nonzero value if X is canonical. In IEEE interchange binary - formats, all values are canonical, but the argument must still be - converted to its semantic type for any exceptions arising from the - conversion, before being discarded; in extended precision, there - are encodings that are not consistently handled as corresponding to - any particular value of the type, and we return 0 for those. */ -#ifndef __cplusplus -# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) -#else -/* In C++ mode, __MATH_TG cannot be used, because it relies on - __builtin_types_compatible_p, which is a C-only builtin. On the - other hand, overloading provides the means to distinguish between - the floating-point types. The overloading resolution will match - the correct parameter (regardless of type qualifiers (i.e.: const - and volatile)). */ -extern "C++" { -inline int iscanonical (float __val) { return __iscanonicalf (__val); } -inline int iscanonical (double __val) { return __iscanonical (__val); } -inline int iscanonical (long double __val) { return __iscanonicall (__val); } -# if __HAVE_DISTINCT_FLOAT128 -inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } -# endif -} -#endif /* __cplusplus */ \ No newline at end of file +/* Return nonzero value if X is canonical. By default, we only have + IEEE interchange binary formats, in which all values are canonical, + but the argument must still be converted to its semantic type for + any exceptions arising from the conversion, before being + discarded. */ +#define iscanonical(x) ((void) (__typeof (x)) (x), 1) \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/link.h b/lib/libc/include/generic-glibc/bits/link.h index 68938e8e0c..9fc3255bf9 100644 --- a/lib/libc/include/generic-glibc/bits/link.h +++ b/lib/libc/include/generic-glibc/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2020 Free Software Foundation, Inc. +/* Copyright (C) 2005-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,148 +12,106 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _LINK_H # error "Never include directly; use instead." #endif +#include -#ifndef __x86_64__ -/* Registers for entry into PLT on IA-32. */ -typedef struct La_i86_regs +#if _MIPS_SIM == _ABIO32 + +/* Registers for entry into PLT on MIPS. */ +typedef struct La_mips_32_regs { - uint32_t lr_edx; - uint32_t lr_ecx; - uint32_t lr_eax; - uint32_t lr_ebp; - uint32_t lr_esp; -} La_i86_regs; + uint32_t lr_reg[4]; /* $a0 through $a3 */ + double lr_fpreg[2]; /* $f12 and $f14 */ + uint32_t lr_ra; + uint32_t lr_sp; +} La_mips_32_regs; -/* Return values for calls from PLT on IA-32. */ -typedef struct La_i86_retval +/* Return values for calls from PLT on MIPS. */ +typedef struct La_mips_32_retval { - uint32_t lrv_eax; - uint32_t lrv_edx; - long double lrv_st0; - long double lrv_st1; - uint64_t lrv_bnd0; - uint64_t lrv_bnd1; -} La_i86_retval; - - -__BEGIN_DECLS - -extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_i86_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_i86_regs *__inregs, - La_i86_retval *__outregs, - const char *symname); - -__END_DECLS + uint32_t lrv_v0; + uint32_t lrv_v1; + double lrv_f0; + double lrv_f2; +} La_mips_32_retval; #else -/* Registers for entry into PLT on x86-64. */ -# if __GNUC_PREREQ (4,0) -typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16))); -typedef float La_x86_64_ymm - __attribute__ ((__vector_size__ (32), __aligned__ (16))); -typedef double La_x86_64_zmm - __attribute__ ((__vector_size__ (64), __aligned__ (16))); -# else -typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__))); -# endif - -typedef union +typedef struct La_mips_64_regs { -# if __GNUC_PREREQ (4,0) - La_x86_64_ymm ymm[2]; - La_x86_64_zmm zmm[1]; -# endif - La_x86_64_xmm xmm[4]; -} La_x86_64_vector __attribute__ ((__aligned__ (16))); + uint64_t lr_reg[8]; /* $a0 through $a7 */ + double lr_fpreg[8]; /* $f12 throgh $f19 */ + uint64_t lr_ra; + uint64_t lr_sp; +} La_mips_64_regs; -typedef struct La_x86_64_regs +/* Return values for calls from PLT on MIPS. */ +typedef struct La_mips_64_retval { - uint64_t lr_rdx; - uint64_t lr_r8; - uint64_t lr_r9; - uint64_t lr_rcx; - uint64_t lr_rsi; - uint64_t lr_rdi; - uint64_t lr_rbp; - uint64_t lr_rsp; - La_x86_64_xmm lr_xmm[8]; - La_x86_64_vector lr_vector[8]; -#ifndef __ILP32__ - __int128_t lr_bnd[4]; + uint64_t lrv_v0; + uint64_t lrv_v1; + double lrv_f0; + double lrv_f2; +} La_mips_64_retval; + #endif -} La_x86_64_regs; - -/* Return values for calls from PLT on x86-64. */ -typedef struct La_x86_64_retval -{ - uint64_t lrv_rax; - uint64_t lrv_rdx; - La_x86_64_xmm lrv_xmm0; - La_x86_64_xmm lrv_xmm1; - long double lrv_st0; - long double lrv_st1; - La_x86_64_vector lrv_vector0; - La_x86_64_vector lrv_vector1; -#ifndef __ILP32__ - __int128_t lrv_bnd0; - __int128_t lrv_bnd1; -#endif -} La_x86_64_retval; - -#define La_x32_regs La_x86_64_regs -#define La_x32_retval La_x86_64_retval __BEGIN_DECLS -extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym, - unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_x86_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym, - unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_x86_64_regs *__inregs, - La_x86_64_retval *__outregs, - const char *__symname); +#if _MIPS_SIM == _ABIO32 -extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym, - unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_x32_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym, - unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_x32_regs *__inregs, - La_x32_retval *__outregs, - const char *__symname); +extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_mips_32_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_mips_32_regs *__inregs, + La_mips_32_retval *__outregs, + const char *__symname); -__END_DECLS +#elif _MIPS_SIM == _ABIN32 -#endif \ No newline at end of file +extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_mips_64_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_mips_64_regs *__inregs, + La_mips_64_retval *__outregs, + const char *__symname); + +#else + +extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_mips_64_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_mips_64_regs *__inregs, + La_mips_64_retval *__outregs, + const char *__symname); + +#endif + +__END_DECLS \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/long-double.h b/lib/libc/include/generic-glibc/bits/long-double.h index 75bc1fcce4..27339ff440 100644 --- a/lib/libc/include/generic-glibc/bits/long-double.h +++ b/lib/libc/include/generic-glibc/bits/long-double.h @@ -1,4 +1,4 @@ -/* Properties of long double type. ldbl-96 version. +/* Properties of long double type. MIPS version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see . */ -/* long double is distinct from double, so there is nothing to - define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#include + +#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 +# define __NO_LONG_DOUBLE_MATH 1 +#endif +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/math-vector.h b/lib/libc/include/generic-glibc/bits/math-vector.h index f7571e827d..da37ee7bff 100644 --- a/lib/libc/include/generic-glibc/bits/math-vector.h +++ b/lib/libc/include/generic-glibc/bits/math-vector.h @@ -4,7 +4,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either + License published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, @@ -21,43 +21,7 @@ include instead." #endif -/* Get default empty definitions for simd declarations. */ -#include - -#if defined __x86_64__ && defined __FAST_MATH__ -# if defined _OPENMP && _OPENMP >= 201307 -/* OpenMP case. */ -# define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") -# elif __GNUC_PREREQ (6,0) -/* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ -# define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) -# endif - -# ifdef __DECL_SIMD_x86_64 -# undef __DECL_SIMD_cos -# define __DECL_SIMD_cos __DECL_SIMD_x86_64 -# undef __DECL_SIMD_cosf -# define __DECL_SIMD_cosf __DECL_SIMD_x86_64 -# undef __DECL_SIMD_sin -# define __DECL_SIMD_sin __DECL_SIMD_x86_64 -# undef __DECL_SIMD_sinf -# define __DECL_SIMD_sinf __DECL_SIMD_x86_64 -# undef __DECL_SIMD_sincos -# define __DECL_SIMD_sincos __DECL_SIMD_x86_64 -# undef __DECL_SIMD_sincosf -# define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 -# undef __DECL_SIMD_log -# define __DECL_SIMD_log __DECL_SIMD_x86_64 -# undef __DECL_SIMD_logf -# define __DECL_SIMD_logf __DECL_SIMD_x86_64 -# undef __DECL_SIMD_exp -# define __DECL_SIMD_exp __DECL_SIMD_x86_64 -# undef __DECL_SIMD_expf -# define __DECL_SIMD_expf __DECL_SIMD_x86_64 -# undef __DECL_SIMD_pow -# define __DECL_SIMD_pow __DECL_SIMD_x86_64 -# undef __DECL_SIMD_powf -# define __DECL_SIMD_powf __DECL_SIMD_x86_64 - -# endif -#endif \ No newline at end of file +/* Get default empty definitions required for __MATHCALL_VEC unfolding. + Plaform-specific analogue of this header should redefine them with specific + SIMD declarations. */ +#include \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h b/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h index 29808be75a..88ced5d2e1 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h @@ -16,30 +16,28 @@ License along with the GNU C Library; if not, see . */ + /* Classify given number. */ -__MATHDECL_ALIAS (int, __fpclassify,, (_Mdouble_ __value), fpclassify) +__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ -__MATHDECL_ALIAS (int, __signbit,, (_Mdouble_ __value), signbit) +__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_ALIAS (int, __isinf,, (_Mdouble_ __value), isinf) - __attribute__ ((__const__)); +__MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ -__MATHDECL_ALIAS (int, __finite,, (_Mdouble_ __value), finite) - __attribute__ ((__const__)); +__MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ -__MATHDECL_ALIAS (int, __isnan,, (_Mdouble_ __value), isnan) - __attribute__ ((__const__)); +__MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test equality. */ -__MATHDECL_ALIAS (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y), iseqsig); +__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); /* Test for signaling NaN. */ -__MATHDECL_ALIAS (int, __issignaling,, (_Mdouble_ __value), issignaling) +__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls.h b/lib/libc/include/generic-glibc/bits/mathcalls.h index 28d936113e..e6b009ff27 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls.h @@ -174,14 +174,12 @@ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_ALIAS (int,isinf,, (_Mdouble_ __value), isinf) - __attribute__ ((__const__)); +__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_ALIAS (int,finite,, (_Mdouble_ __value), finite) - __attribute__ ((__const__)); +__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); @@ -210,8 +208,7 @@ __MATHCALL (nan,, (const char *__tagb)); || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ -__MATHDECL_ALIAS (int,isnan,, (_Mdouble_ __value), isnan) - __attribute__ ((__const__)); +__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif #endif diff --git a/lib/libc/include/generic-glibc/bits/mathinline.h b/lib/libc/include/generic-glibc/bits/mathinline.h new file mode 100644 index 0000000000..76a37688ed --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/mathinline.h @@ -0,0 +1,12 @@ +/* This file should provide inline versions of math functions. + + Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. + + This file should define __MATH_INLINES if functions are actually defined as + inlines. */ + +#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ + +/* Here goes the real code. */ + +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mman-shared.h b/lib/libc/include/generic-glibc/bits/mman-shared.h index 45862663e3..aa6c176fca 100644 --- a/lib/libc/include/generic-glibc/bits/mman-shared.h +++ b/lib/libc/include/generic-glibc/bits/mman-shared.h @@ -24,7 +24,6 @@ /* Flags for mremap. */ # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 -# define MREMAP_DONTUNMAP 4 /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC diff --git a/lib/libc/include/generic-glibc/bits/mman.h b/lib/libc/include/generic-glibc/bits/mman.h index 4319c54436..dc24c1d773 100644 --- a/lib/libc/include/generic-glibc/bits/mman.h +++ b/lib/libc/include/generic-glibc/bits/mman.h @@ -1,5 +1,5 @@ -/* Definitions for POSIX memory map interface. Linux/x86_64 version. - Copyright (C) 2001-2020 Free Software Foundation, Inc. +/* Definitions for POSIX memory map interface. Linux/generic version. + Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,20 +13,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif -/* The following definitions basically come from the kernel headers. - But the kernel header is not namespace clean. */ - -/* Other flags. */ -#ifdef __USE_MISC -# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */ -#endif +/* These definitions are appropriate for architectures that, in the + Linux kernel, either have no uapi/asm/mman.h, or have one that + includes asm-generic/mman.h without any changes or additions + relevant to glibc. If there are additions relevant to glibc, an + architecture-specific bits/mman.h is needed. */ #include diff --git a/lib/libc/include/generic-glibc/bits/msq-pad.h b/lib/libc/include/generic-glibc/bits/msq-pad.h new file mode 100644 index 0000000000..5cc786f0d3 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. Generic version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +/* On most architectures, padding goes after time fields for 32-bit + systems and is omitted for 64-bit systems. Some architectures pad + before time fields instead, or omit padding despite being + 32-bit. */ + +#define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +#define __MSQ_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/msq.h b/lib/libc/include/generic-glibc/bits/msq.h index 7c8dba0eca..98efc613d1 100644 --- a/lib/libc/include/generic-glibc/bits/msq.h +++ b/lib/libc/include/generic-glibc/bits/msq.h @@ -20,12 +20,7 @@ #endif #include - -/* Types used in the MSQID_DS structure definition. */ -typedef __syscall_ulong_t msgqnum_t; -typedef __syscall_ulong_t msglen_t; - -#include +#include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ @@ -34,6 +29,38 @@ typedef __syscall_ulong_t msglen_t; # define MSG_COPY 040000 /* copy (not remove) all queue messages */ #endif +/* Types used in the structure definition. */ +typedef __syscall_ulong_t msgqnum_t; +typedef __syscall_ulong_t msglen_t; + +#if __MSQ_PAD_BEFORE_TIME +# define __MSQ_PAD_TIME(NAME, RES) \ + unsigned long int __glibc_reserved ## RES; __time_t NAME +#elif __MSQ_PAD_AFTER_TIME +# define __MSQ_PAD_TIME(NAME, RES) \ + __time_t NAME; unsigned long int __glibc_reserved ## RES +#else +# define __MSQ_PAD_TIME(NAME, RES) \ + __time_t NAME +#endif + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ + __MSQ_PAD_TIME (msg_stime, 1); /* time of last msgsnd command */ + __MSQ_PAD_TIME (msg_rtime, 2); /* time of last msgrcv command */ + __MSQ_PAD_TIME (msg_ctime, 3); /* time of last change */ + __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + __syscall_ulong_t __glibc_reserved4; + __syscall_ulong_t __glibc_reserved5; +}; + #ifdef __USE_MISC # define msg_cbytes __msg_cbytes diff --git a/lib/libc/include/generic-glibc/bits/procfs-id.h b/lib/libc/include/generic-glibc/bits/procfs-id.h index 4f4cefeb4b..38906b6303 100644 --- a/lib/libc/include/generic-glibc/bits/procfs-id.h +++ b/lib/libc/include/generic-glibc/bits/procfs-id.h @@ -1,4 +1,4 @@ -/* Types of pr_uid and pr_gid in struct elf_prpsinfo. x86 version. +/* Types of pr_uid and pr_gid in struct elf_prpsinfo. Generic Linux version. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,10 +21,5 @@ # error "Never include directly; use instead." #endif -#if __WORDSIZE == 32 -typedef unsigned short int __pr_uid_t; -typedef unsigned short int __pr_gid_t; -#else typedef unsigned int __pr_uid_t; -typedef unsigned int __pr_gid_t; -#endif \ No newline at end of file +typedef unsigned int __pr_gid_t; \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/procfs.h b/lib/libc/include/generic-glibc/bits/procfs.h index 1f4ca5a0f0..66a5f6726b 100644 --- a/lib/libc/include/generic-glibc/bits/procfs.h +++ b/lib/libc/include/generic-glibc/bits/procfs.h @@ -1,5 +1,5 @@ -/* Types for registers for sys/procfs.h. x86 version. - Copyright (C) 2001-2020 Free Software Foundation, Inc. +/* Types for registers for sys/procfs.h. MIPS version. + Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,38 +13,25 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -/* Type for a general-purpose register. */ -#ifdef __x86_64__ +#include + +/* ELF register definitions */ +#define ELF_NGREG 45 +#define ELF_NFPREG 33 + +#if _MIPS_SIM == _ABIN32 __extension__ typedef unsigned long long elf_greg_t; #else typedef unsigned long elf_greg_t; #endif - -/* And the whole bunch of them. We could have used `struct - user_regs_struct' directly in the typedef, but tradition says that - the register set is an array, which does have some peculiar - semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -#ifndef __x86_64__ -/* Register set for the floating-point registers. */ -typedef struct user_fpregs_struct elf_fpregset_t; - -/* Register set for the extended floating-point registers. Includes - the Pentium III SSE registers in addition to the classic - floating-point stuff. */ -typedef struct user_fpxregs_struct elf_fpxregset_t; -#else -/* Register set for the extended floating-point registers. Includes - the Pentium III SSE registers in addition to the classic - floating-point stuff. */ -typedef struct user_fpregs_struct elf_fpregset_t; -#endif \ No newline at end of file +typedef double elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h b/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h index 147ce690db..549deac37b 100644 --- a/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h +++ b/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h @@ -1,4 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Machine-specific pthread type layouts. Generic version. + Copyright (C) 2019-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,43 +15,31 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ #ifndef _BITS_PTHREADTYPES_ARCH_H #define _BITS_PTHREADTYPES_ARCH_H 1 #include -#ifdef __x86_64__ -# if __WORDSIZE == 64 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_BARRIER_T 32 -# else -# define __SIZEOF_PTHREAD_MUTEX_T 32 -# define __SIZEOF_PTHREAD_ATTR_T 32 -# define __SIZEOF_PTHREAD_RWLOCK_T 44 -# define __SIZEOF_PTHREAD_BARRIER_T 20 -# endif +#if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 #else -# define __SIZEOF_PTHREAD_MUTEX_T 24 -# define __SIZEOF_PTHREAD_ATTR_T 36 -# define __SIZEOF_PTHREAD_RWLOCK_T 32 -# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 #endif -#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -#define __SIZEOF_PTHREAD_COND_T 48 -#define __SIZEOF_PTHREAD_CONDATTR_T 4 -#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT -#ifndef __x86_64__ -/* Extra attributes for the cleanup functions. */ -# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) -#endif - #endif /* bits/pthreadtypes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/resource.h b/lib/libc/include/generic-glibc/bits/resource.h index f5b55f6a7c..6f4ec334ac 100644 --- a/lib/libc/include/generic-glibc/bits/resource.h +++ b/lib/libc/include/generic-glibc/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/generic-glibc/bits/sem-pad.h b/lib/libc/include/generic-glibc/bits/sem-pad.h new file mode 100644 index 0000000000..92c1bab60a --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/sem-pad.h @@ -0,0 +1,33 @@ +/* Define where padding goes in struct semid_ds. Generic version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#include + +/* On most architectures, padding goes after time fields for 32-bit + systems and is omitted for 64-bit systems. Some architectures pad + before time fields instead, or omit padding despite being 32-bit, + or include it despite being 64-bit. This must match the layout + used for struct semid64_ds in , as glibc does not do + layout conversions for this structure. */ + +#define __SEM_PAD_AFTER_TIME (__TIMESIZE == 32) +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sem.h b/lib/libc/include/generic-glibc/bits/sem.h index 67c394015a..b352aa0cbb 100644 --- a/lib/libc/include/generic-glibc/bits/sem.h +++ b/lib/libc/include/generic-glibc/bits/sem.h @@ -20,8 +20,7 @@ #endif #include -#include -#include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ @@ -35,6 +34,29 @@ #define SETVAL 16 /* set semval */ #define SETALL 17 /* set all semval's */ + +#if __SEM_PAD_BEFORE_TIME +# define __SEM_PAD_TIME(NAME, RES) \ + __syscall_ulong_t __glibc_reserved ## RES; __time_t NAME +#elif __SEM_PAD_AFTER_TIME +# define __SEM_PAD_TIME(NAME, RES) \ + __time_t NAME; __syscall_ulong_t __glibc_reserved ## RES +#else +# define __SEM_PAD_TIME(NAME, RES) \ + __time_t NAME +#endif + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __SEM_PAD_TIME (sem_otime, 1); /* last semop() time */ + __SEM_PAD_TIME (sem_ctime, 2); /* last time changed by semctl() */ + __syscall_ulong_t sem_nsems; /* number of semaphores in set */ + __syscall_ulong_t __glibc_reserved3; + __syscall_ulong_t __glibc_reserved4; +}; + /* The user should define a union like the following to use it for arguments for `semctl'. diff --git a/lib/libc/include/generic-glibc/bits/semaphore.h b/lib/libc/include/generic-glibc/bits/semaphore.h index 97292723c8..e28b319eb5 100644 --- a/lib/libc/include/generic-glibc/bits/semaphore.h +++ b/lib/libc/include/generic-glibc/bits/semaphore.h @@ -1,5 +1,4 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,16 +12,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#include - -#if __WORDSIZE == 64 +#if _MIPS_SIM == _ABI64 # define __SIZEOF_SEM_T 32 #else # define __SIZEOF_SEM_T 16 diff --git a/lib/libc/include/generic-glibc/bits/setjmp.h b/lib/libc/include/generic-glibc/bits/setjmp.h index 18d620397d..7fefe88f62 100644 --- a/lib/libc/include/generic-glibc/bits/setjmp.h +++ b/lib/libc/include/generic-glibc/bits/setjmp.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2001-2020 Free Software Foundation, Inc. +/* Define the machine-dependent type `jmp_buf'. MIPS version. + Copyright (C) 1992-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,29 +13,61 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ -/* Define the machine-dependent type `jmp_buf'. x86-64 version. */ -#ifndef _BITS_SETJMP_H -#define _BITS_SETJMP_H 1 +#ifndef _MIPS_BITS_SETJMP_H +#define _MIPS_BITS_SETJMP_H 1 -#if !defined _SETJMP_H && !defined _PTHREAD_H +#if !defined(_SETJMP_H) && !defined(_PTHREAD_H) # error "Never include directly; use instead." #endif -#include +#include -#ifndef _ASM +typedef struct __jmp_buf_internal_tag + { +#if _MIPS_SIM == _ABIO32 + /* Program counter. */ + void *__pc; -# if __WORDSIZE == 64 -typedef long int __jmp_buf[8]; -# elif defined __x86_64__ -__extension__ typedef long long int __jmp_buf[8]; -# else -typedef int __jmp_buf[6]; -# endif + /* Stack pointer. */ + void *__sp; + /* Callee-saved registers s0 through s7. */ + int __regs[8]; + + /* The frame pointer. */ + void *__fp; + + /* The global pointer. */ + void *__gp; +#else + /* Program counter. */ + __extension__ long long __pc; + + /* Stack pointer. */ + __extension__ long long __sp; + + /* Callee-saved registers s0 through s7. */ + __extension__ long long __regs[8]; + + /* The frame pointer. */ + __extension__ long long __fp; + + /* The global pointer. */ + __extension__ long long __gp; #endif -#endif /* bits/setjmp.h */ \ No newline at end of file + /* Unused (was floating point status register). */ + int __glibc_reserved1; + + /* Callee-saved floating point registers. */ +#if _MIPS_SIM == _ABI64 + double __fpregs[8]; +#else + double __fpregs[6]; +#endif + } __jmp_buf[1]; + +#endif /* _MIPS_BITS_SETJMP_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/shm-pad.h b/lib/libc/include/generic-glibc/bits/shm-pad.h new file mode 100644 index 0000000000..e214cd6e6b --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/shm-pad.h @@ -0,0 +1,37 @@ +/* Define where padding goes in struct shmid_ds. Generic version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#include + +/* On most architectures, padding goes after time fields for 32-bit + systems and is omitted for 64-bit systems. Some architectures pad + before time fields instead, or omit padding despite being 32-bit, + or include it despite being 64-bit. Furthermore, some + architectures place shm_segsz after the time fields rather than + before them, with or without padding there. This must match the + layout used for struct shmid64_ds in , as glibc does + not do layout conversions for this structure. */ + +#define __SHM_PAD_AFTER_TIME (__TIMESIZE == 32) +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/shm.h b/lib/libc/include/generic-glibc/bits/shm.h index e5de42e2ab..97e4d577e0 100644 --- a/lib/libc/include/generic-glibc/bits/shm.h +++ b/lib/libc/include/generic-glibc/bits/shm.h @@ -22,6 +22,7 @@ #include #include #include +#include /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from */ @@ -42,7 +43,39 @@ __BEGIN_DECLS /* Type to count number of attaches. */ typedef __syscall_ulong_t shmatt_t; -#include +#if __SHM_PAD_BEFORE_TIME +# define __SHM_PAD_TIME(NAME, RES) \ + unsigned long int __glibc_reserved ## RES; __time_t NAME +#elif __SHM_PAD_AFTER_TIME +# define __SHM_PAD_TIME(NAME, RES) \ + __time_t NAME; unsigned long int __glibc_reserved ## RES +#else +# define __SHM_PAD_TIME(NAME, RES) \ + __time_t NAME +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ +#if !__SHM_SEGSZ_AFTER_TIME + size_t shm_segsz; /* size of segment in bytes */ +#endif + __SHM_PAD_TIME (shm_atime, 1); /* time of last shmat() */ + __SHM_PAD_TIME (shm_dtime, 2); /* time of last shmdt() */ + __SHM_PAD_TIME (shm_ctime, 3); /* time of last change by shmctl() */ +#if __SHM_PAD_BETWEEN_TIME_AND_SEGSZ + unsigned long int __glibc_reserved4; +#endif +#if __SHM_SEGSZ_AFTER_TIME + size_t shm_segsz; /* size of segment in bytes */ +#endif + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + __syscall_ulong_t __glibc_reserved5; + __syscall_ulong_t __glibc_reserved6; + }; #ifdef __USE_MISC diff --git a/lib/libc/include/generic-glibc/bits/sigcontext.h b/lib/libc/include/generic-glibc/bits/sigcontext.h index 7498f87f91..4496148619 100644 --- a/lib/libc/include/generic-glibc/bits/sigcontext.h +++ b/lib/libc/include/generic-glibc/bits/sigcontext.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -8,7 +8,7 @@ The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -16,181 +16,22 @@ . */ #ifndef _BITS_SIGCONTEXT_H -#define _BITS_SIGCONTEXT_H 1 +#define _BITS_SIGCONTEXT_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use directly; include instead." #endif -#include - -#define FP_XSTATE_MAGIC1 0x46505853U -#define FP_XSTATE_MAGIC2 0x46505845U -#define FP_XSTATE_MAGIC2_SIZE sizeof (FP_XSTATE_MAGIC2) - -struct _fpx_sw_bytes -{ - __uint32_t magic1; - __uint32_t extended_size; - __uint64_t xstate_bv; - __uint32_t xstate_size; - __uint32_t __glibc_reserved1[7]; -}; - -struct _fpreg -{ - unsigned short significand[4]; - unsigned short exponent; -}; - -struct _fpxreg -{ - unsigned short significand[4]; - unsigned short exponent; - unsigned short __glibc_reserved1[3]; -}; - -struct _xmmreg -{ - __uint32_t element[4]; -}; - - - -#ifndef __x86_64__ - -struct _fpstate -{ - /* Regular FPU environment. */ - __uint32_t cw; - __uint32_t sw; - __uint32_t tag; - __uint32_t ipoff; - __uint32_t cssel; - __uint32_t dataoff; - __uint32_t datasel; - struct _fpreg _st[8]; - unsigned short status; - unsigned short magic; - - /* FXSR FPU environment. */ - __uint32_t _fxsr_env[6]; - __uint32_t mxcsr; - __uint32_t __glibc_reserved1; - struct _fpxreg _fxsr_st[8]; - struct _xmmreg _xmm[8]; - __uint32_t __glibc_reserved2[56]; -}; - #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. Some packages have come to rely on - sigcontext_struct being defined on 32-bit x86, so define this for - their benefit. */ + we need sigcontext. */ # define sigcontext_struct sigcontext + +# include + +/* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */ +# define __need_NULL +# include #endif -#define X86_FXSR_MAGIC 0x0000 - -struct sigcontext -{ - unsigned short gs, __gsh; - unsigned short fs, __fsh; - unsigned short es, __esh; - unsigned short ds, __dsh; - unsigned long edi; - unsigned long esi; - unsigned long ebp; - unsigned long esp; - unsigned long ebx; - unsigned long edx; - unsigned long ecx; - unsigned long eax; - unsigned long trapno; - unsigned long err; - unsigned long eip; - unsigned short cs, __csh; - unsigned long eflags; - unsigned long esp_at_signal; - unsigned short ss, __ssh; - struct _fpstate * fpstate; - unsigned long oldmask; - unsigned long cr2; -}; - -#else /* __x86_64__ */ - -struct _fpstate -{ - /* FPU environment matching the 64-bit FXSAVE layout. */ - __uint16_t cwd; - __uint16_t swd; - __uint16_t ftw; - __uint16_t fop; - __uint64_t rip; - __uint64_t rdp; - __uint32_t mxcsr; - __uint32_t mxcr_mask; - struct _fpxreg _st[8]; - struct _xmmreg _xmm[16]; - __uint32_t __glibc_reserved1[24]; -}; - -struct sigcontext -{ - __uint64_t r8; - __uint64_t r9; - __uint64_t r10; - __uint64_t r11; - __uint64_t r12; - __uint64_t r13; - __uint64_t r14; - __uint64_t r15; - __uint64_t rdi; - __uint64_t rsi; - __uint64_t rbp; - __uint64_t rbx; - __uint64_t rdx; - __uint64_t rax; - __uint64_t rcx; - __uint64_t rsp; - __uint64_t rip; - __uint64_t eflags; - unsigned short cs; - unsigned short gs; - unsigned short fs; - unsigned short __pad0; - __uint64_t err; - __uint64_t trapno; - __uint64_t oldmask; - __uint64_t cr2; - __extension__ union - { - struct _fpstate * fpstate; - __uint64_t __fpstate_word; - }; - __uint64_t __reserved1 [8]; -}; - -#endif /* __x86_64__ */ - -struct _xsave_hdr -{ - __uint64_t xstate_bv; - __uint64_t __glibc_reserved1[2]; - __uint64_t __glibc_reserved2[5]; -}; - -struct _ymmh_state -{ - __uint32_t ymmh_space[64]; -}; - -struct _xstate -{ - struct _fpstate fpstate; - struct _xsave_hdr xstate_hdr; - struct _ymmh_state ymmh; -}; - -#endif /* _BITS_SIGCONTEXT_H */ \ No newline at end of file +#endif /* bits/sigcontext.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/siginfo-arch.h b/lib/libc/include/generic-glibc/bits/siginfo-arch.h index 0f430f0772..59cd9e3066 100644 --- a/lib/libc/include/generic-glibc/bits/siginfo-arch.h +++ b/lib/libc/include/generic-glibc/bits/siginfo-arch.h @@ -1,17 +1,7 @@ -/* Architecture-specific adjustments to siginfo_t. x86 version. */ +/* Architecture-specific adjustments to siginfo_t. */ #ifndef _BITS_SIGINFO_ARCH_H #define _BITS_SIGINFO_ARCH_H 1 -#if defined __x86_64__ && __WORDSIZE == 32 -/* si_utime and si_stime must be 4 byte aligned for x32 to match the - kernel. We align siginfo_t to 8 bytes so that si_utime and - si_stime are actually aligned to 8 bytes since their offsets are - multiple of 8 bytes. Note: with some compilers, the alignment - attribute would be ignored if it were put in __SI_CLOCK_T instead - of encapsulated in a typedef. */ -typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t; -# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) -# define __SI_CLOCK_T __sigchld_clock_t -#endif +/* This architecture has no adjustments to make to siginfo_t. */ #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/signum-generic.h b/lib/libc/include/generic-glibc/bits/signum-generic.h index eddb633837..fc31cf9cff 100644 --- a/lib/libc/include/generic-glibc/bits/signum-generic.h +++ b/lib/libc/include/generic-glibc/bits/signum-generic.h @@ -57,9 +57,31 @@ #define SIGQUIT 3 /* Quit. */ #define SIGTRAP 5 /* Trace/breakpoint trap. */ #define SIGKILL 9 /* Killed. */ +#define SIGBUS 10 /* Bus error. */ +#define SIGSYS 12 /* Bad system call. */ #define SIGPIPE 13 /* Broken pipe. */ #define SIGALRM 14 /* Alarm clock. */ +/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ +#define SIGURG 16 /* Urgent data is available at a socket. */ +#define SIGSTOP 17 /* Stop, unblockable. */ +#define SIGTSTP 18 /* Keyboard stop. */ +#define SIGCONT 19 /* Continue. */ +#define SIGCHLD 20 /* Child terminated or stopped. */ +#define SIGTTIN 21 /* Background read from control terminal. */ +#define SIGTTOU 22 /* Background write to control terminal. */ +#define SIGPOLL 23 /* Pollable event occurred (System V). */ +#define SIGXCPU 24 /* CPU time limit exceeded. */ +#define SIGXFSZ 25 /* File size limit exceeded. */ +#define SIGVTALRM 26 /* Virtual timer expired. */ +#define SIGPROF 27 /* Profiling timer expired. */ +#define SIGUSR1 30 /* User-defined signal 1. */ +#define SIGUSR2 31 /* User-defined signal 2. */ + +/* Nonstandard signals found in all modern POSIX systems + (including both BSD and Linux). */ +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ + /* Archaic names for compatibility. */ #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ @@ -71,9 +93,8 @@ but some real-time signals may be used internally by glibc. Do not use these constants in application code; use SIGRTMIN and SIGRTMAX (defined in signal.h) instead. */ - -/* Include system specific bits. */ -#include +#define __SIGRTMIN 32 +#define __SIGRTMAX __SIGRTMIN /* Biggest signal number + 1 (including real-time signals). */ #define _NSIG (__SIGRTMAX + 1) diff --git a/lib/libc/include/generic-glibc/bits/signum.h b/lib/libc/include/generic-glibc/bits/signum.h new file mode 100644 index 0000000000..a549ca0204 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/signum.h @@ -0,0 +1,58 @@ +/* Signal number definitions. Linux version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + most Linux systems. */ + +#define SIGSTKFLT 16 /* Stack fault (obsolete). */ +#define SIGPWR 30 /* Power failure imminent. */ + +#undef SIGBUS +#define SIGBUS 7 +#undef SIGUSR1 +#define SIGUSR1 10 +#undef SIGUSR2 +#define SIGUSR2 12 +#undef SIGCHLD +#define SIGCHLD 17 +#undef SIGCONT +#define SIGCONT 18 +#undef SIGSTOP +#define SIGSTOP 19 +#undef SIGTSTP +#define SIGTSTP 20 +#undef SIGURG +#define SIGURG 23 +#undef SIGPOLL +#define SIGPOLL 29 +#undef SIGSYS +#define SIGSYS 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 64 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/socket-constants.h b/lib/libc/include/generic-glibc/bits/socket-constants.h index 93fd5d7548..1781053c77 100644 --- a/lib/libc/include/generic-glibc/bits/socket-constants.h +++ b/lib/libc/include/generic-glibc/bits/socket-constants.h @@ -20,8 +20,6 @@ # error "Never include directly; use instead." #endif -#include - #define SOL_SOCKET 1 #define SO_ACCEPTCONN 30 #define SO_BROADCAST 6 @@ -32,19 +30,9 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 18 -#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ - && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) -# define SO_RCVTIMEO 66 -#else -# define SO_RCVTIMEO 20 -#endif +#define SO_RCVTIMEO 20 #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 19 -#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ - && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) -# define SO_SNDTIMEO 67 -#else -# define SO_SNDTIMEO 21 -#endif +#define SO_SNDTIMEO 21 #define SO_TYPE 3 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stat.h b/lib/libc/include/generic-glibc/bits/stat.h index ab5378300a..b298b3f336 100644 --- a/lib/libc/include/generic-glibc/bits/stat.h +++ b/lib/libc/include/generic-glibc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2020 Free Software Foundation, Inc. +/* Copyright (C) 1992-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,7 +12,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #if !defined _SYS_STAT_H && !defined _FCNTL_H @@ -22,64 +22,45 @@ #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 +#include + /* Versions of the `struct stat' data structure. */ -#ifndef __x86_64__ -# define _STAT_VER_LINUX_OLD 1 -# define _STAT_VER_KERNEL 1 -# define _STAT_VER_SVR4 2 -# define _STAT_VER_LINUX 3 +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_KERNEL 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ -/* i386 versions of the `xmknod' interface. */ -# define _MKNOD_VER_LINUX 1 -# define _MKNOD_VER_SVR4 2 -# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ -#else -# define _STAT_VER_KERNEL 0 -# define _STAT_VER_LINUX 1 +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ -/* x86-64 versions of the `xmknod' interface. */ -# define _MKNOD_VER_LINUX 0 -#endif - -#define _STAT_VER _STAT_VER_LINUX +#if _MIPS_SIM == _ABIO32 +/* Structure describing file characteristics. */ struct stat { - __dev_t st_dev; /* Device. */ -#ifndef __x86_64__ - unsigned short int __pad1; -#endif -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ + unsigned long int st_dev; + long int st_pad1[3]; +#ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ #else - __ino_t __st_ino; /* 32bit file serial number. */ + __ino64_t st_ino; /* File serial number. */ #endif -#ifndef __x86_64__ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ -#else - __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ -#endif + __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -#ifdef __x86_64__ - int __pad0; -#endif - __dev_t st_rdev; /* Device number, if device. */ -#ifndef __x86_64__ - unsigned short int __pad2; -#endif -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 - __off_t st_size; /* Size of file, in bytes. */ + unsigned long int st_rdev; /* Device number, if device. */ +#ifndef __USE_FILE_OFFSET64 + long int st_pad2[2]; + __off_t st_size; /* Size of file, in bytes. */ + /* SVR4 added this extra long to allow for expansion of off_t. */ + long int st_pad3; #else - __off64_t st_size; /* Size of file, in bytes. */ -#endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ + long int st_pad2[3]; + __off64_t st_size; /* Size of file, in bytes. */ #endif #ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format @@ -88,60 +69,43 @@ struct stat identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ # define st_mtime st_mtim.tv_sec # define st_ctime st_ctim.tv_sec #else __time_t st_atime; /* Time of last access. */ - __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ - __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ - __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ #endif -#ifdef __x86_64__ - __syscall_slong_t __glibc_reserved[3]; + __blksize_t st_blksize; /* Optimal block size for I/O. */ +#ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ #else -# ifndef __USE_FILE_OFFSET64 - unsigned long int __glibc_reserved4; - unsigned long int __glibc_reserved5; -# else - __ino64_t st_ino; /* File serial number. */ -# endif + long int st_pad4; + __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ #endif + long int st_pad5[14]; }; #ifdef __USE_LARGEFILE64 -/* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { - __dev_t st_dev; /* Device. */ -# ifdef __x86_64__ - __ino64_t st_ino; /* File serial number. */ - __nlink_t st_nlink; /* Link count. */ + unsigned long int st_dev; + long int st_pad1[3]; + __ino64_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ -# else - unsigned int __pad1; - __ino_t __st_ino; /* 32bit file serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ -# endif + __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -# ifdef __x86_64__ - int __pad0; - __dev_t st_rdev; /* Device number, if device. */ - __off_t st_size; /* Size of file, in bytes. */ -# else - __dev_t st_rdev; /* Device number, if device. */ - unsigned int __pad2; - __off64_t st_size; /* Size of file, in bytes. */ -# endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ - __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ + unsigned long int st_rdev; /* Device number, if device. */ + long int st_pad2[3]; + __off64_t st_size; /* Size of file, in bytes. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used @@ -149,30 +113,119 @@ struct stat64 identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ # else __time_t st_atime; /* Time of last access. */ - __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ - __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ - __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ -# endif -# ifdef __x86_64__ - __syscall_slong_t __glibc_reserved[3]; -# else - __ino64_t st_ino; /* File serial number. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + long int st_pad3; + __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ + long int st_pad4[14]; }; #endif +#else +struct stat + { + __dev_t st_dev; + int st_pad1[3]; /* Reserved for st_dev expansion */ +#ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; +#else + __ino64_t st_ino; +#endif + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; +#if !defined __USE_FILE_OFFSET64 + unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ + __off_t st_size; + int st_pad3; +#else + unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ + __off64_t st_size; +#endif +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + __blksize_t st_blksize; + unsigned int st_pad4; +#ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; +#else + __blkcnt64_t st_blocks; +#endif + int st_pad5[14]; + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; + unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ + __ino64_t st_ino; + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ + __off64_t st_size; +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; + unsigned int st_pad3; + __blkcnt64_t st_blocks; + int st_pad4[14]; +}; +#endif +#endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV -/* Nanosecond resolution time values are supported. */ -#define _STATBUF_ST_NSEC +#define _STATBUF_ST_RDEV /* Encoding of the file mode. */ diff --git a/lib/libc/include/generic-glibc/bits/statx-generic.h b/lib/libc/include/generic-glibc/bits/statx-generic.h index f0d8e4d846..e277c97c32 100644 --- a/lib/libc/include/generic-glibc/bits/statx-generic.h +++ b/lib/libc/include/generic-glibc/bits/statx-generic.h @@ -48,7 +48,6 @@ # define STATX_ATTR_NODUMP 0x0040 # define STATX_ATTR_ENCRYPTED 0x0800 # define STATX_ATTR_AUTOMOUNT 0x1000 -# define STATX_ATTR_VERITY 0x100000 #endif /* !STATX_TYPE */ __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h index f74840c8b6..1e6a0edf64 100644 --- a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h @@ -27,17 +27,9 @@ __LDBL_REDIR_DECL (vfprintf) __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) #if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -__LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128) -__LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128) -__LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128) -# else -# error bits/stdlib-ldbl.h included when no ldbl redirections are required. -# endif #else __LDBL_REDIR_DECL (fscanf) __LDBL_REDIR_DECL (scanf) @@ -51,17 +43,9 @@ __LDBL_REDIR_DECL (vsnprintf) #ifdef __USE_ISOC99 # if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -__LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128) -__LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128) -__LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128) -# else -# error bits/stdlib-ldbl.h included when no ldbl redirections are required. -# endif # else __LDBL_REDIR_DECL (vfscanf) __LDBL_REDIR_DECL (vsscanf) @@ -76,33 +60,33 @@ __LDBL_REDIR_DECL (dprintf) #ifdef __USE_GNU __LDBL_REDIR_DECL (vasprintf) -__LDBL_REDIR2_DECL (asprintf) +__LDBL_REDIR_DECL (__asprintf) __LDBL_REDIR_DECL (asprintf) __LDBL_REDIR_DECL (obstack_printf) __LDBL_REDIR_DECL (obstack_vprintf) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR2_DECL (sprintf_chk) -__LDBL_REDIR2_DECL (vsprintf_chk) +__LDBL_REDIR_DECL (__sprintf_chk) +__LDBL_REDIR_DECL (__vsprintf_chk) # if defined __USE_ISOC99 || defined __USE_UNIX98 -__LDBL_REDIR2_DECL (snprintf_chk) -__LDBL_REDIR2_DECL (vsnprintf_chk) +__LDBL_REDIR_DECL (__snprintf_chk) +__LDBL_REDIR_DECL (__vsnprintf_chk) # endif # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR2_DECL (fprintf_chk) -__LDBL_REDIR2_DECL (printf_chk) -__LDBL_REDIR2_DECL (vfprintf_chk) -__LDBL_REDIR2_DECL (vprintf_chk) +__LDBL_REDIR_DECL (__fprintf_chk) +__LDBL_REDIR_DECL (__printf_chk) +__LDBL_REDIR_DECL (__vfprintf_chk) +__LDBL_REDIR_DECL (__vprintf_chk) # ifdef __USE_XOPEN2K8 -__LDBL_REDIR2_DECL (dprintf_chk) -__LDBL_REDIR2_DECL (vdprintf_chk) +__LDBL_REDIR_DECL (__dprintf_chk) +__LDBL_REDIR_DECL (__vdprintf_chk) # endif # ifdef __USE_GNU -__LDBL_REDIR2_DECL (asprintf_chk) -__LDBL_REDIR2_DECL (vasprintf_chk) -__LDBL_REDIR2_DECL (obstack_printf_chk) -__LDBL_REDIR2_DECL (obstack_vprintf_chk) +__LDBL_REDIR_DECL (__asprintf_chk) +__LDBL_REDIR_DECL (__vasprintf_chk) +__LDBL_REDIR_DECL (__obstack_printf_chk) +__LDBL_REDIR_DECL (__obstack_vprintf_chk) # endif # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stdio2.h b/lib/libc/include/generic-glibc/bits/stdio2.h index b6b568ad96..32e4a4b64a 100644 --- a/lib/libc/include/generic-glibc/bits/stdio2.h +++ b/lib/libc/include/generic-glibc/bits/stdio2.h @@ -24,12 +24,10 @@ #endif extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, - const char *__restrict __format, ...) __THROW - __attr_access ((__write_only__, 1, 3)); + const char *__restrict __format, ...) __THROW; extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, - __gnuc_va_list __ap) __THROW - __attr_access ((__write_only__, 1, 3)); + __gnuc_va_list __ap) __THROW; #ifdef __va_arg_pack __fortify_function int @@ -56,8 +54,7 @@ __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, - ...) __THROW - __attr_access ((__write_only__, 1, 2)); + ...) __THROW; extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __THROW; @@ -244,19 +241,17 @@ gets (char *__str) #endif extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, - FILE *__restrict __stream) - __wur __attr_access ((__write_only__, 1, 3)); + FILE *__restrict __stream) __wur; extern char *__REDIRECT (__fgets_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets) - __wur __attr_access ((__write_only__, 1, 2)); + FILE *__restrict __stream), fgets) __wur; extern char *__REDIRECT (__fgets_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_chk) __wur __warnattr ("fgets called with bigger size than length " "of destination buffer"); -__fortify_function __wur __attr_access ((__write_only__, 1, 2)) char * +__fortify_function __wur char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) != (size_t) -1) @@ -304,19 +299,17 @@ fread (void *__restrict __ptr, size_t __size, size_t __n, #ifdef __USE_GNU extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size, - int __n, FILE *__restrict __stream) - __wur __attr_access ((__write_only__, 1, 3)); + int __n, FILE *__restrict __stream) __wur; extern char *__REDIRECT (__fgets_unlocked_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets_unlocked) - __wur __attr_access ((__write_only__, 1, 2)); + FILE *__restrict __stream), fgets_unlocked) __wur; extern char *__REDIRECT (__fgets_unlocked_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_unlocked_chk) __wur __warnattr ("fgets_unlocked called with bigger size than length " "of destination buffer"); -__fortify_function __wur __attr_access ((__write_only__, 1, 2)) char * +__fortify_function __wur char * fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) != (size_t) -1) diff --git a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h index 185b83dde3..b4c4abe997 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h @@ -21,43 +21,21 @@ #endif #ifdef __USE_ISOC99 -# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold, strtod) -# else -__LDBL_REDIR1_DECL (strtold, __strtoieee128) -# endif #endif #ifdef __USE_GNU -# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold_l, strtod_l) -# else -__LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l) -# endif #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) -# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strfroml, strfromd) -# else -__LDBL_REDIR1_DECL (strfroml, __strfromieee128) -# endif #endif #ifdef __USE_MISC -# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (qecvt, ecvt) __LDBL_REDIR1_DECL (qfcvt, fcvt) __LDBL_REDIR1_DECL (qgcvt, gcvt) __LDBL_REDIR1_DECL (qecvt_r, ecvt_r) __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -__LDBL_REDIR1_DECL (qecvt, __qecvtieee128) -__LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128) -__LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128) -__LDBL_REDIR1_DECL (qecvt_r, __qecvtieee128_r) -__LDBL_REDIR1_DECL (qfcvt_r, __qfcvtieee128_r) -# else -# error bits/stdlib-ldbl.h included when no ldbl redirections are required. -# endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stdlib.h b/lib/libc/include/generic-glibc/bits/stdlib.h index 92b27c5534..d6fb14eb32 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib.h +++ b/lib/libc/include/generic-glibc/bits/stdlib.h @@ -50,11 +50,10 @@ __NTH (realpath (const char *__restrict __name, char *__restrict __resolved)) extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)) - __attr_access ((__write_only__, 2, 3)); + size_t __nreal) __THROW __nonnull ((2)); extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, size_t __buflen), ptsname_r) - __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); + __nonnull ((2)); extern int __REDIRECT_NTH (__ptsname_r_chk_warn, (int __fd, char *__buf, size_t __buflen, size_t __nreal), __ptsname_r_chk) @@ -98,13 +97,11 @@ __NTH (wctomb (char *__s, wchar_t __wchar)) extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len, size_t __dstlen) __THROW - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + size_t __len, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__mbstowcs_alias, (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len), mbstowcs) - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + size_t __len), mbstowcs); extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, (wchar_t *__restrict __dst, const char *__restrict __src, @@ -132,13 +129,11 @@ __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, extern size_t __wcstombs_chk (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len, size_t __dstlen) __THROW - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + size_t __len, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__wcstombs_alias, (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len), wcstombs) - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + size_t __len), wcstombs); extern size_t __REDIRECT_NTH (__wcstombs_chk_warn, (char *__restrict __dst, const wchar_t *__restrict __src, diff --git a/lib/libc/include/generic-glibc/bits/string_fortified.h b/lib/libc/include/generic-glibc/bits/string_fortified.h index 0ec88c36a4..f516808da3 100644 --- a/lib/libc/include/generic-glibc/bits/string_fortified.h +++ b/lib/libc/include/generic-glibc/bits/string_fortified.h @@ -75,7 +75,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len)) # include void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen) - __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); + __THROW __nonnull ((1)); __fortify_function void __NTH (explicit_bzero (void *__dest, size_t __len)) @@ -108,8 +108,7 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, /* XXX We have no corresponding builtin yet. */ extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, - size_t __destlen) __THROW - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + size_t __destlen) __THROW; extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, size_t __n), stpncpy); diff --git a/lib/libc/include/generic-glibc/bits/struct_mutex.h b/lib/libc/include/generic-glibc/bits/struct_mutex.h index 44273158be..092f4ee080 100644 --- a/lib/libc/include/generic-glibc/bits/struct_mutex.h +++ b/lib/libc/include/generic-glibc/bits/struct_mutex.h @@ -1,4 +1,4 @@ -/* x86 internal mutex struct definitions. +/* Default mutex implementation struct definitions. Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -19,45 +19,66 @@ #ifndef _THREAD_MUTEX_INTERNAL_H #define _THREAD_MUTEX_INTERNAL_H 1 +/* Generic struct for both POSIX and C11 mutexes. New ports are expected + to use the default layout, however architecture can redefine it to + add arch-specific extension (such as lock-elision). The struct have + a size of 32 bytes on LP32 and 40 bytes on LP64 architectures. */ + struct __pthread_mutex_s { - int __lock; + int __lock __LOCK_ALIGNMENT; unsigned int __count; int __owner; -#ifdef __x86_64__ +#if __WORDSIZE == 64 unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility with static initializers. */ + binary compatibility with static initializers. + + Concurrency notes: + The __kind of a mutex is initialized either by the static + PTHREAD_MUTEX_INITIALIZER or by a call to pthread_mutex_init. + + After a mutex has been initialized, the __kind of a mutex is usually not + changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can + be enabled. This is done concurrently in the pthread_mutex_*lock + functions by using the macro FORCE_ELISION. This macro is only defined + for architectures which supports lock elision. + + For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and + PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already + set type of a mutex. Before a mutex is initialized, only + PTHREAD_MUTEX_NO_ELISION_NP can be set with pthread_mutexattr_settype. + + After a mutex has been initialized, the functions pthread_mutex_*lock can + enable elision - if the mutex-type and the machine supports it - by + setting the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently. + Afterwards the lock / unlock functions are using specific elision + code-paths. */ int __kind; -#ifdef __x86_64__ - short __spins; - short __elision; +#if __WORDSIZE != 64 + unsigned int __nusers; +#endif +#if __WORDSIZE == 64 + int __spins; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else - unsigned int __nusers; __extension__ union { - struct - { - short __espins; - short __eelision; -# define __spins __elision_data.__espins -# define __elision __elision_data.__eelision - } __elision_data; + int __spins; __pthread_slist_t __list; }; # define __PTHREAD_MUTEX_HAVE_PREV 0 #endif }; -#ifdef __x86_64__ +#if __PTHREAD_MUTEX_HAVE_PREV == 1 # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } + 0, 0, 0, 0, __kind, 0, { 0, 0 } #else # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, __kind, 0, { { 0, 0 } } + 0, 0, 0, __kind, 0, { 0 } #endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/struct_rwlock.h b/lib/libc/include/generic-glibc/bits/struct_rwlock.h index 863b185dc9..e1e54e75bb 100644 --- a/lib/libc/include/generic-glibc/bits/struct_rwlock.h +++ b/lib/libc/include/generic-glibc/bits/struct_rwlock.h @@ -1,6 +1,5 @@ -/* x86 internal rwlock struct definitions. +/* MIPS internal rwlock struct definitions. Copyright (C) 2019-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,38 +27,45 @@ struct __pthread_rwlock_arch_t unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; -#ifdef __x86_64__ +#if _MIPS_SIM == _ABI64 int __cur_writer; int __shared; - signed char __rwelision; -# ifdef __ILP32__ - unsigned char __pad1[3]; -# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } -# else - unsigned char __pad1[7]; -# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } -# endif + unsigned long int __pad1; unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; -#else /* __x86_64__ */ +# else +# if __BYTE_ORDER == __BIG_ENDIAN + unsigned char __pad1; + unsigned char __pad2; + unsigned char __shared; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; +# else /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; - signed char __rwelision; + unsigned char __pad1; unsigned char __pad2; +# endif int __cur_writer; #endif }; -#ifdef __x86_64__ +#if _MIPS_SIM == _ABI64 # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ - 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags #else -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ +# if __BYTE_ORDER == __BIG_ENDIAN +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 +# else +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 +# endif #endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sys_errlist.h b/lib/libc/include/generic-glibc/bits/sys_errlist.h new file mode 100644 index 0000000000..ae30302397 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/sys_errlist.h @@ -0,0 +1,32 @@ +/* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. + Copyright (C) 2002-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _STDIO_H +# error "Never include directly; use instead." +#endif + +/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ + +#ifdef __USE_MISC +extern int sys_nerr; +extern const char *const sys_errlist[]; +#endif +#ifdef __USE_GNU +extern int _sys_nerr; +extern const char *const _sys_errlist[]; +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syscall.h b/lib/libc/include/generic-glibc/bits/syscall.h index 561be5ac16..a1f9bcb306 100644 --- a/lib/libc/include/generic-glibc/bits/syscall.h +++ b/lib/libc/include/generic-glibc/bits/syscall.h @@ -1,11 +1,11 @@ /* Generated at libc build time from syscall list. */ -/* The system call list corresponds to kernel 5.7. */ +/* The system call list corresponds to kernel 5.4. */ #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 329472 +#define __GLIBC_LINUX_VERSION_CODE 328704 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -75,18 +75,6 @@ # define SYS_alloc_hugepages __NR_alloc_hugepages #endif -#ifdef __NR_arc_gettls -# define SYS_arc_gettls __NR_arc_gettls -#endif - -#ifdef __NR_arc_settls -# define SYS_arc_settls __NR_arc_settls -#endif - -#ifdef __NR_arc_usr_cmpxchg -# define SYS_arc_usr_cmpxchg __NR_arc_usr_cmpxchg -#endif - #ifdef __NR_arch_prctl # define SYS_arch_prctl __NR_arch_prctl #endif @@ -1091,10 +1079,6 @@ # define SYS_openat __NR_openat #endif -#ifdef __NR_openat2 -# define SYS_openat2 __NR_openat2 -#endif - #ifdef __NR_osf_adjtime # define SYS_osf_adjtime __NR_osf_adjtime #endif @@ -1567,10 +1551,6 @@ # define SYS_personality __NR_personality #endif -#ifdef __NR_pidfd_getfd -# define SYS_pidfd_getfd __NR_pidfd_getfd -#endif - #ifdef __NR_pidfd_open # define SYS_pidfd_open __NR_pidfd_open #endif diff --git a/lib/libc/include/generic-glibc/bits/sysctl.h b/lib/libc/include/generic-glibc/bits/sysctl.h new file mode 100644 index 0000000000..d47dd78ea1 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/sysctl.h @@ -0,0 +1 @@ +/* Empty file. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syslog-ldbl.h b/lib/libc/include/generic-glibc/bits/syslog-ldbl.h index a6527d038f..8f46907bef 100644 --- a/lib/libc/include/generic-glibc/bits/syslog-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/syslog-ldbl.h @@ -27,9 +27,9 @@ __LDBL_REDIR_DECL (vsyslog) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR2_DECL (syslog_chk) +__LDBL_REDIR_DECL (__syslog_chk) # ifdef __USE_MISC -__LDBL_REDIR2_DECL (vsyslog_chk) +__LDBL_REDIR_DECL (__vsyslog_chk) # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/thread-shared-types.h b/lib/libc/include/generic-glibc/bits/thread-shared-types.h index 43efbedb1b..ac0c7f5370 100644 --- a/lib/libc/include/generic-glibc/bits/thread-shared-types.h +++ b/lib/libc/include/generic-glibc/bits/thread-shared-types.h @@ -116,14 +116,4 @@ struct __pthread_cond_s unsigned int __g_signals[2]; }; -typedef unsigned int __tss_t; -typedef unsigned long int __thrd_t; - -typedef struct -{ - int __data __ONCE_ALIGNMENT; -} __once_flag; - -#define __ONCE_FLAG_INIT { 0 } - #endif /* _THREAD_SHARED_TYPES_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/timesize.h b/lib/libc/include/generic-glibc/bits/timesize.h index ae0a502d0d..5260dbb5aa 100644 --- a/lib/libc/include/generic-glibc/bits/timesize.h +++ b/lib/libc/include/generic-glibc/bits/timesize.h @@ -1,4 +1,4 @@ -/* Bit size of the time_t type at glibc build time, x86-64 and x32 case. +/* Bit size of the time_t type at glibc build time, general case. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,10 +16,7 @@ License along with the GNU C Library; if not, see . */ -#if defined __x86_64__ && defined __ILP32__ -/* For x32, time is 64-bit even though word size is 32-bit. */ -# define __TIMESIZE 64 -#else -/* For others, time size is word size. */ -# define __TIMESIZE __WORDSIZE -#endif \ No newline at end of file +#include + +/* Size in bits of the 'time_t' type of the default ABI. */ +#define __TIMESIZE __WORDSIZE \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/types.h b/lib/libc/include/generic-glibc/bits/types.h index 1f37c9eec8..26fbc0be67 100644 --- a/lib/libc/include/generic-glibc/bits/types.h +++ b/lib/libc/include/generic-glibc/bits/types.h @@ -160,7 +160,6 @@ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ -__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ diff --git a/lib/libc/include/generic-glibc/bits/typesizes.h b/lib/libc/include/generic-glibc/bits/typesizes.h index 53ae0bd5ef..571d285ea0 100644 --- a/lib/libc/include/generic-glibc/bits/typesizes.h +++ b/lib/libc/include/generic-glibc/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. - Copyright (C) 2012-2020 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. Generic version. + Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,55 +26,42 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ -/* X32 kernel interface is 64-bit. */ -#if defined __x86_64__ && defined __ILP32__ -# define __SYSCALL_SLONG_TYPE __SQUAD_TYPE -# define __SYSCALL_ULONG_TYPE __UQUAD_TYPE -#else -# define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE -# define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE -#endif - #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __SYSCALL_ULONG_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE -#ifdef __x86_64__ -# define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE -# define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE -#else -# define __NLINK_T_TYPE __UWORD_TYPE -# define __FSWORD_T_TYPE __SWORD_TYPE -#endif -#define __OFF_T_TYPE __SYSCALL_SLONG_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE -#define __FSFILCNT64_T_TYPE __UQUAD_TYPE -#define __ID_T_TYPE __U32_TYPE -#define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE -#define __TIME_T_TYPE __SYSCALL_SLONG_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE -#define __CPU_MASK_TYPE __SYSCALL_ULONG_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __x86_64__ +#ifdef __LP64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -83,24 +70,19 @@ /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 -/* And for __rlim_t and __rlim64_t. */ +/* And for rlim_t and rlim64_t. */ # define __RLIM_T_MATCHES_RLIM64_T 1 /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 +#define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/unistd.h b/lib/libc/include/generic-glibc/bits/unistd.h index 729afdf23e..9cad6847f9 100644 --- a/lib/libc/include/generic-glibc/bits/unistd.h +++ b/lib/libc/include/generic-glibc/bits/unistd.h @@ -21,11 +21,9 @@ #endif extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, - size_t __buflen) - __wur __attr_access ((__write_only__, 2, 3)); + size_t __buflen) __wur; extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, - size_t __nbytes), read) - __wur __attr_access ((__write_only__, 2, 3)); + size_t __nbytes), read) __wur; extern ssize_t __REDIRECT (__read_chk_warn, (int __fd, void *__buf, size_t __nbytes, size_t __buflen), __read_chk) @@ -48,19 +46,15 @@ read (int __fd, void *__buf, size_t __nbytes) #ifdef __USE_UNIX98 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, - __off_t __offset, size_t __bufsize) - __wur __attr_access ((__write_only__, 2, 3)); + __off_t __offset, size_t __bufsize) __wur; extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset, size_t __bufsize) - __wur __attr_access ((__write_only__, 2, 3)); + __off64_t __offset, size_t __bufsize) __wur; extern ssize_t __REDIRECT (__pread_alias, (int __fd, void *__buf, size_t __nbytes, - __off_t __offset), pread) - __wur __attr_access ((__write_only__, 2, 3)); + __off_t __offset), pread) __wur; extern ssize_t __REDIRECT (__pread64_alias, (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset), pread64) - __wur __attr_access ((__write_only__, 2, 3)); + __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT (__pread_chk_warn, (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize), __pread_chk) @@ -129,11 +123,11 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) extern ssize_t __readlink_chk (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); + __THROW __nonnull ((1, 2)) __wur; extern ssize_t __REDIRECT_NTH (__readlink_alias, (const char *__restrict __path, char *__restrict __buf, size_t __len), readlink) - __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); + __nonnull ((1, 2)) __wur; extern ssize_t __REDIRECT_NTH (__readlink_chk_warn, (const char *__restrict __path, char *__restrict __buf, size_t __len, @@ -161,12 +155,12 @@ __NTH (readlink (const char *__restrict __path, char *__restrict __buf, extern ssize_t __readlinkat_chk (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); + __THROW __nonnull ((2, 3)) __wur; extern ssize_t __REDIRECT_NTH (__readlinkat_alias, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len), readlinkat) - __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); + __nonnull ((2, 3)) __wur; extern ssize_t __REDIRECT_NTH (__readlinkat_chk_warn, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, @@ -193,10 +187,9 @@ __NTH (readlinkat (int __fd, const char *__restrict __path, #endif extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) - __THROW __wur __attr_access ((__write_only__, 1, 2)); + __THROW __wur; extern char *__REDIRECT_NTH (__getcwd_alias, - (char *__buf, size_t __size), getcwd) - __wur __attr_access ((__write_only__, 1, 2)); + (char *__buf, size_t __size), getcwd) __wur; extern char *__REDIRECT_NTH (__getcwd_chk_warn, (char *__buf, size_t __size, size_t __buflen), __getcwd_chk) @@ -219,7 +212,7 @@ __NTH (getcwd (char *__buf, size_t __size)) #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern char *__getwd_chk (char *__buf, size_t buflen) - __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); + __THROW __nonnull ((1)) __wur; extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd) __nonnull ((1)) __wur __warnattr ("please use getcwd instead, as getwd " "doesn't specify buffer size"); @@ -234,11 +227,9 @@ __NTH (getwd (char *__buf)) #endif extern size_t __confstr_chk (int __name, char *__buf, size_t __len, - size_t __buflen) __THROW - __attr_access ((__write_only__, 2, 3)); + size_t __buflen) __THROW; extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf, - size_t __len), confstr) - __attr_access ((__write_only__, 2, 3)); + size_t __len), confstr); extern size_t __REDIRECT_NTH (__confstr_chk_warn, (int __name, char *__buf, size_t __len, size_t __buflen), __confstr_chk) @@ -261,9 +252,9 @@ __NTH (confstr (int __name, char *__buf, size_t __len)) extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen) - __THROW __wur __attr_access ((__write_only__, 2, 1)); + __THROW __wur; extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]), - getgroups) __wur __attr_access ((__write_only__, 2, 1)); + getgroups) __wur; extern int __REDIRECT_NTH (__getgroups_chk_warn, (int __size, __gid_t __list[], size_t __listlen), __getgroups_chk) @@ -286,8 +277,7 @@ __NTH (getgroups (int __size, __gid_t __list[])) extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)) - __attr_access ((__write_only__, 2, 3)); + size_t __nreal) __THROW __nonnull ((2)); extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf, size_t __buflen), ttyname_r) __nonnull ((2)); @@ -314,7 +304,7 @@ __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) #ifdef __USE_POSIX199506 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) - __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); + __nonnull ((1)); extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen), getlogin_r) __nonnull ((1)); extern int __REDIRECT (__getlogin_r_chk_warn, @@ -341,10 +331,9 @@ getlogin_r (char *__buf, size_t __buflen) #if defined __USE_MISC || defined __USE_UNIX98 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); + __THROW __nonnull ((1)); extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen), - gethostname) - __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); + gethostname) __nonnull ((1)); extern int __REDIRECT_NTH (__gethostname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __gethostname_chk) @@ -369,11 +358,10 @@ __NTH (gethostname (char *__buf, size_t __buflen)) #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); + __THROW __nonnull ((1)) __wur; extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf, size_t __buflen), - getdomainname) __nonnull ((1)) - __wur __attr_access ((__write_only__, 1, 2)); + getdomainname) __nonnull ((1)) __wur; extern int __REDIRECT_NTH (__getdomainname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __getdomainname_chk) diff --git a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h index 7067a9c3e3..3ded0fb11c 100644 --- a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h @@ -28,17 +28,9 @@ __LDBL_REDIR_DECL (vfwprintf); __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); # if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -__LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128) -__LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128) -__LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128) -# else -# error bits/stdlib-ldbl.h included when no ldbl redirections are required. -# endif # else __LDBL_REDIR_DECL (fwscanf); __LDBL_REDIR_DECL (wscanf); @@ -47,23 +39,11 @@ __LDBL_REDIR_DECL (swscanf); #endif #ifdef __USE_ISOC99 -# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold, wcstod); -# else -__LDBL_REDIR1_DECL (wcstold, __wcstoieee128) -# endif # if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -__LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128) -__LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128) -__LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128) -# else -# error bits/stdlib-ldbl.h included when no ldbl redirections are required. -# endif # else __LDBL_REDIR_DECL (vfwscanf); __LDBL_REDIR_DECL (vwscanf); @@ -72,20 +52,16 @@ __LDBL_REDIR_DECL (vswscanf); #endif #ifdef __USE_GNU -# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold_l, wcstod_l); -# else -__LDBL_REDIR1_DECL (wcstold_l, __wcstoieee128_l) -# endif #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR2_DECL (swprintf_chk) -__LDBL_REDIR2_DECL (vswprintf_chk) +__LDBL_REDIR_DECL (__swprintf_chk) +__LDBL_REDIR_DECL (__vswprintf_chk) # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR2_DECL (fwprintf_chk) -__LDBL_REDIR2_DECL (wprintf_chk) -__LDBL_REDIR2_DECL (vfwprintf_chk) -__LDBL_REDIR2_DECL (vwprintf_chk) +__LDBL_REDIR_DECL (__fwprintf_chk) +__LDBL_REDIR_DECL (__wprintf_chk) +__LDBL_REDIR_DECL (__vfwprintf_chk) +__LDBL_REDIR_DECL (__vwprintf_chk) # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/wordsize.h b/lib/libc/include/generic-glibc/bits/wordsize.h index 0bf84a4e99..d5ed6b4522 100644 --- a/lib/libc/include/generic-glibc/bits/wordsize.h +++ b/lib/libc/include/generic-glibc/bits/wordsize.h @@ -1,17 +1,31 @@ -/* Determine the wordsize from the preprocessor defines. */ +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. -#if defined __x86_64__ && !defined __ILP32__ -# define __WORDSIZE 64 -#else -# define __WORDSIZE 32 -#define __WORDSIZE32_SIZE_ULONG 0 -#define __WORDSIZE32_PTRDIFF_LONG 0 -#endif + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. -#ifdef __x86_64__ + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#include + +#define __WORDSIZE _MIPS_SZPTR + +#if _MIPS_SIM == _ABI64 # define __WORDSIZE_TIME64_COMPAT32 1 -/* Both x86-64 and x32 use the 64-bit system call interface. */ -# define __SYSCALL_WORDSIZE 64 #else # define __WORDSIZE_TIME64_COMPAT32 0 +#endif + +#if __WORDSIZE == 32 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/complex.h b/lib/libc/include/generic-glibc/complex.h index 9510f64101..3a3de87d1e 100644 --- a/lib/libc/include/generic-glibc/complex.h +++ b/lib/libc/include/generic-glibc/complex.h @@ -95,15 +95,11 @@ __BEGIN_DECLS #define __MATHCALL(function, args) \ __MATHDECL (_Mdouble_complex_,function, args) -#define __MATHDECL_IMPL(type, function, args) \ +#define __MATHDECL(type, function, args) \ __MATHDECL_1(type, function, args); \ __MATHDECL_1(type, __CONCAT(__,function), args) -#define __MATHDECL(type, function, args) \ - __MATHDECL_IMPL(type, function, args) -#define __MATHDECL_1_IMPL(type, function, args) \ - extern type __MATH_PRECNAME(function) args __THROW #define __MATHDECL_1(type, function, args) \ - __MATHDECL_1_IMPL(type, function, args) + extern type __MATH_PRECNAME(function) args __THROW #define _Mdouble_ double #define __MATH_PRECNAME(name) name @@ -126,31 +122,11 @@ __BEGIN_DECLS # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# undef __MATHDECL_1 -# undef __MATHDECL -# define __REDIR_TO(function) \ - __ ## function ## ieee128 -# define __MATHDECL_1(type, function, alias, args) \ - extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, alias) -#define __MATHDECL(type, function, args) \ - __MATHDECL_1(type, function, __REDIR_TO(function), args); \ - __MATHDECL_1(type, __CONCAT(__,function), __REDIR_TO(function), args) # endif # define _Mdouble_ long double # define __MATH_PRECNAME(name) name##l # include -# if defined __LDBL_COMPAT \ - || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# undef __REDIR_TO -# undef __MATHDECL_1 -# undef __MATHDECL -#define __MATHDECL(type, function, args) \ - __MATHDECL_IMPL(type, function, args) -# define __MATHDECL_1(type, function, args) \ - __MATHDECL_1_IMPL(type, function, args) -# endif #endif #undef _Mdouble_ #undef __MATH_PRECNAME @@ -239,7 +215,6 @@ __BEGIN_DECLS # undef _Mdouble_complex_ #endif -#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL diff --git a/lib/libc/include/generic-glibc/elf.h b/lib/libc/include/generic-glibc/elf.h index 58b7bc8e2b..de9cf6e57a 100644 --- a/lib/libc/include/generic-glibc/elf.h +++ b/lib/libc/include/generic-glibc/elf.h @@ -330,7 +330,7 @@ typedef struct #define EM_CLOUDSHIELD 192 /* CloudShield */ #define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */ #define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd gen. */ -#define EM_ARCV2 195 /* Synopsys ARCv2 ISA. */ +#define EM_ARC_COMPACT2 195 /* Synopsys ARCompact V2 */ #define EM_OPEN8 196 /* Open8 RISC */ #define EM_RL78 197 /* Renesas RL78 */ #define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */ @@ -721,7 +721,6 @@ typedef struct #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ -#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ @@ -1319,12 +1318,6 @@ typedef struct /* Application-specific semantics, hi */ #define GNU_PROPERTY_HIUSER 0xffffffff -/* AArch64 specific GNU properties. */ -#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 - -#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) -#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) - /* The x86 instruction sets indicated by the corresponding bits are used in program. Their support in the hardware is optional. */ #define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 @@ -3953,9 +3946,8 @@ enum #define R_RISCV_SET16 55 #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 -#define R_RISCV_IRELATIVE 58 -#define R_RISCV_NUM 59 +#define R_RISCV_NUM 58 /* BPF specific declarations. */ @@ -4035,74 +4027,6 @@ enum #define R_NDS32_TLS_TPOFF 102 #define R_NDS32_TLS_DESC 119 -/* ARCompact/ARCv2 specific relocs. */ -#define R_ARC_NONE 0x0 -#define R_ARC_8 0x1 -#define R_ARC_16 0x2 -#define R_ARC_24 0x3 -#define R_ARC_32 0x4 -#define R_ARC_B26 0x5 -#define R_ARC_B22_PCREL 0x6 -#define R_ARC_H30 0x7 -#define R_ARC_N8 0x8 -#define R_ARC_N16 0x9 -#define R_ARC_N24 0xA -#define R_ARC_N32 0xB -#define R_ARC_SDA 0xC -#define R_ARC_SECTOFF 0xD -#define R_ARC_S21H_PCREL 0xE -#define R_ARC_S21W_PCREL 0xF -#define R_ARC_S25H_PCREL 0x10 -#define R_ARC_S25W_PCREL 0x11 -#define R_ARC_SDA32 0x12 -#define R_ARC_SDA_LDST 0x13 -#define R_ARC_SDA_LDST1 0x14 -#define R_ARC_SDA_LDST2 0x15 -#define R_ARC_SDA16_LD 0x16 -#define R_ARC_SDA16_LD1 0x17 -#define R_ARC_SDA16_LD2 0x18 -#define R_ARC_S13_PCREL 0x19 -#define R_ARC_W 0x1A -#define R_ARC_32_ME 0x1B -#define R_ARC_N32_ME 0x1C -#define R_ARC_SECTOFF_ME 0x1D -#define R_ARC_SDA32_ME 0x1E -#define R_ARC_W_ME 0x1F -#define R_ARC_H30_ME 0x20 -#define R_ARC_SECTOFF_U8 0x21 -#define R_ARC_SECTOFF_S9 0x22 -#define R_AC_SECTOFF_U8 0x23 -#define R_AC_SECTOFF_U8_1 0x24 -#define R_AC_SECTOFF_U8_2 0x25 -#define R_AC_SECTOFF_S9 0x26 -#define R_AC_SECTOFF_S9_1 0x27 -#define R_AC_SECTOFF_S9_2 0x28 -#define R_ARC_SECTOFF_ME_1 0x29 -#define R_ARC_SECTOFF_ME_2 0x2A -#define R_ARC_SECTOFF_1 0x2B -#define R_ARC_SECTOFF_2 0x2C -#define R_ARC_PC32 0x32 -#define R_ARC_GOTPC32 0x33 -#define R_ARC_PLT32 0x34 -#define R_ARC_COPY 0x35 -#define R_ARC_GLOB_DAT 0x36 -#define R_ARC_JUMP_SLOT 0x37 -#define R_ARC_RELATIVE 0x38 -#define R_ARC_GOTOFF 0x39 -#define R_ARC_GOTPC 0x3A -#define R_ARC_GOT32 0x3B - -#define R_ARC_TLS_DTPMOD 0x42 -#define R_ARC_TLS_DTPOFF 0x43 -#define R_ARC_TLS_TPOFF 0x44 -#define R_ARC_TLS_GD_GOT 0x45 -#define R_ARC_TLS_GD_LD 0x46 -#define R_ARC_TLS_GD_CALL 0x47 -#define R_ARC_TLS_IE_GOT 0x48 -#define R_ARC_TLS_DTPOFF_S9 0x4a -#define R_ARC_TLS_LE_S9 0x4a -#define R_ARC_TLS_LE_32 0x4b - __END_DECLS #endif /* elf.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/err.h b/lib/libc/include/generic-glibc/err.h index f505f646b2..90cb060734 100644 --- a/lib/libc/include/generic-glibc/err.h +++ b/lib/libc/include/generic-glibc/err.h @@ -52,8 +52,7 @@ extern void errx (int __status, const char *__format, ...) extern void verrx (int __status, const char *, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/error.h b/lib/libc/include/generic-glibc/error.h index dfd1623e1a..fa22157daf 100644 --- a/lib/libc/include/generic-glibc/error.h +++ b/lib/libc/include/generic-glibc/error.h @@ -47,13 +47,11 @@ extern unsigned int error_message_count; variable controls whether this mode is selected or not. */ extern int error_one_per_line; -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #else /* Do not inline error and error_at_line when long double has the same - size of double, nor when long double reuses the float128 - implementation, because that would invalidate the redirections to the + size of double, because that would invalidate the redirections to the compatibility functions. */ # if defined __extern_always_inline && defined __va_arg_pack # include diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index ed3e1cd728..21e01848fa 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -454,7 +454,7 @@ /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 -#define __GLIBC_MINOR__ 32 +#define __GLIBC_MINOR__ 31 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) diff --git a/lib/libc/include/generic-glibc/fenv.h b/lib/libc/include/generic-glibc/fenv.h index 833583f5b9..0df8e06d17 100644 --- a/lib/libc/include/generic-glibc/fenv.h +++ b/lib/libc/include/generic-glibc/fenv.h @@ -140,6 +140,10 @@ extern int fegetmode (femode_t *__modep) __THROW; extern int fesetmode (const femode_t *__modep) __THROW; #endif +/* Include optimization. */ +#ifdef __OPTIMIZE__ +# include +#endif /* NaN support. */ diff --git a/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h b/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h index c56f5fc16f..d348de2ba8 100644 --- a/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h +++ b/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h @@ -16,28 +16,4 @@ ! License along with the GNU C Library; if not, see ! . -!GCC$ builtin (cos) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (cosf) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (sin) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (sincos) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (log) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (logf) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (exp) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (expf) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (pow) attributes simd (notinbranch) if('x86_64') -!GCC$ builtin (powf) attributes simd (notinbranch) if('x86_64') - -!GCC$ builtin (cos) attributes simd (notinbranch) if('x32') -!GCC$ builtin (cosf) attributes simd (notinbranch) if('x32') -!GCC$ builtin (sin) attributes simd (notinbranch) if('x32') -!GCC$ builtin (sinf) attributes simd (notinbranch) if('x32') -!GCC$ builtin (sincos) attributes simd (notinbranch) if('x32') -!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x32') -!GCC$ builtin (log) attributes simd (notinbranch) if('x32') -!GCC$ builtin (logf) attributes simd (notinbranch) if('x32') -!GCC$ builtin (exp) attributes simd (notinbranch) if('x32') -!GCC$ builtin (expf) attributes simd (notinbranch) if('x32') -!GCC$ builtin (pow) attributes simd (notinbranch) if('x32') -!GCC$ builtin (powf) attributes simd (notinbranch) if('x32') \ No newline at end of file +! No SIMD math functions are available for this platform. \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/fpu_control.h b/lib/libc/include/generic-glibc/fpu_control.h index fa0a861923..d5aa21113b 100644 --- a/lib/libc/include/generic-glibc/fpu_control.h +++ b/lib/libc/include/generic-glibc/fpu_control.h @@ -1,7 +1,6 @@ -/* FPU control word bits. x86 version. - Copyright (C) 1993-2020 Free Software Foundation, Inc. +/* FPU control word bits. Mips version. + Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Olaf Flebbe. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -14,96 +13,120 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H 1 +#define _FPU_CONTROL_H -/* Note that this file sets on x86-64 only the x87 FPU, it does not - touch the SSE unit. */ - -/* Here is the dirty part. Set up your 387 through the control word - * (cw) register. +/* MIPS FPU floating point control register bits. * - * 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0 - * | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM + * 31-25 -> floating point conditions code bits 7-1. These bits are only + * available in MIPS IV. + * 24 -> flush denormalized results to zero instead of + * causing unimplemented operation exception. This bit is only + * available for MIPS III and newer. + * 23 -> Condition bit + * 22-21 -> reserved for architecture implementers + * 20 -> reserved (read as 0, write with 0) + * 19 -> IEEE 754-2008 non-arithmetic ABS.fmt and NEG.fmt enable + * 18 -> IEEE 754-2008 recommended NaN encoding enable + * 17 -> cause bit for unimplemented operation + * 16 -> cause bit for invalid exception + * 15 -> cause bit for division by zero exception + * 14 -> cause bit for overflow exception + * 13 -> cause bit for underflow exception + * 12 -> cause bit for inexact exception + * 11 -> enable exception for invalid exception + * 10 -> enable exception for division by zero exception + * 9 -> enable exception for overflow exception + * 8 -> enable exception for underflow exception + * 7 -> enable exception for inexact exception + * 6 -> flag invalid exception + * 5 -> flag division by zero exception + * 4 -> flag overflow exception + * 3 -> flag underflow exception + * 2 -> flag inexact exception + * 1-0 -> rounding control * - * IM: Invalid operation mask - * DM: Denormalized operand mask - * ZM: Zero-divide mask - * OM: Overflow mask - * UM: Underflow mask - * PM: Precision (inexact result) mask * - * Mask bit is 1 means no interrupt. - * - * PC: Precision control - * 11 - round to extended precision - * 10 - round to double precision - * 00 - round to single precision - * - * RC: Rounding control - * 00 - rounding to nearest - * 01 - rounding down (toward - infinity) - * 10 - rounding up (toward + infinity) - * 11 - rounding toward zero - * - * IC: Infinity control - * That is for 8087 and 80287 only. - * - * The hardware default is 0x037f which we use. + * Rounding Control: + * 00 - rounding to nearest (RN) + * 01 - rounding toward zero (RZ) + * 10 - rounding (up) toward plus infinity (RP) + * 11 - rounding (down)toward minus infinity (RM) */ #include -/* masking of interrupts */ -#define _FPU_MASK_IM 0x01 -#define _FPU_MASK_DM 0x02 -#define _FPU_MASK_ZM 0x04 -#define _FPU_MASK_OM 0x08 -#define _FPU_MASK_UM 0x10 -#define _FPU_MASK_PM 0x20 +#ifdef __mips_soft_float -/* precision control */ -#define _FPU_EXTENDED 0x300 /* libm requires double extended precision. */ -#define _FPU_DOUBLE 0x200 -#define _FPU_SINGLE 0x0 +#define _FPU_RESERVED 0xffffffff +#define _FPU_DEFAULT 0x00000000 +typedef unsigned int fpu_control_t; +#define _FPU_GETCW(cw) (cw) = 0 +#define _FPU_SETCW(cw) (void) (cw) +extern fpu_control_t __fpu_control; -/* rounding control */ -#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ -#define _FPU_RC_DOWN 0x400 -#define _FPU_RC_UP 0x800 -#define _FPU_RC_ZERO 0xC00 +#else /* __mips_soft_float */ -#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */ +/* Masks for interrupts. */ +#define _FPU_MASK_V 0x0800 /* Invalid operation */ +#define _FPU_MASK_Z 0x0400 /* Division by zero */ +#define _FPU_MASK_O 0x0200 /* Overflow */ +#define _FPU_MASK_U 0x0100 /* Underflow */ +#define _FPU_MASK_I 0x0080 /* Inexact operation */ + +/* Flush denormalized numbers to zero. */ +#define _FPU_FLUSH_TZ 0x1000000 + +/* IEEE 754-2008 compliance control. */ +#define _FPU_ABS2008 0x80000 +#define _FPU_NAN2008 0x40000 + +/* Rounding control. */ +#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ +#define _FPU_RC_ZERO 0x1 +#define _FPU_RC_UP 0x2 +#define _FPU_RC_DOWN 0x3 +/* Mask for rounding control. */ +#define _FPU_RC_MASK 0x3 + +#define _FPU_RESERVED 0xfe8c0000 /* Reserved bits in cw, incl ABS/NAN2008. */ /* The fdlibm code requires strict IEEE double precision arithmetic, and no interrupts for exceptions, rounding to nearest. */ +#ifdef __mips_nan2008 +# define _FPU_DEFAULT 0x000C0000 +#else +# define _FPU_DEFAULT 0x00000000 +#endif -#define _FPU_DEFAULT 0x037f - -/* IEEE: same as above. */ -#define _FPU_IEEE 0x037f +/* IEEE: same as above, but exceptions. */ +#ifdef __mips_nan2008 +# define _FPU_IEEE 0x000C0F80 +#else +# define _FPU_IEEE 0x00000F80 +#endif /* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); +typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); -/* Macros for accessing the hardware control word. "*&" is used to - work around a bug in older versions of GCC. __volatile__ is used - to support combination of writing the control register and reading - it back. Without __volatile__, the old value may be used for reading - back under compiler optimization. - - Note that the use of these macros is not sufficient anymore with - recent hardware nor on x86-64. Some floating point operations are - executed in the SSE/SSE2 engines which have their own control and - status register. */ -#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw)) -#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw)) +/* Macros for accessing the hardware control word. */ +extern fpu_control_t __mips_fpu_getcw (void) __THROW; +extern void __mips_fpu_setcw (fpu_control_t) __THROW; +#ifdef __mips16 +# define _FPU_GETCW(cw) do { (cw) = __mips_fpu_getcw (); } while (0) +# define _FPU_SETCW(cw) __mips_fpu_setcw (cw) +#else +# define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw)) +# define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw)) +#endif /* Default control word set at startup. */ extern fpu_control_t __fpu_control; +#endif /* __mips_soft_float */ + #endif /* fpu_control.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-32.h b/lib/libc/include/generic-glibc/gnu/lib-names-32.h index 3e05ce280d..910a12d444 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-32.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-32.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h index dd2cb9fb78..9c4e7c164e 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h index 4ec7514060..d6c1d96f7e 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h @@ -19,6 +19,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h index 1f8eed349b..b5af4b1542 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h @@ -19,6 +19,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h index 8a3a04cb2d..4746766acf 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h @@ -19,6 +19,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h index 3c3e1769fa..14dc0082b0 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names.h b/lib/libc/include/generic-glibc/gnu/lib-names.h index aafc03bf7e..fcfc96cef1 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names.h @@ -4,14 +4,43 @@ #ifndef __GNU_LIB_NAMES_H #define __GNU_LIB_NAMES_H 1 -#if !defined __x86_64__ -# include +#include + +#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include #endif -#if defined __x86_64__ && defined __LP64__ -# include +#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include #endif -#if defined __x86_64__ && defined __ILP32__ -# include +#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include #endif #endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-32.h b/lib/libc/include/generic-glibc/gnu/stubs-32.h index 636dc73283..12c0d956e8 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-32.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-32.h @@ -10,7 +10,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-64.h b/lib/libc/include/generic-glibc/gnu/stubs-64.h new file mode 100644 index 0000000000..12c0d956e8 --- /dev/null +++ b/lib/libc/include/generic-glibc/gnu/stubs-64.h @@ -0,0 +1,18 @@ +/* This file is automatically generated. + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ + +#ifdef _LIBC + #error Applications may not define the macro _LIBC +#endif + +#define __stub_chflags +#define __stub_fchflags +#define __stub_gtty +#define __stub_lchmod +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_sstk +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-hard.h b/lib/libc/include/generic-glibc/gnu/stubs-hard.h index 013aed511c..add0d4871d 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-hard.h @@ -13,7 +13,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h index 186070157a..d4c69865ed 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h @@ -12,7 +12,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h index 186070157a..d4c69865ed 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h @@ -12,7 +12,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h index 636dc73283..12c0d956e8 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h @@ -10,7 +10,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-soft.h b/lib/libc/include/generic-glibc/gnu/stubs-soft.h index 013aed511c..add0d4871d 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-soft.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-soft.h @@ -13,7 +13,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs.h b/lib/libc/include/generic-glibc/gnu/stubs.h index a4c9b5f097..96ececfa31 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs.h +++ b/lib/libc/include/generic-glibc/gnu/stubs.h @@ -2,13 +2,41 @@ This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ +#include -#if !defined __x86_64__ -# include +#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include #endif -#if defined __x86_64__ && defined __LP64__ -# include +#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include #endif -#if defined __x86_64__ && defined __ILP32__ -# include +#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include +#endif +#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include +#endif +#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) +# include #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/inttypes.h b/lib/libc/include/generic-glibc/inttypes.h index 7734ebce74..61b4464bb3 100644 --- a/lib/libc/include/generic-glibc/inttypes.h +++ b/lib/libc/include/generic-glibc/inttypes.h @@ -321,10 +321,10 @@ extern long int __strtol_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr, - int __base)) +__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, + int base)) { - return __strtol_internal (__nptr, __endptr, __base, 0); + return __strtol_internal (nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal (const char *__restrict __nptr, @@ -333,10 +333,10 @@ extern unsigned long int __strtoul_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr, - int __base)) +__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, + int base)) { - return __strtoul_internal (__nptr, __endptr, __base, 0); + return __strtoul_internal (nptr, endptr, base, 0); } extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, @@ -345,10 +345,10 @@ extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (const __gwchar_t *__restrict __nptr, - __gwchar_t **__restrict __endptr, int __base)) +__NTH (wcstoimax (const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) { - return __wcstol_internal (__nptr, __endptr, __base, 0); + return __wcstol_internal (nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal (const __gwchar_t * @@ -359,10 +359,10 @@ extern unsigned long int __wcstoul_internal (const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (const __gwchar_t *__restrict __nptr, - __gwchar_t **__restrict __endptr, int __base)) +__NTH (wcstoumax (const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) { - return __wcstoul_internal (__nptr, __endptr, __base, 0); + return __wcstoul_internal (nptr, endptr, base, 0); } # else /* __WORDSIZE == 32 */ @@ -374,10 +374,10 @@ extern long long int __strtoll_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr, - int __base)) +__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, + int base)) { - return __strtoll_internal (__nptr, __endptr, __base, 0); + return __strtoll_internal (nptr, endptr, base, 0); } __extension__ @@ -390,10 +390,10 @@ extern unsigned long long int __strtoull_internal (const char * __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr, - int __base)) +__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, + int base)) { - return __strtoull_internal (__nptr, __endptr, __base, 0); + return __strtoull_internal (nptr, endptr, base, 0); } __extension__ @@ -403,10 +403,10 @@ extern long long int __wcstoll_internal (const __gwchar_t *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (const __gwchar_t *__restrict __nptr, - __gwchar_t **__restrict __endptr, int __base)) +__NTH (wcstoimax (const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) { - return __wcstoll_internal (__nptr, __endptr, __base, 0); + return __wcstoll_internal (nptr, endptr, base, 0); } @@ -420,10 +420,10 @@ extern unsigned long long int __wcstoull_internal (const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (const __gwchar_t *__restrict __nptr, - __gwchar_t **__restrict __endptr, int __base)) +__NTH (wcstoumax (const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) { - return __wcstoull_internal (__nptr, __endptr, __base, 0); + return __wcstoull_internal (nptr, endptr, base, 0); } # endif /* __WORDSIZE == 32 */ diff --git a/lib/libc/include/generic-glibc/malloc.h b/lib/libc/include/generic-glibc/malloc.h index fd73ea1c79..ebddb55e58 100644 --- a/lib/libc/include/generic-glibc/malloc.h +++ b/lib/libc/include/generic-glibc/malloc.h @@ -75,11 +75,11 @@ extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ -extern void *(*__morecore) (ptrdiff_t __size) __MALLOC_DEPRECATED; +extern void *(*__morecore) (ptrdiff_t __size); /* Default value of `__morecore'. */ extern void *__default_morecore (ptrdiff_t __size) -__THROW __attribute_malloc__ __MALLOC_DEPRECATED; +__THROW __attribute_malloc__; /* SVID2/XPG mallinfo structure */ @@ -156,8 +156,7 @@ extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment, size_t __size, const void *) __MALLOC_DEPRECATED; -extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void) - __MALLOC_DEPRECATED; +extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); __END_DECLS diff --git a/lib/libc/include/generic-glibc/math.h b/lib/libc/include/generic-glibc/math.h index 1956311cb8..9b3f228199 100644 --- a/lib/libc/include/generic-glibc/math.h +++ b/lib/libc/include/generic-glibc/math.h @@ -279,17 +279,8 @@ enum #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) -#define __MATHDECL_1_IMPL(type, function, suffix, args) \ +#define __MATHDECL_1(type, function,suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW -#define __MATHDECL_1(type, function, suffix, args) \ - __MATHDECL_1_IMPL(type, function, suffix, args) -/* Ignore the alias by default. The alias is only useful with - redirections. */ -#define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ - __MATHDECL_1(type, function, suffix, args) - -#define __MATHREDIR(type, function, suffix, args, to) \ - extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -340,37 +331,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # endif # undef __MATHDECL_1 +# define __MATHDECL_2(type, function,suffix, args, alias) \ + extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ + args, alias) # define __MATHDECL_1(type, function,suffix, args) \ - __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) - -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# ifdef __REDIRECT_NTH -# ifdef __USE_ISOC99 -extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), - __nexttowardf_to_ieee128) - __attribute__ ((__const__)); -extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), - __nexttoward_to_ieee128) - __attribute__ ((__const__)); - -#define __dremieee128 __remainderieee128 -#define __gammaieee128 __lgammaieee128 - -# endif -# endif - -# undef __MATHDECL_1 -# undef __MATHDECL_ALIAS - -# define __REDIRTO(function, suffix) \ - __ ## function ## ieee128 ## suffix -# define __REDIRTO_ALT(function, suffix) \ - __ ## function ## f128 ## suffix - -# define __MATHDECL_1(type, function, suffix, args) \ - __MATHREDIR (type, function, suffix, args, __REDIRTO (function, suffix)) -# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ - __MATHREDIR (type, function, suffix, args, __REDIRTO_ALT (alias, suffix)) + __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) # endif /* Include the file of declarations again, this time using `long double' @@ -383,23 +348,11 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # define __MATH_DECLARE_LDOUBLE 1 # include # include - # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN -# if defined __LDBL_COMPAT \ - || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# undef __REDIRTO -# undef __REDIRTO_ALT -# undef __MATHDECL_1 -# undef __MATHDECL_ALIAS -# define __MATHDECL_1(type, function, suffix, args) \ - __MATHDECL_1_IMPL(type, function, suffix, args) -# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ - __MATHDECL_1(type, function, suffix, args) -# endif # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ @@ -526,9 +479,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ -#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 -#undef __MATHDECL_ALIAS #undef __MATHDECL #undef __MATHCALL @@ -560,11 +511,6 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) f ## name # undef __MATHCALL_NARROW -# define __MATHCALL_NARROW(func, redir, nargs) \ - __MATHCALL_NARROW_REDIR (func, redir, nargs) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# define __MATHCALL_REDIR_NAME(name) __ ## f32 ## name ## ieee128 -# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -572,8 +518,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# if defined __LDBL_COMPAT \ - || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __LDBL_COMPAT # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -586,11 +531,6 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) __nldbl_d ## name ## l # undef __MATHCALL_NARROW -# define __MATHCALL_NARROW(func, redir, nargs) \ - __MATHCALL_NARROW_REDIR (func, redir, nargs) -# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# define __MATHCALL_REDIR_NAME(name) __ ## f64 ## name ## ieee128 -# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -598,8 +538,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# if defined __LDBL_COMPAT \ - || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __LDBL_COMPAT # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -1257,6 +1196,13 @@ iszero (__T __val) # error "M_* values needed for _Float128x" #endif +/* When compiling in strict ISO C compatible mode we must not use the + inline functions since they, among other things, do not set the + `errno' variable correctly. */ +#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 +#endif + #ifdef __USE_ISOC99 # if __GNUC_PREREQ (3, 1) /* ISO C99 defines some macros to compare number while taking care for @@ -1294,6 +1240,12 @@ iszero (__T __val) # endif #endif +/* Get machine-dependent inline versions (if there are any). */ +#ifdef __USE_EXTERN_INLINES +# include +#endif + + #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ diff --git a/lib/libc/include/generic-glibc/monetary.h b/lib/libc/include/generic-glibc/monetary.h index e8142d7b07..d7789d087a 100644 --- a/lib/libc/include/generic-glibc/monetary.h +++ b/lib/libc/include/generic-glibc/monetary.h @@ -50,8 +50,7 @@ extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize, __THROW __attribute_format_strfmon__ (4, 5); #endif -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/netinet/icmp6.h b/lib/libc/include/generic-glibc/netinet/icmp6.h index 8f030dd8f9..0d1da5d26c 100644 --- a/lib/libc/include/generic-glibc/netinet/icmp6.h +++ b/lib/libc/include/generic-glibc/netinet/icmp6.h @@ -85,16 +85,16 @@ struct icmp6_hdr #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized IPv6 option */ #define ICMP6_FILTER_WILLPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1U << ((type) & 31))) == 0) + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) #define ICMP6_FILTER_WILLBLOCK(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1U << ((type) & 31))) != 0) + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) #define ICMP6_FILTER_SETPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1U << ((type) & 31)))) + ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))) #define ICMP6_FILTER_SETBLOCK(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) |= (1U << ((type) & 31)))) + ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))) #define ICMP6_FILTER_SETPASSALL(filterp) \ memset (filterp, 0, sizeof (struct icmp6_filter)); diff --git a/lib/libc/include/generic-glibc/netinet/in.h b/lib/libc/include/generic-glibc/netinet/in.h index ae09a54121..bcca1ad51e 100644 --- a/lib/libc/include/generic-glibc/netinet/in.h +++ b/lib/libc/include/generic-glibc/netinet/in.h @@ -87,12 +87,8 @@ enum #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_MPLS = 137, /* MPLS in IP. */ #define IPPROTO_MPLS IPPROTO_MPLS - IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation. */ -#define IPPROTO_ETHERNET IPPROTO_ETHERNET IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW - IPPROTO_MPTCP = 262, /* Multipath TCP connection. */ -#define IPPROTO_MPTCP IPPROTO_MPTCP IPPROTO_MAX }; diff --git a/lib/libc/include/generic-glibc/nss.h b/lib/libc/include/generic-glibc/nss.h index f17defc30f..d24028cc4f 100644 --- a/lib/libc/include/generic-glibc/nss.h +++ b/lib/libc/include/generic-glibc/nss.h @@ -19,12 +19,10 @@ and for implementors of new services. */ #ifndef _NSS_H -#define _NSS_H 1 +#define _NSS_H 1 #include -#include #include -#include __BEGIN_DECLS @@ -58,204 +56,7 @@ struct gaih_addrtuple Attention: Using this function repeatedly will slowly eat up the whole memory since previous selection data cannot be freed. */ extern int __nss_configure_lookup (const char *__dbname, - const char *__string) __THROW; - -/* NSS-related types. */ -struct __netgrent; -struct aliasent; -struct ether_addr; -struct etherent; -struct group; -struct hostent; -struct netent; -struct passwd; -struct protoent; -struct rpcent; -struct servent; -struct sgrp; -struct spwd; -struct traced_file; - -/* Types of functions exported from NSS service modules. */ -typedef enum nss_status nss_endaliasent (void); -typedef enum nss_status nss_endetherent (void); -typedef enum nss_status nss_endgrent (void); -typedef enum nss_status nss_endhostent (void); -typedef enum nss_status nss_endnetent (void); -typedef enum nss_status nss_endnetgrent (struct __netgrent *); -typedef enum nss_status nss_endprotoent (void); -typedef enum nss_status nss_endpwent (void); -typedef enum nss_status nss_endrpcent (void); -typedef enum nss_status nss_endservent (void); -typedef enum nss_status nss_endsgent (void); -typedef enum nss_status nss_endspent (void); -typedef enum nss_status nss_getaliasbyname_r (const char *, struct aliasent *, - char *, size_t, int *); -typedef enum nss_status nss_getaliasent_r (struct aliasent *, - char *, size_t, int *); -typedef enum nss_status nss_getcanonname_r (const char *, char *, size_t, - char **, int *, int *); -typedef enum nss_status nss_getetherent_r (struct etherent *, - char *, size_t, int *); -typedef enum nss_status nss_getgrent_r (struct group *, char *, size_t, int *); -typedef enum nss_status nss_getgrgid_r (__gid_t, struct group *, - char *, size_t, int *); -typedef enum nss_status nss_getgrnam_r (const char *, struct group *, - char *, size_t, int *); -typedef enum nss_status nss_gethostbyaddr2_r (const void *, __socklen_t, int, - struct hostent *, char *, size_t, - int *, int *, int32_t *); -typedef enum nss_status nss_gethostbyaddr_r (const void *, __socklen_t, int, - struct hostent *, char *, size_t, - int *, int *); -typedef enum nss_status nss_gethostbyname2_r (const char *, int, - struct hostent *, char *, size_t, - int *, int *); -typedef enum nss_status nss_gethostbyname3_r (const char *, int, - struct hostent *, char *, size_t, - int *, int *, int32_t *, - char **); -typedef enum nss_status nss_gethostbyname4_r (const char *, - struct gaih_addrtuple **, - char *, size_t, - int *, int *, int32_t *); -typedef enum nss_status nss_gethostbyname_r (const char *, struct hostent *, - char *, size_t, int *, int *); -typedef enum nss_status nss_gethostent_r (struct hostent *, char *, size_t, - int *, int *); -typedef enum nss_status nss_gethostton_r (const char *, struct etherent *, - char *, size_t, int *); -typedef enum nss_status nss_getnetbyaddr_r (uint32_t, int, struct netent *, - char *, size_t, int *, int *); -typedef enum nss_status nss_getnetbyname_r (const char *, struct netent *, - char *, size_t, int *, int *); -typedef enum nss_status nss_getnetent_r (struct netent *, - char *, size_t, int *, int *); -typedef enum nss_status nss_getnetgrent_r (struct __netgrent *, - char *, size_t, int *); -typedef enum nss_status nss_getntohost_r (const struct ether_addr *, - struct etherent *, char *, size_t, - int *); -typedef enum nss_status nss_getprotobyname_r (const char *, struct protoent *, - char *, size_t, int *); -typedef enum nss_status nss_getprotobynumber_r (int, struct protoent *, - char *, size_t, int *); -typedef enum nss_status nss_getprotoent_r (struct protoent *, - char *, size_t, int *); -typedef enum nss_status nss_getpublickey (const char *, char *, int *); -typedef enum nss_status nss_getpwent_r (struct passwd *, - char *, size_t, int *); -typedef enum nss_status nss_getpwnam_r (const char *, struct passwd *, - char *, size_t, int *); -typedef enum nss_status nss_getpwuid_r (__uid_t, struct passwd *, - char *, size_t, int *); -typedef enum nss_status nss_getrpcbyname_r (const char *, struct rpcent *, - char *, size_t, int *); -typedef enum nss_status nss_getrpcbynumber_r (int, struct rpcent *, - char *, size_t, int *); -typedef enum nss_status nss_getrpcent_r (struct rpcent *, - char *, size_t, int *); -typedef enum nss_status nss_getsecretkey (const char *, char *, char *, int *); -typedef enum nss_status nss_getservbyname_r (const char *, const char *, - struct servent *, char *, size_t, - int *); -typedef enum nss_status nss_getservbyport_r (int, const char *, - struct servent *, char *, size_t, - int *); -typedef enum nss_status nss_getservent_r (struct servent *, char *, size_t, - int *); -typedef enum nss_status nss_getsgent_r (struct sgrp *, char *, size_t, int *); -typedef enum nss_status nss_getsgnam_r (const char *, struct sgrp *, - char *, size_t, int *); -typedef enum nss_status nss_getspent_r (struct spwd *, char *, size_t, int *); -typedef enum nss_status nss_getspnam_r (const char *, struct spwd *, - char *, size_t, int *); -typedef void nss_init (void (*) (size_t, struct traced_file *)); -typedef enum nss_status nss_initgroups_dyn (const char *, __gid_t, long int *, - long int *, __gid_t **, long int, - int *); -typedef enum nss_status nss_netname2user (char [], __uid_t *, __gid_t *, - int *, __gid_t *, int *); -typedef enum nss_status nss_setaliasent (void); -typedef enum nss_status nss_setetherent (int); -typedef enum nss_status nss_setgrent (int); -typedef enum nss_status nss_sethostent (int); -typedef enum nss_status nss_setnetent (int); -typedef enum nss_status nss_setnetgrent (const char *, struct __netgrent *); -typedef enum nss_status nss_setprotoent (int); -typedef enum nss_status nss_setpwent (int); -typedef enum nss_status nss_setrpcent (int); -typedef enum nss_status nss_setservent (int); -typedef enum nss_status nss_setsgent (int); -typedef enum nss_status nss_setspent (int); - -/* Declare all NSS functions for MODULE. */ -#define NSS_DECLARE_MODULE_FUNCTIONS(module) \ - extern nss_endaliasent _nss_##module##_endaliasent; \ - extern nss_endetherent _nss_##module##_endetherent; \ - extern nss_endgrent _nss_##module##_endgrent; \ - extern nss_endhostent _nss_##module##_endhostent; \ - extern nss_endnetent _nss_##module##_endnetent; \ - extern nss_endnetgrent _nss_##module##__endnetgrent; \ - extern nss_endprotoent _nss_##module##_endprotoent; \ - extern nss_endpwent _nss_##module##_endpwent; \ - extern nss_endrpcent _nss_##module##_endrpcent; \ - extern nss_endservent _nss_##module##_endservent; \ - extern nss_endsgent _nss_##module##_endsgent; \ - extern nss_endspent _nss_##module##_endspent; \ - extern nss_getaliasbyname_r _nss_##module##_getaliasbyname_r; \ - extern nss_getaliasent_r _nss_##module##_getaliasent_r; \ - extern nss_getcanonname_r _nss_##module##_getcanonname_r; \ - extern nss_getetherent_r _nss_##module##_getetherent_r; \ - extern nss_getgrent_r _nss_##module##_getgrent_r; \ - extern nss_getgrgid_r _nss_##module##_getgrgid_r; \ - extern nss_getgrnam_r _nss_##module##_getgrnam_r; \ - extern nss_gethostbyaddr2_r _nss_##module##_gethostbyaddr2_r; \ - extern nss_gethostbyaddr_r _nss_##module##_gethostbyaddr_r; \ - extern nss_gethostbyname2_r _nss_##module##_gethostbyname2_r; \ - extern nss_gethostbyname3_r _nss_##module##_gethostbyname3_r; \ - extern nss_gethostbyname4_r _nss_##module##_gethostbyname4_r; \ - extern nss_gethostbyname_r _nss_##module##_gethostbyname_r; \ - extern nss_gethostent_r _nss_##module##_gethostent_r; \ - extern nss_gethostton_r _nss_##module##_gethostton_r; \ - extern nss_getnetbyaddr_r _nss_##module##_getnetbyaddr_r; \ - extern nss_getnetbyname_r _nss_##module##_getnetbyname_r; \ - extern nss_getnetent_r _nss_##module##_getnetent_r; \ - extern nss_getnetgrent_r _nss_##module##_getnetgrent_r; \ - extern nss_getntohost_r _nss_##module##_getntohost_r; \ - extern nss_getprotobyname_r _nss_##module##_getprotobyname_r; \ - extern nss_getprotobynumber_r _nss_##module##_getprotobynumber_r; \ - extern nss_getprotoent_r _nss_##module##_getprotoent_r; \ - extern nss_getpublickey _nss_##module##_getpublickey; \ - extern nss_getpwent_r _nss_##module##_getpwent_r; \ - extern nss_getpwnam_r _nss_##module##_getpwnam_r; \ - extern nss_getpwuid_r _nss_##module##_getpwuid_r; \ - extern nss_getrpcbyname_r _nss_##module##_getrpcbyname_r; \ - extern nss_getrpcbynumber_r _nss_##module##_getrpcbynumber_r; \ - extern nss_getrpcent_r _nss_##module##_getrpcent_r; \ - extern nss_getsecretkey _nss_##module##_getsecretkey; \ - extern nss_getservbyname_r _nss_##module##_getservbyname_r; \ - extern nss_getservbyport_r _nss_##module##_getservbyport_r; \ - extern nss_getservent_r _nss_##module##_getservent_r; \ - extern nss_getsgent_r _nss_##module##_getsgent_r; \ - extern nss_getsgnam_r _nss_##module##_getsgnam_r; \ - extern nss_getspent_r _nss_##module##_getspent_r; \ - extern nss_getspnam_r _nss_##module##_getspnam_r; \ - extern nss_init _nss_##module##_init; \ - extern nss_initgroups_dyn _nss_##module##_initgroups_dyn; \ - extern nss_netname2user _nss_##module##_netname2user; \ - extern nss_setaliasent _nss_##module##_setaliasent; \ - extern nss_setetherent _nss_##module##_setetherent; \ - extern nss_setgrent _nss_##module##_setgrent; \ - extern nss_sethostent _nss_##module##_sethostent; \ - extern nss_setnetent _nss_##module##_setnetent; \ - extern nss_setnetgrent _nss_##module##_setnetgrent; \ - extern nss_setprotoent _nss_##module##_setprotoent; \ - extern nss_setpwent _nss_##module##_setpwent; \ - extern nss_setrpcent _nss_##module##_setrpcent; \ - extern nss_setservent _nss_##module##_setservent; \ - extern nss_setsgent _nss_##module##_setsgent; \ - extern nss_setspent _nss_##module##_setspent; \ + const char *__string) __THROW; __END_DECLS diff --git a/lib/libc/include/generic-glibc/printf.h b/lib/libc/include/generic-glibc/printf.h index ac8ae173af..eaf489649e 100644 --- a/lib/libc/include/generic-glibc/printf.h +++ b/lib/libc/include/generic-glibc/printf.h @@ -182,8 +182,7 @@ extern int printf_size_info (const struct printf_info *__restrict __info, size_t __n, int *__restrict __argtypes) __THROW; -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/pthread.h b/lib/libc/include/generic-glibc/pthread.h index efa17507b6..b9914a0d45 100644 --- a/lib/libc/include/generic-glibc/pthread.h +++ b/lib/libc/include/generic-glibc/pthread.h @@ -27,7 +27,6 @@ #include #include #include -#include /* Detach state. */ @@ -386,20 +385,6 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, extern int pthread_getattr_default_np (pthread_attr_t *__attr) __THROW __nonnull ((1)); -/* Store *SIGMASK as the signal mask for the new thread in *ATTR. */ -extern int pthread_attr_setsigmask_np (pthread_attr_t *__attr, - const __sigset_t *sigmask); - -/* Store the signal mask of *ATTR in *SIGMASK. If there is no signal - mask stored, return PTHREAD_ATTR_NOSIGMASK_NP. Return zero on - success. */ -extern int pthread_attr_getsigmask_np (const pthread_attr_t *__attr, - __sigset_t *sigmask); - -/* Special return value from pthread_attr_getsigmask_np if the signal - mask has not been set. */ -#define PTHREAD_ATTR_NO_SIGMASK_NP (-1) - /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np (const pthread_attr_t *__attr) diff --git a/lib/libc/include/generic-glibc/signal.h b/lib/libc/include/generic-glibc/signal.h index 91b7be3621..7fa19ea215 100644 --- a/lib/libc/include/generic-glibc/signal.h +++ b/lib/libc/include/generic-glibc/signal.h @@ -27,7 +27,7 @@ __BEGIN_DECLS #include -#include +#include #include @@ -148,8 +148,7 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s); #ifdef __USE_XOPEN_EXTENDED # ifdef __GNUC__ -extern int sigpause (int __sig) __asm__ ("__xpg_sigpause") - __attribute_deprecated_msg__ ("Use the sigsuspend function instead"); +extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); # else extern int __sigpause (int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ @@ -165,9 +164,7 @@ extern int __sigpause (int __sig_or_mask, int __is_sig); simply do not work in many situations. Use `sigprocmask' instead. */ /* Compute mask for signal SIG. */ -# define sigmask(sig) \ - __glibc_macro_warning ("sigmask is deprecated") \ - ((int)(1u << ((sig) - 1))) +# define sigmask(sig) ((int)(1u << ((sig) - 1))) /* Block signals in MASK, returning the old mask. */ extern int sigblock (int __mask) __THROW __attribute_deprecated__; @@ -284,6 +281,12 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) #ifdef __USE_MISC +/* Names of the signals. This variable exists only for compatibility. + Use `strsignal' instead (see ). */ +extern const char *const _sys_siglist[_NSIG]; +extern const char *const sys_siglist[_NSIG]; + + /* Get machine-dependent `struct sigcontext' and signal subcodes. */ # include @@ -308,8 +311,7 @@ extern int sigreturn (struct sigcontext *__scp) __THROW; /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ -extern int siginterrupt (int __sig, int __interrupt) __THROW - __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead"); +extern int siginterrupt (int __sig, int __interrupt) __THROW; # include # include @@ -338,21 +340,16 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ -extern int sighold (int __sig) __THROW - __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); +extern int sighold (int __sig) __THROW; /* Remove SIG from the calling process' signal mask. */ -extern int sigrelse (int __sig) __THROW - __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); +extern int sigrelse (int __sig) __THROW; /* Set the disposition of SIG to SIG_IGN. */ -extern int sigignore (int __sig) __THROW - __attribute_deprecated_msg__ ("Use the signal function instead"); +extern int sigignore (int __sig) __THROW; /* Set the disposition of SIG. */ -extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW - __attribute_deprecated_msg__ - ("Use the signal and sigprocmask functions instead"); +extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 diff --git a/lib/libc/include/generic-glibc/stdio.h b/lib/libc/include/generic-glibc/stdio.h index f83759406f..7b5485826b 100644 --- a/lib/libc/include/generic-glibc/stdio.h +++ b/lib/libc/include/generic-glibc/stdio.h @@ -400,12 +400,9 @@ extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; /* For historical reasons, the C99-compliant versions of the scanf - functions are at alternative names. When __LDBL_COMPAT or - __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in - bits/stdio-ldbl.h. */ -#include -#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ - && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 + functions are at alternative names. When __LDBL_COMPAT is in + effect, this is handled in bits/stdio-ldbl.h. */ +#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT # ifdef __REDIRECT extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), @@ -450,8 +447,7 @@ extern int vsscanf (const char *__restrict __s, /* Same redirection as above for the v*scanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __REDIRECT && !defined __LDBL_COMPAT \ - && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 +# if defined __REDIRECT && !defined __LDBL_COMPAT extern int __REDIRECT (vfscanf, (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg), @@ -566,7 +562,7 @@ extern int putw (int __w, FILE *__stream); This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) - __wur __attr_access ((__write_only__, 1, 2)); + __wur; #if __GLIBC_USE (DEPRECATED_GETS) /* Get a newline-terminated string from stdin, removing the newline. @@ -589,8 +585,7 @@ extern char *gets (char *__s) __wur __attribute_deprecated__; or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked (char *__restrict __s, int __n, - FILE *__restrict __stream) __wur - __attr_access ((__write_only__, 1, 2)); + FILE *__restrict __stream) __wur; #endif @@ -779,6 +774,12 @@ extern int ferror_unlocked (FILE *__stream) __THROW __wur; marked with __THROW. */ extern void perror (const char *__s); +/* Provide the declarations for `sys_errlist' and `sys_nerr' if they + are available on this system. Even if available, these variables + should not be used directly. The `strerror' function provides + all the necessary functionality. */ +#include + #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ @@ -865,9 +866,7 @@ extern int __overflow (FILE *, int); #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif - -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/stdlib.h b/lib/libc/include/generic-glibc/stdlib.h index 3ffc3703d4..115bcee92d 100644 --- a/lib/libc/include/generic-glibc/stdlib.h +++ b/lib/libc/include/generic-glibc/stdlib.h @@ -397,7 +397,7 @@ extern long int a64l (const char *__s) `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ -/* Return a random long integer between 0 and 2^31-1 inclusive. */ +/* Return a random long integer between 0 and RAND_MAX inclusive. */ extern long int random (void) __THROW; /* Seed the random number generator with the given number. */ @@ -931,13 +931,12 @@ extern int wctomb (char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs (wchar_t *__restrict __pwcs, - const char *__restrict __s, size_t __n) __THROW - __attr_access ((__read_only__, 2)); + const char *__restrict __s, size_t __n) __THROW; /* Convert a wide char string to multibyte string. */ extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) - __THROW - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + __THROW; + #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation @@ -991,7 +990,7 @@ extern char *ptsname (int __fd) __THROW __wur; terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); + __THROW __nonnull ((2)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt (void); @@ -1017,9 +1016,7 @@ extern int ttyslot (void) __THROW; #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif - -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/string.h b/lib/libc/include/generic-glibc/string.h index 99d5158b5a..423cc537ed 100644 --- a/lib/libc/include/generic-glibc/string.h +++ b/lib/libc/include/generic-glibc/string.h @@ -53,7 +53,7 @@ extern void *memmove (void *__dest, const void *__src, size_t __n) #if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC2X) extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) - __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4)); + __THROW __nonnull ((1, 2)); #endif /* Misc || X/Open. */ @@ -108,15 +108,12 @@ extern void *rawmemchr (const void *__s, int __c) /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr (void *__s, int __c, size_t __n) - __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)) - __attr_access ((__read_only__, 1, 3)); + __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) - __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)) - __attr_access ((__read_only__, 1, 3)); + __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); # else extern void *memrchr (const void *__s, int __c, size_t __n) - __THROW __attribute_pure__ __nonnull ((1)) - __attr_access ((__read_only__, 1, 3)); + __THROW __attribute_pure__ __nonnull ((1)); # endif #endif @@ -149,7 +146,7 @@ extern int strcoll (const char *__s1, const char *__s2) /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) - __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3)); + __THROW __nonnull ((2)); #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ @@ -161,8 +158,7 @@ extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) /* Put a transformation of SRC into no more than N bytes of DEST, using sorting rules from L. */ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, - locale_t __l) __THROW __nonnull ((2, 4)) - __attr_access ((__write_only__, 1, 3)); + locale_t __l) __THROW __nonnull ((2, 4)); #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ @@ -372,9 +368,7 @@ extern char *strcasestr (const char *__haystack, const char *__needle) HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) - __THROW __attribute_pure__ __nonnull ((1, 3)) - __attr_access ((__read_only__, 1, 2)) - __attr_access ((__read_only__, 3, 4)); + __THROW __attribute_pure__ __nonnull ((1, 3)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ @@ -415,25 +409,17 @@ extern char *strerror (int __errnum) __THROW; # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), - __xpg_strerror_r) __nonnull ((2)) - __attr_access ((__write_only__, 2, 3)); + __xpg_strerror_r) __nonnull ((2)); # else extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); + __THROW __nonnull ((2)); # define strerror_r __xpg_strerror_r # endif # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur __attr_access ((__write_only__, 2, 3)); -# endif - -# ifdef __USE_GNU -/* Return a string describing the meaning of tthe error in ERR. */ -extern const char *strerrordesc_np (int __err) __THROW; -/* Return a string with the error name in ERR. */ -extern const char *strerrorname_np (int __err) __THROW; + __THROW __nonnull ((2)) __wur; # endif #endif @@ -447,8 +433,7 @@ extern char *strerror_l (int __errnum, locale_t __l) __THROW; /* Set N bytes of S to 0. The compiler will not delete a call to this function, even if S is dead after the call. */ -extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)) - __attr_access ((__write_only__, 1, 2)); +extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)); /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ @@ -461,14 +446,6 @@ extern char *strsep (char **__restrict __stringp, /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; -# ifdef __USE_GNU -/* Return an abbreviation string for the signal number SIG. */ -extern const char *sigabbrev_np (int __sig) __THROW; -/* Return a string describing the meaning of the signal number in SIG, - the result is not translated. */ -extern const char *sigdescr_np (int __sig) __THROW; -# endif - /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); @@ -494,8 +471,7 @@ extern int strverscmp (const char *__s1, const char *__s2) extern char *strfry (char *__string) __THROW __nonnull ((1)); /* Frobnicate N bytes of S. */ -extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)) - __attr_access ((__write_only__, 1, 2)); +extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)); # ifndef basename /* Return the file name within directory of FILENAME. We don't diff --git a/lib/libc/include/generic-glibc/sys/asm.h b/lib/libc/include/generic-glibc/sys/asm.h new file mode 100644 index 0000000000..b87759216a --- /dev/null +++ b/lib/libc/include/generic-glibc/sys/asm.h @@ -0,0 +1,497 @@ +/* Copyright (C) 1997-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _SYS_ASM_H +#define _SYS_ASM_H + +#include + +#ifndef CAT +# define __CAT(str1,str2) str1##str2 +# define CAT(str1,str2) __CAT(str1,str2) +#endif + +/* Redefined as nonempty in the internal header. */ +#define __mips_cfi_startproc /* Empty. */ +#define __mips_cfi_endproc /* Empty. */ + +/* + * Macros to handle different pointer/register sizes for 32/64-bit code + * + * 64 bit address space isn't used yet, so we may use the R3000 32 bit + * defines for now. + */ +#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 +# define PTR .word +# define PTRSIZE 4 +# define PTRLOG 2 +#elif _MIPS_SIM == _ABI64 +# define PTR .dword +# define PTRSIZE 8 +# define PTRLOG 3 +#endif + +/* + * PIC specific declarations + */ +#if _MIPS_SIM == _ABIO32 +# ifdef __PIC__ +# define CPRESTORE(register) \ + .cprestore register +# define CPLOAD(register) \ + .cpload register +# else +# define CPRESTORE(register) +# define CPLOAD(register) +# endif + +# define CPADD(register) \ + .cpadd register + +/* + * Set gp when at 1st instruction + */ +# define SETUP_GP \ + .set noreorder; \ + .cpload $25; \ + .set reorder +/* Set gp when not at 1st instruction */ +# define SETUP_GPX(r) \ + .set noreorder; \ + move r, $31; /* Save old ra. */ \ + bal 10f; /* Find addr of cpload. */ \ + nop; \ +10: \ + .cpload $31; \ + move $31, r; \ + .set reorder +# define SETUP_GPX_L(r, l) \ + .set noreorder; \ + move r, $31; /* Save old ra. */ \ + bal l; /* Find addr of cpload. */ \ + nop; \ +l: \ + .cpload $31; \ + move $31, r; \ + .set reorder +# define SAVE_GP(x) \ + .cprestore x /* Save gp trigger t9/jalr conversion. */ +# define SETUP_GP64(a, b) +# define SETUP_GPX64(a, b) +# define SETUP_GPX64_L(cp_reg, ra_save, l) +# define RESTORE_GP64 +# define USE_ALT_CP(a) +#else /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */ +/* + * For callee-saved gp calling convention: + */ +# define SETUP_GP +# define SETUP_GPX(r) +# define SETUP_GPX_L(r, l) +# define SAVE_GP(x) + +# define SETUP_GP64(gpoffset, proc) \ + .cpsetup $25, gpoffset, proc +# define SETUP_GPX64(cp_reg, ra_save) \ + move ra_save, $31; /* Save old ra. */ \ + .set noreorder; \ + bal 10f; /* Find addr of .cpsetup. */ \ + nop; \ +10: \ + .set reorder; \ + .cpsetup $31, cp_reg, 10b; \ + move $31, ra_save +# define SETUP_GPX64_L(cp_reg, ra_save, l) \ + move ra_save, $31; /* Save old ra. */ \ + .set noreorder; \ + bal l; /* Find addr of .cpsetup. */ \ + nop; \ +l: \ + .set reorder; \ + .cpsetup $31, cp_reg, l; \ + move $31, ra_save +# define RESTORE_GP64 \ + .cpreturn +/* Use alternate register for context pointer. */ +# define USE_ALT_CP(reg) \ + .cplocal reg +#endif /* _MIPS_SIM != _ABIO32 */ + +/* + * Stack Frame Definitions + */ +#if _MIPS_SIM == _ABIO32 +# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */ +#endif +#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 +# define NARGSAVE 0 /* No caller responsibilities. */ +#endif + + +/* + * LEAF - declare leaf routine + */ +#define LEAF(symbol) \ + .globl symbol; \ + .align 2; \ + .type symbol,@function; \ + .ent symbol,0; \ +symbol: .frame sp,0,ra; \ + __mips_cfi_startproc + +/* + * NESTED - declare nested routine entry point + */ +#define NESTED(symbol, framesize, rpc) \ + .globl symbol; \ + .align 2; \ + .type symbol,@function; \ + .ent symbol,0; \ +symbol: .frame sp, framesize, rpc; \ + __mips_cfi_startproc + +/* + * END - mark end of function + */ +#ifndef END +# define END(function) \ + __mips_cfi_endproc; \ + .end function; \ + .size function,.-function +#endif + +/* + * EXPORT - export definition of symbol + */ +#define EXPORT(symbol) \ + .globl symbol; \ +symbol: __mips_cfi_startproc + +/* + * ABS - export absolute symbol + */ +#define ABS(symbol,value) \ + .globl symbol; \ +symbol = value + +#define PANIC(msg) \ + .set push; \ + .set reorder; \ + la a0,8f; \ + jal panic; \ +9: b 9b; \ + .set pop; \ + TEXT(msg) + +/* + * Print formated string + */ +#define PRINT(string) \ + .set push; \ + .set reorder; \ + la a0,8f; \ + jal printk; \ + .set pop; \ + TEXT(string) + +#define TEXT(msg) \ + .data; \ +8: .asciiz msg; \ + .previous; + +/* + * Build text tables + */ +#define TTABLE(string) \ + .text; \ + .word 1f; \ + .previous; \ + .data; \ +1: .asciz string; \ + .previous + +/* + * MIPS IV pref instruction. + * Use with .set noreorder only! + * + * MIPS IV implementations are free to treat this as a nop. The R5000 + * is one of them. So we should have an option not to use this instruction. + */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) \ + || (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) +# define PREF(hint,addr) \ + pref hint,addr +# define PREFX(hint,addr) \ + prefx hint,addr +#else +# define PREF(hint,addr) +# define PREFX(hint,addr) +#endif + +/* + * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. + */ +#if _MIPS_ISA == _MIPS_ISA_MIPS1 +# define MOVN(rd,rs,rt) \ + .set push; \ + .set reorder; \ + beqz rt,9f; \ + move rd,rs; \ + .set pop; \ +9: +# define MOVZ(rd,rs,rt) \ + .set push; \ + .set reorder; \ + bnez rt,9f; \ + move rd,rt; \ + .set pop; \ +9: +#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) +# define MOVN(rd,rs,rt) \ + .set push; \ + .set noreorder; \ + bnezl rt,9f; \ + move rd,rs; \ + .set pop; \ +9: +# define MOVZ(rd,rs,rt) \ + .set push; \ + .set noreorder; \ + beqzl rt,9f; \ + movz rd,rs; \ + .set pop; \ +9: +#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) \ + || (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) +# define MOVN(rd,rs,rt) \ + movn rd,rs,rt +# define MOVZ(rd,rs,rt) \ + movz rd,rs,rt +#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */ + +/* + * Stack alignment + */ +#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 +# define ALSZ 15 +# define ALMASK ~15 +#else +# define ALSZ 7 +# define ALMASK ~7 +#endif + +/* + * Size of a register + */ +#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 +# define SZREG 8 +#else +# define SZREG 4 +#endif + +/* + * Use the following macros in assemblercode to load/store registers, + * pointers etc. + */ +#if (SZREG == 4) +# define REG_S sw +# define REG_L lw +#else +# define REG_S sd +# define REG_L ld +#endif + +/* + * How to add/sub/load/store/shift C int variables. + */ +#if (_MIPS_SZINT == 32) +# define INT_ADD add +# define INT_ADDI addi +# define INT_ADDU addu +# define INT_ADDIU addiu +# define INT_SUB sub +# define INT_SUBI subi +# define INT_SUBU subu +# define INT_SUBIU subu +# define INT_L lw +# define INT_S sw +#endif + +#if (_MIPS_SZINT == 64) +# define INT_ADD dadd +# define INT_ADDI daddi +# define INT_ADDU daddu +# define INT_ADDIU daddiu +# define INT_SUB dsub +# define INT_SUBI dsubi +# define INT_SUBU dsubu +# define INT_SUBIU dsubu +# define INT_L ld +# define INT_S sd +#endif + +/* + * How to add/sub/load/store/shift C long variables. + */ +#if (_MIPS_SZLONG == 32) +# define LONG_ADD add +# define LONG_ADDI addi +# define LONG_ADDU addu +# define LONG_ADDIU addiu +# define LONG_SUB sub +# define LONG_SUBI subi +# define LONG_SUBU subu +# define LONG_SUBIU subu +# define LONG_L lw +# define LONG_S sw +# define LONG_SLL sll +# define LONG_SLLV sllv +# define LONG_SRL srl +# define LONG_SRLV srlv +# define LONG_SRA sra +# define LONG_SRAV srav +#endif + +#if (_MIPS_SZLONG == 64) +# define LONG_ADD dadd +# define LONG_ADDI daddi +# define LONG_ADDU daddu +# define LONG_ADDIU daddiu +# define LONG_SUB dsub +# define LONG_SUBI dsubi +# define LONG_SUBU dsubu +# define LONG_SUBIU dsubu +# define LONG_L ld +# define LONG_S sd +# define LONG_SLL dsll +# define LONG_SLLV dsllv +# define LONG_SRL dsrl +# define LONG_SRLV dsrlv +# define LONG_SRA dsra +# define LONG_SRAV dsrav +#endif + +/* + * How to add/sub/load/store/shift pointers. + */ +#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 32) +# define PTR_ADD add +# define PTR_ADDI addi +# define PTR_ADDU addu +# define PTR_ADDIU addiu +# define PTR_SUB sub +# define PTR_SUBI subi +# define PTR_SUBU subu +# define PTR_SUBIU subu +# define PTR_L lw +# define PTR_LA la +# define PTR_S sw +# define PTR_SLL sll +# define PTR_SLLV sllv +# define PTR_SRL srl +# define PTR_SRLV srlv +# define PTR_SRA sra +# define PTR_SRAV srav + +# define PTR_SCALESHIFT 2 +#endif + +#if _MIPS_SIM == _ABIN32 +# define PTR_ADD add +# define PTR_ADDI addi +# define PTR_SUB sub +# define PTR_SUBI subi +#if !defined __mips_isa_rev || __mips_isa_rev < 6 +# define PTR_ADDU add /* no u */ +# define PTR_ADDIU addi /* no u */ +# define PTR_SUBU sub /* no u */ +# define PTR_SUBIU sub /* no u */ +#else +# define PTR_ADDU addu +# define PTR_ADDIU addiu +# define PTR_SUBU subu +# define PTR_SUBIU subu +#endif +# define PTR_L lw +# define PTR_LA la +# define PTR_S sw +# define PTR_SLL sll +# define PTR_SLLV sllv +# define PTR_SRL srl +# define PTR_SRLV srlv +# define PTR_SRA sra +# define PTR_SRAV srav + +# define PTR_SCALESHIFT 2 +#endif + +#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 64 /* o64??? */) \ + || _MIPS_SIM == _ABI64 +# define PTR_ADD dadd +# define PTR_ADDI daddi +# define PTR_ADDU daddu +# define PTR_ADDIU daddiu +# define PTR_SUB dsub +# define PTR_SUBI dsubi +# define PTR_SUBU dsubu +# define PTR_SUBIU dsubu +# define PTR_L ld +# define PTR_LA dla +# define PTR_S sd +# define PTR_SLL dsll +# define PTR_SLLV dsllv +# define PTR_SRL dsrl +# define PTR_SRLV dsrlv +# define PTR_SRA dsra +# define PTR_SRAV dsrav + +# define PTR_SCALESHIFT 3 +#endif + +/* + * Some cp0 registers were extended to 64bit for MIPS III. + */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) \ + || (_MIPS_ISA == _MIPS_ISA_MIPS32) +# define MFC0 mfc0 +# define MTC0 mtc0 +#endif +#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) \ + || (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64) +# define MFC0 dmfc0 +# define MTC0 dmtc0 +#endif + +/* The MIPS architectures do not have a uniform memory model. Particular + platforms may provide additional guarantees - for instance, the R4000 + LL and SC instructions implicitly perform a SYNC, and the 4K promises + strong ordering. + + However, in the absence of those guarantees, we must assume weak ordering + and SYNC explicitly where necessary. + + Some obsolete MIPS processors may not support the SYNC instruction. This + applies to "true" MIPS I processors; most of the processors which compile + using MIPS I implement parts of MIPS II. */ + +#ifndef MIPS_SYNC +# define MIPS_SYNC sync +#endif + +#endif /* sys/asm.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/cachectl.h b/lib/libc/include/generic-glibc/sys/cachectl.h new file mode 100644 index 0000000000..798a6819da --- /dev/null +++ b/lib/libc/include/generic-glibc/sys/cachectl.h @@ -0,0 +1,41 @@ +/* Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#include + +/* + * Get the kernel definition for the op bits. + */ +#include + +__BEGIN_DECLS + +#ifdef __USE_MISC +extern int cachectl (void *__addr, const int __nbytes, const int __op) __THROW; +#endif +extern int __cachectl (void *__addr, const int __nbytes, const int __op) __THROW; +#ifdef __USE_MISC +extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW; +#endif +extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW; + +__END_DECLS + +#endif /* sys/cachectl.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/cdefs.h b/lib/libc/include/generic-glibc/sys/cdefs.h index cee62de938..8d82b634bd 100644 --- a/lib/libc/include/generic-glibc/sys/cdefs.h +++ b/lib/libc/include/generic-glibc/sys/cdefs.h @@ -452,37 +452,7 @@ #include #include -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# ifdef __REDIRECT - -/* Alias name defined automatically. */ -# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir -# define __LDBL_REDIR_DECL(name) \ - extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); - -/* Alias name defined automatically, with leading underscores. */ -# define __LDBL_REDIR2_DECL(name) \ - extern __typeof (__##name) __##name \ - __asm (__ASMNAME ("__" #name "ieee128")); - -/* Alias name defined manually. */ -# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 -# define __LDBL_REDIR1_DECL(name, alias) \ - extern __typeof (name) name __asm (__ASMNAME (#alias)); - -# define __LDBL_REDIR1_NTH(name, proto, alias) \ - __REDIRECT_NTH (name, proto, alias) -# define __REDIRECT_NTH_LDBL(name, proto, alias) \ - __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) - -/* Unused. */ -# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl -# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth - -# else -_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); -# endif -#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) @@ -491,8 +461,6 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) -# define __LDBL_REDIR2_DECL(name) \ - extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ @@ -503,13 +471,11 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ - || !defined __REDIRECT +#if !defined __LDBL_COMPAT || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW -# define __LDBL_REDIR2_DECL(name) # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) @@ -548,15 +514,4 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf # define __HAVE_GENERIC_SELECTION 0 #endif -#if __GNUC_PREREQ (10, 0) -/* Designates a 1-based positional argument ref-index of pointer type - that can be used to access size-index elements of the pointed-to - array according to access mode, or at least one element when - size-index is not provided: - access (access-mode, [, ]) */ -#define __attr_access(x) __attribute__ ((__access__ x)) -#else -# define __attr_access(x) -#endif - #endif /* sys/cdefs.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/elf.h b/lib/libc/include/generic-glibc/sys/elf.h index d37502689d..134b815f4c 100644 --- a/lib/libc/include/generic-glibc/sys/elf.h +++ b/lib/libc/include/generic-glibc/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2020 Free Software Foundation, Inc. +/* Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,18 +12,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SYS_ELF_H #define _SYS_ELF_H 1 -#ifdef __x86_64__ -# error This header is unsupported on x86-64. -#else -# warning "This header is obsolete; use instead." +#warning "This header is obsolete; use instead." -# include -#endif +#include -#endif /* _SYS_ELF_H */ \ No newline at end of file +#endif /* sys/elf.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/ptrace.h b/lib/libc/include/generic-glibc/sys/ptrace.h index 0977a402d7..b420fa1cbc 100644 --- a/lib/libc/include/generic-glibc/sys/ptrace.h +++ b/lib/libc/include/generic-glibc/sys/ptrace.h @@ -1,4 +1,4 @@ -/* `ptrace' debugger support interface. Linux/x86 version. +/* `ptrace' debugger support interface. Linux version. Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -70,19 +70,23 @@ enum __ptrace_request PTRACE_SINGLESTEP = 9, #define PT_STEP PTRACE_SINGLESTEP - /* Get all general purpose registers used by a processes. */ + /* Get all general purpose registers used by a processes. + This is not supported on all machines. */ PTRACE_GETREGS = 12, #define PT_GETREGS PTRACE_GETREGS - /* Set all general purpose registers used by a processes. */ + /* Set all general purpose registers used by a processes. + This is not supported on all machines. */ PTRACE_SETREGS = 13, #define PT_SETREGS PTRACE_SETREGS - /* Get all floating point registers used by a processes. */ + /* Get all floating point registers used by a processes. + This is not supported on all machines. */ PTRACE_GETFPREGS = 14, #define PT_GETFPREGS PTRACE_GETFPREGS - /* Set all floating point registers used by a processes. */ + /* Set all floating point registers used by a processes. + This is not supported on all machines. */ PTRACE_SETFPREGS = 15, #define PT_SETFPREGS PTRACE_SETFPREGS @@ -94,11 +98,13 @@ enum __ptrace_request PTRACE_DETACH = 17, #define PT_DETACH PTRACE_DETACH - /* Get all extended floating point registers used by a processes. */ + /* Get all extended floating point registers used by a processes. + This is not supported on all machines. */ PTRACE_GETFPXREGS = 18, #define PT_GETFPXREGS PTRACE_GETFPXREGS - /* Set all extended floating point registers used by a processes. */ + /* Set all extended floating point registers used by a processes. + This is not supported on all machines. */ PTRACE_SETFPXREGS = 19, #define PT_SETFPXREGS PTRACE_SETFPXREGS @@ -106,32 +112,6 @@ enum __ptrace_request PTRACE_SYSCALL = 24, #define PT_SYSCALL PTRACE_SYSCALL - /* Get a TLS entry in the GDT. */ - PTRACE_GET_THREAD_AREA = 25, -#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA - - /* Change a TLS entry in the GDT. */ - PTRACE_SET_THREAD_AREA = 26, -#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA - -#ifdef __x86_64__ - /* Access TLS data. */ - PTRACE_ARCH_PRCTL = 30, -# define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL -#endif - - /* Continue and stop at the next syscall, it will not be executed. */ - PTRACE_SYSEMU = 31, -#define PT_SYSEMU PTRACE_SYSEMU - - /* Single step the process, the next syscall will not be executed. */ - PTRACE_SYSEMU_SINGLESTEP = 32, -#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP - - /* Execute process until next taken branch. */ - PTRACE_SINGLEBLOCK = 33, -#define PT_STEPBLOCK PTRACE_SINGLEBLOCK - /* Set ptrace filter options. */ PTRACE_SETOPTIONS = 0x4200, #define PT_SETOPTIONS PTRACE_SETOPTIONS diff --git a/lib/libc/include/generic-glibc/sys/random.h b/lib/libc/include/generic-glibc/sys/random.h index 690a5234cf..1ef7b160db 100644 --- a/lib/libc/include/generic-glibc/sys/random.h +++ b/lib/libc/include/generic-glibc/sys/random.h @@ -25,7 +25,6 @@ /* Flags for use with getrandom. */ #define GRND_NONBLOCK 0x01 #define GRND_RANDOM 0x02 -#define GRND_INSECURE 0x04 __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/sys/sysctl.h b/lib/libc/include/generic-glibc/sys/sysctl.h new file mode 100644 index 0000000000..e8def66c88 --- /dev/null +++ b/lib/libc/include/generic-glibc/sys/sysctl.h @@ -0,0 +1,76 @@ +/* Copyright (C) 1996-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SYSCTL_H +#define _SYS_SYSCTL_H 1 + +#warning "The header is deprecated and will be removed." + +#include +#define __need_size_t +#include +/* Prevent more kernel headers than necessary to be included. */ +#ifndef _LINUX_KERNEL_H +# define _LINUX_KERNEL_H 1 +# define __undef_LINUX_KERNEL_H +#endif +#ifndef _LINUX_TYPES_H +# define _LINUX_TYPES_H 1 +# define __undef_LINUX_TYPES_H +#endif +#ifndef _LINUX_LIST_H +# define _LINUX_LIST_H 1 +# define __undef_LINUX_LIST_H +#endif +#ifndef __LINUX_COMPILER_H +# define __LINUX_COMPILER_H 1 +# define __user +# define __undef__LINUX_COMPILER_H +#endif + +#include + +#ifdef __undef_LINUX_KERNEL_H +# undef _LINUX_KERNEL_H +# undef __undef_LINUX_KERNEL_H +#endif +#ifdef __undef_LINUX_TYPES_H +# undef _LINUX_TYPES_H +# undef __undef_LINUX_TYPES_H +#endif +#ifdef __undef_LINUX_LIST_H +# undef _LINUX_LIST_H +# undef __undef_LINUX_LIST_H +#endif +#ifdef __undef__LINUX_COMPILER_H +# undef __LINUX_COMPILER_H +# undef __user +# undef __undef__LINUX_COMPILER_H +#endif + +#include + +__BEGIN_DECLS + +/* Read or write system parameters. */ +extern int sysctl (int *__name, int __nlen, void *__oldval, + size_t *__oldlenp, void *__newval, size_t __newlen) __THROW + __attribute_deprecated__; + +__END_DECLS + +#endif /* _SYS_SYSCTL_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/syslog.h b/lib/libc/include/generic-glibc/sys/syslog.h index 3c249a2789..05b95a4bf1 100644 --- a/lib/libc/include/generic-glibc/sys/syslog.h +++ b/lib/libc/include/generic-glibc/sys/syslog.h @@ -206,9 +206,7 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif - -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/generic-glibc/sys/ucontext.h b/lib/libc/include/generic-glibc/sys/ucontext.h index 3244eab7c8..dfd6641750 100644 --- a/lib/libc/include/generic-glibc/sys/ucontext.h +++ b/lib/libc/include/generic-glibc/sys/ucontext.h @@ -1,5 +1,4 @@ -/* Copyright (C) 2001-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. +/* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -12,18 +11,36 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ +/* Don't rely on this, the interface is currently messed up and may need to + be broken to be fixed. */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include -#include #include #include +#include + + +/* Type for general register. Even in o32 we assume 64-bit registers, + like the kernel. */ +__extension__ typedef unsigned long long int greg_t; + +/* Number of general registers. */ +#define __NGREG 32 +#define __NFPREG 32 +#ifdef __USE_MISC +# define NGREG __NGREG +# define NFPREG __NFPREG +#endif + +/* Container for all general registers. */ +typedef greg_t gregset_t[__NGREG]; #ifdef __USE_MISC # define __ctx(fld) fld @@ -31,217 +48,66 @@ # define __ctx(fld) __ ## fld #endif -#ifdef __x86_64__ +/* Container for all FPU registers. */ +typedef struct { + union { + double __ctx(fp_dregs)[__NFPREG]; + struct { + float _fp_fregs; + unsigned int _fp_pad; + } __ctx(fp_fregs)[__NFPREG]; + } __ctx(fp_r); +} fpregset_t; -/* Type for general register. */ -__extension__ typedef long long int greg_t; - -/* Number of general registers. */ -#define __NGREG 23 -#ifdef __USE_MISC -# define NGREG __NGREG -#endif - -/* Container for all general registers. */ -typedef greg_t gregset_t[__NGREG]; - -#ifdef __USE_GNU -/* Number of each register in the `gregset_t' array. */ -enum -{ - REG_R8 = 0, -# define REG_R8 REG_R8 - REG_R9, -# define REG_R9 REG_R9 - REG_R10, -# define REG_R10 REG_R10 - REG_R11, -# define REG_R11 REG_R11 - REG_R12, -# define REG_R12 REG_R12 - REG_R13, -# define REG_R13 REG_R13 - REG_R14, -# define REG_R14 REG_R14 - REG_R15, -# define REG_R15 REG_R15 - REG_RDI, -# define REG_RDI REG_RDI - REG_RSI, -# define REG_RSI REG_RSI - REG_RBP, -# define REG_RBP REG_RBP - REG_RBX, -# define REG_RBX REG_RBX - REG_RDX, -# define REG_RDX REG_RDX - REG_RAX, -# define REG_RAX REG_RAX - REG_RCX, -# define REG_RCX REG_RCX - REG_RSP, -# define REG_RSP REG_RSP - REG_RIP, -# define REG_RIP REG_RIP - REG_EFL, -# define REG_EFL REG_EFL - REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ -# define REG_CSGSFS REG_CSGSFS - REG_ERR, -# define REG_ERR REG_ERR - REG_TRAPNO, -# define REG_TRAPNO REG_TRAPNO - REG_OLDMASK, -# define REG_OLDMASK REG_OLDMASK - REG_CR2 -# define REG_CR2 REG_CR2 -}; -#endif - -struct _libc_fpxreg -{ - unsigned short int __ctx(significand)[4]; - unsigned short int __ctx(exponent); - unsigned short int __glibc_reserved1[3]; -}; - -struct _libc_xmmreg -{ - __uint32_t __ctx(element)[4]; -}; - -struct _libc_fpstate -{ - /* 64-bit FXSAVE format. */ - __uint16_t __ctx(cwd); - __uint16_t __ctx(swd); - __uint16_t __ctx(ftw); - __uint16_t __ctx(fop); - __uint64_t __ctx(rip); - __uint64_t __ctx(rdp); - __uint32_t __ctx(mxcsr); - __uint32_t __ctx(mxcr_mask); - struct _libc_fpxreg _st[8]; - struct _libc_xmmreg _xmm[16]; - __uint32_t __glibc_reserved1[24]; -}; - -/* Structure to describe FPU registers. */ -typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ +#if _MIPS_SIM == _ABIO32 +/* Earlier versions of glibc for mips had an entirely different + definition of mcontext_t, that didn't even resemble the + corresponding kernel data structure. Fortunately, makecontext, + [gs]etcontext et all were not implemented back then, so this can + still be rectified. */ typedef struct { + unsigned int __ctx(regmask); + unsigned int __ctx(status); + greg_t __ctx(pc); gregset_t __ctx(gregs); - /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); - __extension__ unsigned long long __reserved1 [8]; -} mcontext_t; - -/* Userlevel context. */ -typedef struct ucontext_t - { - unsigned long int __ctx(uc_flags); - struct ucontext_t *uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - sigset_t uc_sigmask; - struct _libc_fpstate __fpregs_mem; - __extension__ unsigned long long int __ssp[4]; - } ucontext_t; - -#else /* !__x86_64__ */ - -/* Type for general register. */ -typedef int greg_t; - -/* Number of general registers. */ -#define __NGREG 19 -#ifdef __USE_MISC -# define NGREG __NGREG -#endif - -/* Container for all general registers. */ -typedef greg_t gregset_t[__NGREG]; - -#ifdef __USE_GNU -/* Number of each register is the `gregset_t' array. */ -enum -{ - REG_GS = 0, -# define REG_GS REG_GS - REG_FS, -# define REG_FS REG_FS - REG_ES, -# define REG_ES REG_ES - REG_DS, -# define REG_DS REG_DS - REG_EDI, -# define REG_EDI REG_EDI - REG_ESI, -# define REG_ESI REG_ESI - REG_EBP, -# define REG_EBP REG_EBP - REG_ESP, -# define REG_ESP REG_ESP - REG_EBX, -# define REG_EBX REG_EBX - REG_EDX, -# define REG_EDX REG_EDX - REG_ECX, -# define REG_ECX REG_ECX - REG_EAX, -# define REG_EAX REG_EAX - REG_TRAPNO, -# define REG_TRAPNO REG_TRAPNO - REG_ERR, -# define REG_ERR REG_ERR - REG_EIP, -# define REG_EIP REG_EIP - REG_CS, -# define REG_CS REG_CS - REG_EFL, -# define REG_EFL REG_EFL - REG_UESP, -# define REG_UESP REG_UESP - REG_SS -# define REG_SS REG_SS -}; -#endif - -/* Definitions taken from the kernel headers. */ -struct _libc_fpreg -{ - unsigned short int __ctx(significand)[4]; - unsigned short int __ctx(exponent); -}; - -struct _libc_fpstate -{ - unsigned long int __ctx(cw); - unsigned long int __ctx(sw); - unsigned long int __ctx(tag); - unsigned long int __ctx(ipoff); - unsigned long int __ctx(cssel); - unsigned long int __ctx(dataoff); - unsigned long int __ctx(datasel); - struct _libc_fpreg _st[8]; - unsigned long int __ctx(status); -}; - -/* Structure to describe FPU registers. */ -typedef struct _libc_fpstate *fpregset_t; - -/* Context to describe whole processor state. */ -typedef struct - { - gregset_t __ctx(gregs); - /* Due to Linux's history we have to use a pointer here. The SysV/i386 - ABI requires a struct with the values. */ - fpregset_t __ctx(fpregs); - unsigned long int __ctx(oldmask); - unsigned long int __ctx(cr2); + unsigned int __ctx(fp_owned); + unsigned int __ctx(fpc_csr); + unsigned int __ctx(fpc_eir); + unsigned int __ctx(used_math); + unsigned int __ctx(dsp); + greg_t __ctx(mdhi); + greg_t __ctx(mdlo); + unsigned long __ctx(hi1); + unsigned long __ctx(lo1); + unsigned long __ctx(hi2); + unsigned long __ctx(lo2); + unsigned long __ctx(hi3); + unsigned long __ctx(lo3); } mcontext_t; +#else +typedef struct + { + gregset_t __ctx(gregs); + fpregset_t __ctx(fpregs); + greg_t __ctx(mdhi); + greg_t __ctx(hi1); + greg_t __ctx(hi2); + greg_t __ctx(hi3); + greg_t __ctx(mdlo); + greg_t __ctx(lo1); + greg_t __ctx(lo2); + greg_t __ctx(lo3); + greg_t __ctx(pc); + unsigned int __ctx(fpc_csr); + unsigned int __ctx(used_math); + unsigned int __ctx(dsp); + unsigned int __glibc_reserved1; + } mcontext_t; +#endif /* Userlevel context. */ typedef struct ucontext_t @@ -251,12 +117,8 @@ typedef struct ucontext_t stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; - struct _libc_fpstate __fpregs_mem; - unsigned long int __ssp[4]; } ucontext_t; -#endif /* !__x86_64__ */ - #undef __ctx #endif /* sys/ucontext.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/user.h b/lib/libc/include/generic-glibc/sys/user.h index fe9d875789..bfe83781cd 100644 --- a/lib/libc/include/generic-glibc/sys/user.h +++ b/lib/libc/include/generic-glibc/sys/user.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,169 +12,199 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SYS_USER_H #define _SYS_USER_H 1 +#include +#include + /* The whole purpose of this file is for GDB and GDB only. Don't read too much into it. Don't use it for anything other than GDB unless you know what you are doing. */ -#ifdef __x86_64__ +/* #include */ +/* Instead of including the kernel header, that will vary depending on + whether the 32- or the 64-bit kernel is installed, we paste its + contents here. Note that the fact that the file is inline here, + instead of included separately, doesn't change in any way the + licensing status of a program that includes user.h. Since this is + for gdb alone, and gdb is GPLed, no surprises here. */ +#if _MIPS_SIM == _ABIO32 +/* + * Various register offset definitions for debuggers, core file + * examiners and whatnot. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1995, 1999 by Ralf Baechle + */ +#ifndef __ASM_MIPS_REG_H +#define __ASM_MIPS_REG_H -struct user_fpregs_struct -{ - unsigned short int cwd; - unsigned short int swd; - unsigned short int ftw; - unsigned short int fop; - __extension__ unsigned long long int rip; - __extension__ unsigned long long int rdp; - unsigned int mxcsr; - unsigned int mxcr_mask; - unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ - unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ - unsigned int padding[24]; -}; +/* + * This defines/structures correspond to the register layout on stack - + * if the order here is changed, it needs to be updated in + * include/asm-mips/stackframe.h + */ +#define EF_REG0 6 +#define EF_REG1 7 +#define EF_REG2 8 +#define EF_REG3 9 +#define EF_REG4 10 +#define EF_REG5 11 +#define EF_REG6 12 +#define EF_REG7 13 +#define EF_REG8 14 +#define EF_REG9 15 +#define EF_REG10 16 +#define EF_REG11 17 +#define EF_REG12 18 +#define EF_REG13 19 +#define EF_REG14 20 +#define EF_REG15 21 +#define EF_REG16 22 +#define EF_REG17 23 +#define EF_REG18 24 +#define EF_REG19 25 +#define EF_REG20 26 +#define EF_REG21 27 +#define EF_REG22 28 +#define EF_REG23 29 +#define EF_REG24 30 +#define EF_REG25 31 +/* + * k0/k1 unsaved + */ +#define EF_REG28 34 +#define EF_REG29 35 +#define EF_REG30 36 +#define EF_REG31 37 -struct user_regs_struct -{ - __extension__ unsigned long long int r15; - __extension__ unsigned long long int r14; - __extension__ unsigned long long int r13; - __extension__ unsigned long long int r12; - __extension__ unsigned long long int rbp; - __extension__ unsigned long long int rbx; - __extension__ unsigned long long int r11; - __extension__ unsigned long long int r10; - __extension__ unsigned long long int r9; - __extension__ unsigned long long int r8; - __extension__ unsigned long long int rax; - __extension__ unsigned long long int rcx; - __extension__ unsigned long long int rdx; - __extension__ unsigned long long int rsi; - __extension__ unsigned long long int rdi; - __extension__ unsigned long long int orig_rax; - __extension__ unsigned long long int rip; - __extension__ unsigned long long int cs; - __extension__ unsigned long long int eflags; - __extension__ unsigned long long int rsp; - __extension__ unsigned long long int ss; - __extension__ unsigned long long int fs_base; - __extension__ unsigned long long int gs_base; - __extension__ unsigned long long int ds; - __extension__ unsigned long long int es; - __extension__ unsigned long long int fs; - __extension__ unsigned long long int gs; -}; +/* + * Saved special registers + */ +#define EF_LO 38 +#define EF_HI 39 + +#define EF_CP0_EPC 40 +#define EF_CP0_BADVADDR 41 +#define EF_CP0_STATUS 42 +#define EF_CP0_CAUSE 43 + +#define EF_SIZE 180 /* size in bytes */ + +#endif /* __ASM_MIPS_REG_H */ + +#else /* _MIPS_SIM != _ABIO32 */ + +/* + * Various register offset definitions for debuggers, core file + * examiners and whatnot. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1995, 1999 Ralf Baechle + * Copyright (C) 1995, 1999 Silicon Graphics + */ +#ifndef _ASM_REG_H +#define _ASM_REG_H + +/* + * This defines/structures correspond to the register layout on stack - + * if the order here is changed, it needs to be updated in + * include/asm-mips/stackframe.h + */ +#define EF_REG0 0 +#define EF_REG1 1 +#define EF_REG2 2 +#define EF_REG3 3 +#define EF_REG4 4 +#define EF_REG5 5 +#define EF_REG6 6 +#define EF_REG7 7 +#define EF_REG8 8 +#define EF_REG9 9 +#define EF_REG10 10 +#define EF_REG11 11 +#define EF_REG12 12 +#define EF_REG13 13 +#define EF_REG14 14 +#define EF_REG15 15 +#define EF_REG16 16 +#define EF_REG17 17 +#define EF_REG18 18 +#define EF_REG19 19 +#define EF_REG20 20 +#define EF_REG21 21 +#define EF_REG22 22 +#define EF_REG23 23 +#define EF_REG24 24 +#define EF_REG25 25 +/* + * k0/k1 unsaved + */ +#define EF_REG28 28 +#define EF_REG29 29 +#define EF_REG30 30 +#define EF_REG31 31 + +/* + * Saved special registers + */ +#define EF_LO 32 +#define EF_HI 33 + +#define EF_CP0_EPC 34 +#define EF_CP0_BADVADDR 35 +#define EF_CP0_STATUS 36 +#define EF_CP0_CAUSE 37 + +#define EF_SIZE 304 /* size in bytes */ + +#endif /* _ASM_REG_H */ + +#endif /* _MIPS_SIM != _ABIO32 */ + +#if _MIPS_SIM == _ABIO32 struct user { - struct user_regs_struct regs; - int u_fpvalid; - struct user_fpregs_struct i387; - __extension__ unsigned long long int u_tsize; - __extension__ unsigned long long int u_dsize; - __extension__ unsigned long long int u_ssize; - __extension__ unsigned long long int start_code; - __extension__ unsigned long long int start_stack; - __extension__ long long int signal; - int reserved; - __extension__ union - { - struct user_regs_struct* u_ar0; - __extension__ unsigned long long int __u_ar0_word; - }; - __extension__ union - { - struct user_fpregs_struct* u_fpstate; - __extension__ unsigned long long int __u_fpstate_word; - }; - __extension__ unsigned long long int magic; - char u_comm [32]; - __extension__ unsigned long long int u_debugreg [8]; + unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */ + size_t u_tsize; /* text size (pages) */ + size_t u_dsize; /* data size (pages) */ + size_t u_ssize; /* stack size (pages) */ + unsigned long start_code; /* text starting address */ + unsigned long start_data; /* data starting address */ + unsigned long start_stack; /* stack starting address */ + long int signal; /* signal causing core dump */ + void* u_ar0; /* help gdb find registers */ + unsigned long magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ }; #else -/* These are the 32-bit x86 structures. */ -struct user_fpregs_struct -{ - long int cwd; - long int swd; - long int twd; - long int fip; - long int fcs; - long int foo; - long int fos; - long int st_space [20]; + +struct user { + __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */ + __extension__ unsigned long u_tsize; /* text size (pages) */ + __extension__ unsigned long u_dsize; /* data size (pages) */ + __extension__ unsigned long u_ssize; /* stack size (pages) */ + __extension__ unsigned long long start_code; /* text starting address */ + __extension__ unsigned long long start_data; /* data starting address */ + __extension__ unsigned long long start_stack; /* stack starting address */ + __extension__ long long signal; /* signal causing core dump */ + __extension__ unsigned long long u_ar0; /* help gdb find registers */ + __extension__ unsigned long long magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ }; -struct user_fpxregs_struct -{ - unsigned short int cwd; - unsigned short int swd; - unsigned short int twd; - unsigned short int fop; - long int fip; - long int fcs; - long int foo; - long int fos; - long int mxcsr; - long int reserved; - long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ - long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ - long int padding[56]; -}; - -struct user_regs_struct -{ - long int ebx; - long int ecx; - long int edx; - long int esi; - long int edi; - long int ebp; - long int eax; - long int xds; - long int xes; - long int xfs; - long int xgs; - long int orig_eax; - long int eip; - long int xcs; - long int eflags; - long int esp; - long int xss; -}; - -struct user -{ - struct user_regs_struct regs; - int u_fpvalid; - struct user_fpregs_struct i387; - unsigned long int u_tsize; - unsigned long int u_dsize; - unsigned long int u_ssize; - unsigned long int start_code; - unsigned long int start_stack; - long int signal; - int reserved; - struct user_regs_struct* u_ar0; - struct user_fpregs_struct* u_fpstate; - unsigned long int magic; - char u_comm [32]; - int u_debugreg [8]; -}; -#endif /* __x86_64__ */ - -#define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) +#endif #endif /* _SYS_USER_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/threads.h b/lib/libc/include/generic-glibc/threads.h index a176ad32cc..212eac67ef 100644 --- a/lib/libc/include/generic-glibc/threads.h +++ b/lib/libc/include/generic-glibc/threads.h @@ -24,7 +24,7 @@ __BEGIN_DECLS -#include +#include #include #ifndef __cplusplus @@ -32,10 +32,10 @@ __BEGIN_DECLS #endif #define TSS_DTOR_ITERATIONS 4 -typedef __tss_t tss_t; +typedef unsigned int tss_t; typedef void (*tss_dtor_t) (void*); -typedef __thrd_t thrd_t; +typedef unsigned long int thrd_t; typedef int (*thrd_start_t) (void*); /* Exit and error codes. */ @@ -56,8 +56,11 @@ enum mtx_timed = 2 }; -typedef __once_flag once_flag; -#define ONCE_FLAG_INIT __ONCE_FLAG_INIT +typedef struct +{ + int __data __ONCE_ALIGNMENT; +} once_flag; +#define ONCE_FLAG_INIT { 0 } typedef union { diff --git a/lib/libc/include/generic-glibc/unistd.h b/lib/libc/include/generic-glibc/unistd.h index 83a83213c0..2decd11b88 100644 --- a/lib/libc/include/generic-glibc/unistd.h +++ b/lib/libc/include/generic-glibc/unistd.h @@ -357,15 +357,13 @@ extern int close (int __fd); This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur - __attr_access ((__write_only__, 2, 3)); +extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur; /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur - __attr_access ((__read_only__, 2, 3)); +extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur; #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 @@ -376,8 +374,7 @@ extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, - __off_t __offset) __wur - __attr_access ((__write_only__, 2, 3)); + __off_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. @@ -385,19 +382,15 @@ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, - __off_t __offset) __wur - __attr_access ((__read_only__, 2, 3)); - + __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), - pread64) __wur - __attr_access ((__write_only__, 2, 3)); + pread64) __wur; extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), - pwrite64) __wur - __attr_access ((__read_only__, 2, 3)); + pwrite64) __wur; # else # define pread pread64 # define pwrite pwrite64 @@ -409,13 +402,11 @@ extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset) __wur - __attr_access ((__write_only__, 2, 3)); + __off64_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n, - __off64_t __offset) __wur - __attr_access ((__read_only__, 2, 3)); + __off64_t __offset) __wur; # endif #endif @@ -517,8 +508,7 @@ extern int fchdir (int __fd) __THROW __wur; an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ -extern char *getcwd (char *__buf, size_t __size) __THROW __wur - __attr_access ((__write_only__, 1, 2)); +extern char *getcwd (char *__buf, size_t __size) __THROW __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. @@ -533,8 +523,7 @@ extern char *get_current_dir_name (void) __THROW; If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd (char *__buf) - __THROW __nonnull ((1)) __attribute_deprecated__ __wur - __attr_access ((__write_only__, 1)); + __THROW __nonnull ((1)) __attribute_deprecated__ __wur; #endif @@ -631,8 +620,7 @@ extern long int sysconf (int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ -extern size_t confstr (int __name, char *__buf, size_t __len) __THROW - __attr_access ((__write_only__, 2, 3)); +extern size_t confstr (int __name, char *__buf, size_t __len) __THROW; #endif @@ -698,8 +686,8 @@ extern __gid_t getegid (void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ -extern int getgroups (int __size, __gid_t __list[]) __THROW __wur - __attr_access ((__write_only__, 2, 1)); +extern int getgroups (int __size, __gid_t __list[]) __THROW __wur; + #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member (__gid_t __gid) __THROW; @@ -784,7 +772,7 @@ extern char *ttyname (int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur __attr_access ((__write_only__, 2, 3)); + __THROW __nonnull ((2)) __wur; /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ @@ -819,8 +807,7 @@ extern int symlink (const char *__from, const char *__to) Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); - + __THROW __nonnull ((1, 2)) __wur; #endif /* Use POSIX.1-2001. */ #ifdef __USE_ATFILE @@ -831,7 +818,7 @@ extern int symlinkat (const char *__from, int __tofd, /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4)); + __THROW __nonnull ((2, 3)) __wur; #endif /* Remove the link NAME. */ @@ -866,8 +853,7 @@ extern char *getlogin (void); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)) - __attr_access ((__write_only__, 1, 2)); +extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)); #endif #ifdef __USE_MISC @@ -888,8 +874,7 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1)); /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ -extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)) - __attr_access ((__write_only__, 1, 2)); +extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); #endif @@ -897,7 +882,7 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)) /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname (const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur __attr_access ((__read_only__, 1, 2)); + __THROW __nonnull ((1)) __wur; /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ @@ -908,9 +893,10 @@ extern int sethostid (long int __id) __THROW __wur; Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) - __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); + __THROW __nonnull ((1)) __wur; extern int setdomainname (const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur __attr_access ((__read_only__, 1, 2)); + __THROW __nonnull ((1)) __wur; + /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process @@ -1145,9 +1131,7 @@ extern char *crypt (const char *__key, const char *__salt) range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab (const void *__restrict __from, void *__restrict __to, - ssize_t __n) __THROW __nonnull ((1, 2)) - __attr_access ((__read_only__, 1, 3)) - __attr_access ((__write_only__, 2, 3)); + ssize_t __n) __THROW __nonnull ((1, 2)); #endif @@ -1174,8 +1158,7 @@ extern int pthread_atfork (void (*__prepare) (void), #ifdef __USE_MISC /* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error. */ -int getentropy (void *__buffer, size_t __length) __wur - __attr_access ((__write_only__, 1, 2)); +int getentropy (void *__buffer, size_t __length) __wur; #endif /* Define some macros helping to catch buffer overflows. */ diff --git a/lib/libc/include/generic-glibc/wchar.h b/lib/libc/include/generic-glibc/wchar.h index f92623639b..f358a1400f 100644 --- a/lib/libc/include/generic-glibc/wchar.h +++ b/lib/libc/include/generic-glibc/wchar.h @@ -633,11 +633,9 @@ extern int swscanf (const wchar_t *__restrict __s, __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* For historical reasons, the C99-compliant versions of the scanf - functions are at alternative names. When __LDBL_COMPAT or - __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in - bits/wchar-ldbl.h. */ -#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ - && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 + functions are at alternative names. When __LDBL_COMPAT is in + effect, this is handled in bits/wchar-ldbl.h. */ +#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT # ifdef __REDIRECT extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), @@ -690,8 +688,7 @@ extern int vswscanf (const wchar_t *__restrict __s, /* Same redirection as above for the v*wscanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \ - && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 + && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, @@ -852,8 +849,7 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, # include #endif -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __LDBL_COMPAT # include #endif diff --git a/lib/libc/include/i386-linux-gnu/bits/fenv.h b/lib/libc/include/i386-linux-gnu/bits/fenv.h index b504e27b15..3164b63556 100644 --- a/lib/libc/include/i386-linux-gnu/bits/fenv.h +++ b/lib/libc/include/i386-linux-gnu/bits/fenv.h @@ -113,4 +113,58 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) +#endif + + +#ifdef __USE_EXTERN_INLINES +__BEGIN_DECLS + +/* Optimized versions. */ +#ifndef _LIBC +extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); +#endif +__extern_always_inline void +__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) +{ + if ((FE_INVALID & __excepts) != 0) + { + /* One example of an invalid operation is 0.0 / 0.0. */ + float __f = 0.0; + +# ifdef __SSE_MATH__ + __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); +# else + __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" + : "=t" (__f) : "0" (__f)); +# endif + (void) &__f; + } + if ((FE_DIVBYZERO & __excepts) != 0) + { + float __f = 1.0; + float __g = 0.0; + +# ifdef __SSE_MATH__ + __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); +# else + __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" + : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); +# endif + (void) &__f; + } +} +__extern_inline int +__NTH (feraiseexcept (int __excepts)) +{ + if (__builtin_constant_p (__excepts) + && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) + { + __feraiseexcept_invalid_divbyzero (__excepts); + return 0; + } + + return __feraiseexcept_renamed (__excepts); +} + +__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/long-double.h b/lib/libc/include/i386-linux-gnu/bits/long-double.h index 75bc1fcce4..a7bd8fb163 100644 --- a/lib/libc/include/i386-linux-gnu/bits/long-double.h +++ b/lib/libc/include/i386-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/select.h b/lib/libc/include/i386-linux-gnu/bits/select.h index d71b5e4ce2..959d998266 100644 --- a/lib/libc/include/i386-linux-gnu/bits/select.h +++ b/lib/libc/include/i386-linux-gnu/bits/select.h @@ -19,19 +19,45 @@ # error "Never use directly; include instead." #endif +#include + + +#if defined __GNUC__ && __GNUC__ >= 2 + +# if __WORDSIZE == 64 +# define __FD_ZERO_STOS "stosq" +# else +# define __FD_ZERO_STOS "stosl" +# endif + +# define __FD_ZERO(fdsp) \ + do { \ + int __d0, __d1; \ + __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ + : "=c" (__d0), "=D" (__d1) \ + : "a" (0), "0" (sizeof (fd_set) \ + / sizeof (__fd_mask)), \ + "1" (&__FDS_BITS (fdsp)[0]) \ + : "memory"); \ + } while (0) + +#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -#define __FD_ZERO(s) \ +# define __FD_ZERO(set) \ do { \ unsigned int __i; \ - fd_set *__arr = (s); \ + fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) -#define __FD_SET(d, s) \ - ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) -#define __FD_CLR(d, s) \ - ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) -#define __FD_ISSET(d, s) \ - ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file + +#endif /* GNU CC */ + +#define __FD_SET(d, set) \ + ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) +#define __FD_CLR(d, set) \ + ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) +#define __FD_ISSET(d, set) \ + ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/sem-pad.h b/lib/libc/include/i386-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..10534c61cf --- /dev/null +++ b/lib/libc/include/i386-linux-gnu/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. x86 version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 1 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/semaphore.h b/lib/libc/include/i386-linux-gnu/bits/semaphore.h index 97292723c8..7f41d9a880 100644 --- a/lib/libc/include/i386-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/i386-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,7 @@ # define __SIZEOF_SEM_T 16 #endif + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/i386-linux-gnu/bits/sysctl.h b/lib/libc/include/i386-linux-gnu/bits/sysctl.h new file mode 100644 index 0000000000..5e2b946cdf --- /dev/null +++ b/lib/libc/include/i386-linux-gnu/bits/sysctl.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2012-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if defined __x86_64__ && defined __ILP32__ +# error "sysctl system call is unsupported in x32 kernel" +#endif \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/typesizes.h b/lib/libc/include/i386-linux-gnu/bits/typesizes.h index 53ae0bd5ef..7ad60c3f43 100644 --- a/lib/libc/include/i386-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/i386-linux-gnu/bits/typesizes.h @@ -64,7 +64,6 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -88,15 +87,10 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/mips-linux-gnu/bits/msq-pad.h b/lib/libc/include/mips-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..132f7815a7 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#ifdef __MIPSEL__ +# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +# define __MSQ_PAD_BEFORE_TIME 0 +#else +# define __MSQ_PAD_AFTER_TIME 0 +# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) +#endif \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/resource.h b/lib/libc/include/mips-linux-gnu/bits/resource.h index f2a2c48a9d..11fc73b49d 100644 --- a/lib/libc/include/mips-linux-gnu/bits/resource.h +++ b/lib/libc/include/mips-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips-linux-gnu/bits/sem-pad.h b/lib/libc/include/mips-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..0638180f08 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/shm-pad.h b/lib/libc/include/mips-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..1c596174a8 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/shm-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct shmid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/signum.h b/lib/libc/include/mips-linux-gnu/bits/signum.h new file mode 100644 index 0000000000..e9fa21916b --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Linux/MIPS version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/MIPS. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGPWR 19 /* Power failure imminent. */ + +#undef SIGUSR1 +#define SIGUSR1 16 +#undef SIGUSR2 +#define SIGUSR2 17 +#undef SIGCHLD +#define SIGCHLD 18 +#undef SIGWINCH +#define SIGWINCH 20 +#undef SIGURG +#define SIGURG 21 +#undef SIGPOLL +#define SIGPOLL 22 +#undef SIGSTOP +#define SIGSTOP 23 +#undef SIGTSTP +#define SIGTSTP 24 +#undef SIGCONT +#define SIGCONT 25 +#undef SIGTTIN +#define SIGTTIN 26 +#undef SIGTTOU +#define SIGTTOU 27 +#undef SIGVTALRM +#define SIGVTALRM 28 +#undef SIGPROF +#define SIGPROF 29 +#undef SIGXCPU +#define SIGXCPU 30 +#undef SIGXFSZ +#define SIGXFSZ 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 127 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h new file mode 100644 index 0000000000..132f7815a7 --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#ifdef __MIPSEL__ +# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +# define __MSQ_PAD_BEFORE_TIME 0 +#else +# define __MSQ_PAD_AFTER_TIME 0 +# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h b/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h index f2a2c48a9d..11fc73b49d 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h new file mode 100644 index 0000000000..0638180f08 --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h new file mode 100644 index 0000000000..1c596174a8 --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct shmid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h b/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h new file mode 100644 index 0000000000..e9fa21916b --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Linux/MIPS version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/MIPS. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGPWR 19 /* Power failure imminent. */ + +#undef SIGUSR1 +#define SIGUSR1 16 +#undef SIGUSR2 +#define SIGUSR2 17 +#undef SIGCHLD +#define SIGCHLD 18 +#undef SIGWINCH +#define SIGWINCH 20 +#undef SIGURG +#define SIGURG 21 +#undef SIGPOLL +#define SIGPOLL 22 +#undef SIGSTOP +#define SIGSTOP 23 +#undef SIGTSTP +#define SIGTSTP 24 +#undef SIGCONT +#define SIGCONT 25 +#undef SIGTTIN +#define SIGTTIN 26 +#undef SIGTTOU +#define SIGTTOU 27 +#undef SIGVTALRM +#define SIGVTALRM 28 +#undef SIGPROF +#define SIGPROF 29 +#undef SIGXCPU +#define SIGXCPU 30 +#undef SIGXFSZ +#define SIGXFSZ 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 127 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h new file mode 100644 index 0000000000..132f7815a7 --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#ifdef __MIPSEL__ +# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +# define __MSQ_PAD_BEFORE_TIME 0 +#else +# define __MSQ_PAD_AFTER_TIME 0 +# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h b/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h index f2a2c48a9d..11fc73b49d 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h new file mode 100644 index 0000000000..0638180f08 --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h new file mode 100644 index 0000000000..1c596174a8 --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct shmid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h b/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h new file mode 100644 index 0000000000..e9fa21916b --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Linux/MIPS version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/MIPS. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGPWR 19 /* Power failure imminent. */ + +#undef SIGUSR1 +#define SIGUSR1 16 +#undef SIGUSR2 +#define SIGUSR2 17 +#undef SIGCHLD +#define SIGCHLD 18 +#undef SIGWINCH +#define SIGWINCH 20 +#undef SIGURG +#define SIGURG 21 +#undef SIGPOLL +#define SIGPOLL 22 +#undef SIGSTOP +#define SIGSTOP 23 +#undef SIGTSTP +#define SIGTSTP 24 +#undef SIGCONT +#define SIGCONT 25 +#undef SIGTTIN +#define SIGTTIN 26 +#undef SIGTTOU +#define SIGTTOU 27 +#undef SIGVTALRM +#define SIGVTALRM 28 +#undef SIGPROF +#define SIGPROF 29 +#undef SIGXCPU +#define SIGXCPU 30 +#undef SIGXFSZ +#define SIGXFSZ 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 127 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h new file mode 100644 index 0000000000..132f7815a7 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#ifdef __MIPSEL__ +# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +# define __MSQ_PAD_BEFORE_TIME 0 +#else +# define __MSQ_PAD_AFTER_TIME 0 +# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h index f2a2c48a9d..11fc73b49d 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h new file mode 100644 index 0000000000..0638180f08 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h new file mode 100644 index 0000000000..1c596174a8 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct shmid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h new file mode 100644 index 0000000000..e9fa21916b --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Linux/MIPS version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/MIPS. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGPWR 19 /* Power failure imminent. */ + +#undef SIGUSR1 +#define SIGUSR1 16 +#undef SIGUSR2 +#define SIGUSR2 17 +#undef SIGCHLD +#define SIGCHLD 18 +#undef SIGWINCH +#define SIGWINCH 20 +#undef SIGURG +#define SIGURG 21 +#undef SIGPOLL +#define SIGPOLL 22 +#undef SIGSTOP +#define SIGSTOP 23 +#undef SIGTSTP +#define SIGTSTP 24 +#undef SIGCONT +#define SIGCONT 25 +#undef SIGTTIN +#define SIGTTIN 26 +#undef SIGTTOU +#define SIGTTOU 27 +#undef SIGVTALRM +#define SIGVTALRM 28 +#undef SIGPROF +#define SIGPROF 29 +#undef SIGXCPU +#define SIGXCPU 30 +#undef SIGXFSZ +#define SIGXFSZ 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 127 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h new file mode 100644 index 0000000000..132f7815a7 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#ifdef __MIPSEL__ +# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +# define __MSQ_PAD_BEFORE_TIME 0 +#else +# define __MSQ_PAD_AFTER_TIME 0 +# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h index f2a2c48a9d..11fc73b49d 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h new file mode 100644 index 0000000000..0638180f08 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h new file mode 100644 index 0000000000..1c596174a8 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct shmid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h new file mode 100644 index 0000000000..e9fa21916b --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Linux/MIPS version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/MIPS. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGPWR 19 /* Power failure imminent. */ + +#undef SIGUSR1 +#define SIGUSR1 16 +#undef SIGUSR2 +#define SIGUSR2 17 +#undef SIGCHLD +#define SIGCHLD 18 +#undef SIGWINCH +#define SIGWINCH 20 +#undef SIGURG +#define SIGURG 21 +#undef SIGPOLL +#define SIGPOLL 22 +#undef SIGSTOP +#define SIGSTOP 23 +#undef SIGTSTP +#define SIGTSTP 24 +#undef SIGCONT +#define SIGCONT 25 +#undef SIGTTIN +#define SIGTTIN 26 +#undef SIGTTOU +#define SIGTTOU 27 +#undef SIGVTALRM +#define SIGVTALRM 28 +#undef SIGPROF +#define SIGPROF 29 +#undef SIGXCPU +#define SIGXCPU 30 +#undef SIGXFSZ +#define SIGXFSZ 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 127 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..132f7815a7 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h @@ -0,0 +1,31 @@ +/* Define where padding goes in struct msqid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#ifdef __MIPSEL__ +# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) +# define __MSQ_PAD_BEFORE_TIME 0 +#else +# define __MSQ_PAD_AFTER_TIME 0 +# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) +#endif \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/resource.h b/lib/libc/include/mipsel-linux-gnu/bits/resource.h index f2a2c48a9d..11fc73b49d 100644 --- a/lib/libc/include/mipsel-linux-gnu/bits/resource.h +++ b/lib/libc/include/mipsel-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..0638180f08 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..1c596174a8 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct shmid_ds. MIPS version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME 0 +#define __SHM_SEGSZ_AFTER_TIME 0 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/signum.h b/lib/libc/include/mipsel-linux-gnu/bits/signum.h new file mode 100644 index 0000000000..e9fa21916b --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnu/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Linux/MIPS version. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/MIPS. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGPWR 19 /* Power failure imminent. */ + +#undef SIGUSR1 +#define SIGUSR1 16 +#undef SIGUSR2 +#define SIGUSR2 17 +#undef SIGCHLD +#define SIGCHLD 18 +#undef SIGWINCH +#define SIGWINCH 20 +#undef SIGURG +#define SIGURG 21 +#undef SIGPOLL +#define SIGPOLL 22 +#undef SIGSTOP +#define SIGSTOP 23 +#undef SIGTSTP +#define SIGTSTP 24 +#undef SIGCONT +#define SIGCONT 25 +#undef SIGTTIN +#define SIGTTIN 26 +#undef SIGTTOU +#define SIGTTOU 27 +#undef SIGVTALRM +#define SIGVTALRM 28 +#undef SIGPROF +#define SIGPROF 29 +#undef SIGXCPU +#define SIGXCPU 30 +#undef SIGXFSZ +#define SIGXFSZ 31 + +#undef __SIGRTMAX +#define __SIGRTMAX 127 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h new file mode 100644 index 0000000000..695d3a395d --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h @@ -0,0 +1,102 @@ +/* Inline floating-point environment handling functions for powerpc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ + +/* Inline definitions for fegetround. */ +# define __fegetround_ISA300() \ + (__extension__ ({ \ + union { double __d; unsigned long long __ll; } __u; \ + __asm__ __volatile__ ( \ + ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ + : "=f" (__u.__d)); \ + __u.__ll & 0x0000000000000003LL; \ + })) + +# define __fegetround_ISA2() \ + (__extension__ ({ \ + int __fegetround_result; \ + __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ + : "=r"(__fegetround_result) : : "cr7"); \ + __fegetround_result & 3; \ + })) + +# ifdef _ARCH_PWR9 +# define __fegetround() __fegetround_ISA300() +# elif defined __BUILTIN_CPU_SUPPORTS__ +# define __fegetround() \ + (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ + ? __fegetround_ISA300() \ + : __fegetround_ISA2() \ + ) +# else +# define __fegetround() __fegetround_ISA2() +# endif + +# define fegetround() __fegetround () + +# ifndef __NO_MATH_INLINES +/* The weird 'i#*X' constraints on the following suppress a gcc + warning when __excepts is not a constant. Otherwise, they mean the + same as just plain 'i'. */ + +# if __GNUC_PREREQ(3, 4) + +/* Inline definition for feraiseexcept. */ +# define feraiseexcept(__excepts) \ + (__extension__ ({ \ + int __e = __excepts; \ + int __ret; \ + if (__builtin_constant_p (__e) \ + && (__e & (__e - 1)) == 0 \ + && __e != FE_INVALID) \ + { \ + if (__e != 0) \ + __asm__ __volatile__ ("mtfsb1 %0" \ + : : "i#*X" (__builtin_clz (__e))); \ + __ret = 0; \ + } \ + else \ + __ret = feraiseexcept (__e); \ + __ret; \ + })) + +/* Inline definition for feclearexcept. */ +# define feclearexcept(__excepts) \ + (__extension__ ({ \ + int __e = __excepts; \ + int __ret; \ + if (__builtin_constant_p (__e) \ + && (__e & (__e - 1)) == 0 \ + && __e != FE_INVALID) \ + { \ + if (__e != 0) \ + __asm__ __volatile__ ("mtfsb0 %0" \ + : : "i#*X" (__builtin_clz (__e))); \ + __ret = 0; \ + } \ + else \ + __ret = feclearexcept (__e); \ + __ret; \ + })) + +# endif /* __GNUC_PREREQ(3, 4). */ + +# endif /* !__NO_MATH_INLINES. */ + +#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h index 5719e16ac2..335efbd0aa 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h @@ -73,6 +73,4 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ -#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ -#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file + state. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h index c94a446c49..8818d6fa08 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __NO_LONG_DOUBLE_MATH # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h index b37f1929bd..391f7d62fe 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..c72a8507da --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct msqid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#define __MSQ_PAD_AFTER_TIME 0 +#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..e6aca78279 --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct semid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h index 97292723c8..d8dd45053b 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h @@ -1,6 +1,7 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Machine-specific POSIX semaphore type layouts. PowerPC version. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..950fc7d5b5 --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h @@ -0,0 +1,28 @@ +/* Define where padding goes in struct shmid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) +#define __SHM_SEGSZ_AFTER_TIME 1 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h index f4db4285af..762a5673fb 100644 --- a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h +++ b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h @@ -19,6 +19,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc-linux-gnu/ieee754.h b/lib/libc/include/powerpc-linux-gnu/ieee754.h index 9f9206f008..dcdca2eb78 100644 --- a/lib/libc/include/powerpc-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc-linux-gnu/ieee754.h @@ -21,7 +21,6 @@ #include #include -#include __BEGIN_DECLS @@ -112,65 +111,6 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -/* long double is IEEE 128 bit */ -union ieee854_long_double - { - long double d; - - /* This is the IEEE 854 quad-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:16; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:16; - unsigned int exponent:15; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int quiet_nan:1; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:15; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#else - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:15; - unsigned int quiet_nan:1; - unsigned int exponent:15; - unsigned int negative:1; -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ -#endif - - -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -181,16 +121,12 @@ union ieee854_long_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ + union ibm_extended_long_double { -# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) - __ibm128 ld; -# else - long double ld; -# endif + long double ld; union ieee754_double d[2]; }; -#endif __END_DECLS diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h new file mode 100644 index 0000000000..695d3a395d --- /dev/null +++ b/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h @@ -0,0 +1,102 @@ +/* Inline floating-point environment handling functions for powerpc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ + +/* Inline definitions for fegetround. */ +# define __fegetround_ISA300() \ + (__extension__ ({ \ + union { double __d; unsigned long long __ll; } __u; \ + __asm__ __volatile__ ( \ + ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ + : "=f" (__u.__d)); \ + __u.__ll & 0x0000000000000003LL; \ + })) + +# define __fegetround_ISA2() \ + (__extension__ ({ \ + int __fegetround_result; \ + __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ + : "=r"(__fegetround_result) : : "cr7"); \ + __fegetround_result & 3; \ + })) + +# ifdef _ARCH_PWR9 +# define __fegetround() __fegetround_ISA300() +# elif defined __BUILTIN_CPU_SUPPORTS__ +# define __fegetround() \ + (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ + ? __fegetround_ISA300() \ + : __fegetround_ISA2() \ + ) +# else +# define __fegetround() __fegetround_ISA2() +# endif + +# define fegetround() __fegetround () + +# ifndef __NO_MATH_INLINES +/* The weird 'i#*X' constraints on the following suppress a gcc + warning when __excepts is not a constant. Otherwise, they mean the + same as just plain 'i'. */ + +# if __GNUC_PREREQ(3, 4) + +/* Inline definition for feraiseexcept. */ +# define feraiseexcept(__excepts) \ + (__extension__ ({ \ + int __e = __excepts; \ + int __ret; \ + if (__builtin_constant_p (__e) \ + && (__e & (__e - 1)) == 0 \ + && __e != FE_INVALID) \ + { \ + if (__e != 0) \ + __asm__ __volatile__ ("mtfsb1 %0" \ + : : "i#*X" (__builtin_clz (__e))); \ + __ret = 0; \ + } \ + else \ + __ret = feraiseexcept (__e); \ + __ret; \ + })) + +/* Inline definition for feclearexcept. */ +# define feclearexcept(__excepts) \ + (__extension__ ({ \ + int __e = __excepts; \ + int __ret; \ + if (__builtin_constant_p (__e) \ + && (__e & (__e - 1)) == 0 \ + && __e != FE_INVALID) \ + { \ + if (__e != 0) \ + __asm__ __volatile__ ("mtfsb0 %0" \ + : : "i#*X" (__builtin_clz (__e))); \ + __ret = 0; \ + } \ + else \ + __ret = feclearexcept (__e); \ + __ret; \ + })) + +# endif /* __GNUC_PREREQ(3, 4). */ + +# endif /* !__NO_MATH_INLINES. */ + +#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h index 5719e16ac2..335efbd0aa 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h @@ -73,6 +73,4 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ -#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ -#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file + state. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h index c94a446c49..8818d6fa08 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __NO_LONG_DOUBLE_MATH # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h index b37f1929bd..391f7d62fe 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..c72a8507da --- /dev/null +++ b/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct msqid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#define __MSQ_PAD_AFTER_TIME 0 +#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..e6aca78279 --- /dev/null +++ b/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct semid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h index 97292723c8..d8dd45053b 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h @@ -1,6 +1,7 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Machine-specific POSIX semaphore type layouts. PowerPC version. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..950fc7d5b5 --- /dev/null +++ b/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h @@ -0,0 +1,28 @@ +/* Define where padding goes in struct shmid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) +#define __SHM_SEGSZ_AFTER_TIME 1 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h b/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h index 22c0732548..143f904e09 100644 --- a/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h +++ b/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h b/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h index 636dc73283..12c0d956e8 100644 --- a/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h +++ b/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h @@ -10,7 +10,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/ieee754.h b/lib/libc/include/powerpc64-linux-gnu/ieee754.h index 9f9206f008..dcdca2eb78 100644 --- a/lib/libc/include/powerpc64-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc64-linux-gnu/ieee754.h @@ -21,7 +21,6 @@ #include #include -#include __BEGIN_DECLS @@ -112,65 +111,6 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -/* long double is IEEE 128 bit */ -union ieee854_long_double - { - long double d; - - /* This is the IEEE 854 quad-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:16; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:16; - unsigned int exponent:15; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int quiet_nan:1; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:15; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#else - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:15; - unsigned int quiet_nan:1; - unsigned int exponent:15; - unsigned int negative:1; -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ -#endif - - -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -181,16 +121,12 @@ union ieee854_long_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ + union ibm_extended_long_double { -# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) - __ibm128 ld; -# else - long double ld; -# endif + long double ld; union ieee754_double d[2]; }; -#endif __END_DECLS diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h new file mode 100644 index 0000000000..695d3a395d --- /dev/null +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h @@ -0,0 +1,102 @@ +/* Inline floating-point environment handling functions for powerpc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ + +/* Inline definitions for fegetround. */ +# define __fegetround_ISA300() \ + (__extension__ ({ \ + union { double __d; unsigned long long __ll; } __u; \ + __asm__ __volatile__ ( \ + ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ + : "=f" (__u.__d)); \ + __u.__ll & 0x0000000000000003LL; \ + })) + +# define __fegetround_ISA2() \ + (__extension__ ({ \ + int __fegetround_result; \ + __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ + : "=r"(__fegetround_result) : : "cr7"); \ + __fegetround_result & 3; \ + })) + +# ifdef _ARCH_PWR9 +# define __fegetround() __fegetround_ISA300() +# elif defined __BUILTIN_CPU_SUPPORTS__ +# define __fegetround() \ + (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ + ? __fegetround_ISA300() \ + : __fegetround_ISA2() \ + ) +# else +# define __fegetround() __fegetround_ISA2() +# endif + +# define fegetround() __fegetround () + +# ifndef __NO_MATH_INLINES +/* The weird 'i#*X' constraints on the following suppress a gcc + warning when __excepts is not a constant. Otherwise, they mean the + same as just plain 'i'. */ + +# if __GNUC_PREREQ(3, 4) + +/* Inline definition for feraiseexcept. */ +# define feraiseexcept(__excepts) \ + (__extension__ ({ \ + int __e = __excepts; \ + int __ret; \ + if (__builtin_constant_p (__e) \ + && (__e & (__e - 1)) == 0 \ + && __e != FE_INVALID) \ + { \ + if (__e != 0) \ + __asm__ __volatile__ ("mtfsb1 %0" \ + : : "i#*X" (__builtin_clz (__e))); \ + __ret = 0; \ + } \ + else \ + __ret = feraiseexcept (__e); \ + __ret; \ + })) + +/* Inline definition for feclearexcept. */ +# define feclearexcept(__excepts) \ + (__extension__ ({ \ + int __e = __excepts; \ + int __ret; \ + if (__builtin_constant_p (__e) \ + && (__e & (__e - 1)) == 0 \ + && __e != FE_INVALID) \ + { \ + if (__e != 0) \ + __asm__ __volatile__ ("mtfsb0 %0" \ + : : "i#*X" (__builtin_clz (__e))); \ + __ret = 0; \ + } \ + else \ + __ret = feclearexcept (__e); \ + __ret; \ + })) + +# endif /* __GNUC_PREREQ(3, 4). */ + +# endif /* !__NO_MATH_INLINES. */ + +#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h index 5719e16ac2..335efbd0aa 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h @@ -73,6 +73,4 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ -#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ -#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file + state. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h index c94a446c49..8818d6fa08 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +#ifdef __NO_LONG_DOUBLE_MATH # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h index bfeb899917..391f7d62fe 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h @@ -1,5 +1,5 @@ /* Properties of long double type. ldbl-opt version. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,5 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif - -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI (__LDBL_MANT_DIG__ == 113) \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..c72a8507da --- /dev/null +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct msqid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#define __MSQ_PAD_AFTER_TIME 0 +#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..e6aca78279 --- /dev/null +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct semid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h index 97292723c8..d8dd45053b 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h @@ -1,6 +1,7 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Machine-specific POSIX semaphore type layouts. PowerPC version. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..950fc7d5b5 --- /dev/null +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h @@ -0,0 +1,28 @@ +/* Define where padding goes in struct shmid_ds. PowerPC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) +#define __SHM_SEGSZ_AFTER_TIME 1 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h b/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h index b8e68b6c89..c26da6b2cd 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h +++ b/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h b/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h index 636dc73283..12c0d956e8 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h +++ b/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h @@ -10,7 +10,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/ieee754.h b/lib/libc/include/powerpc64le-linux-gnu/ieee754.h index 9f9206f008..dcdca2eb78 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc64le-linux-gnu/ieee754.h @@ -21,7 +21,6 @@ #include #include -#include __BEGIN_DECLS @@ -112,65 +111,6 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -/* long double is IEEE 128 bit */ -union ieee854_long_double - { - long double d; - - /* This is the IEEE 854 quad-precision format. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:16; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#endif /* Big endian. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:16; - unsigned int exponent:15; - unsigned int negative:1; -#endif /* Little endian. */ - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int negative:1; - unsigned int exponent:15; - unsigned int quiet_nan:1; - /* Together these comprise the mantissa. */ - unsigned int mantissa0:15; - unsigned int mantissa1:32; - unsigned int mantissa2:32; - unsigned int mantissa3:32; -#else - /* Together these comprise the mantissa. */ - unsigned int mantissa3:32; - unsigned int mantissa2:32; - unsigned int mantissa1:32; - unsigned int mantissa0:15; - unsigned int quiet_nan:1; - unsigned int exponent:15; - unsigned int negative:1; -#endif - } ieee_nan; - }; - -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ -#endif - - -#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -181,16 +121,12 @@ union ieee854_long_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ + union ibm_extended_long_double { -# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) - __ibm128 ld; -# else - long double ld; -# endif + long double ld; union ieee754_double d[2]; }; -#endif __END_DECLS diff --git a/lib/libc/include/riscv64-linux-gnu/bits/long-double.h b/lib/libc/include/riscv64-linux-gnu/bits/long-double.h index f95b24f8e7..ce06962796 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h b/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h index 97292723c8..7277c658e8 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h @@ -1,5 +1,5 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Machine-specific POSIX semaphore type layouts. RISC-V version. + Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,20 +13,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see + License along with the GNU C Library. If not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#include - -#if __WORDSIZE == 64 -# define __SIZEOF_SEM_T 32 -#else -# define __SIZEOF_SEM_T 16 -#endif +#define __SIZEOF_SEM_T (4 * __SIZEOF_POINTER__) /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h index a5f4c78b94..d9e9b274ac 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h @@ -26,45 +26,31 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ -#if __TIMESIZE == 64 && __WORDSIZE == 32 -/* These are the "new" y2038 types defined for architectures added after - the 5.1 kernel. */ -# define __INO_T_TYPE __UQUAD_TYPE -# define __OFF_T_TYPE __SQUAD_TYPE -# define __RLIM_T_TYPE __UQUAD_TYPE -# define __BLKCNT_T_TYPE __SQUAD_TYPE -# define __FSBLKCNT_T_TYPE __UQUAD_TYPE -# define __FSFILCNT_T_TYPE __UQUAD_TYPE -# define __TIME_T_TYPE __SQUAD_TYPE -# define __SUSECONDS_T_TYPE __SQUAD_TYPE -#else -# define __INO_T_TYPE __ULONGWORD_TYPE -# define __OFF_T_TYPE __SLONGWORD_TYPE -# define __RLIM_T_TYPE __ULONGWORD_TYPE -# define __BLKCNT_T_TYPE __SLONGWORD_TYPE -# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -# define __TIME_T_TYPE __SLONGWORD_TYPE -# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -76,7 +62,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#ifdef __LP64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -90,17 +76,11 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif - /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h index c157deb8cf..7e92db0ded 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h index 6ce02418e6..6ac6614fb7 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h @@ -32,7 +32,10 @@ #define __stub_fetestexcept #define __stub_feupdateenv #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_stty \ No newline at end of file +#define __stub_sstk +#define __stub_stty +#define __stub_sysctl \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/fenv.h b/lib/libc/include/s390x-linux-gnu/bits/fenv.h index 5bf167975e..281e760819 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/fenv.h +++ b/lib/libc/include/s390x-linux-gnu/bits/fenv.h @@ -73,14 +73,14 @@ typedef unsigned int fexcept_t; /* size of fpc */ /* Type representing floating-point environment. This function corresponds - to the layout of the block used by fegetenv and fesetenv. */ + to the layout of the block written by the `fstenv'. */ typedef struct { fexcept_t __fpc; void *__unused; /* The field __unused (formerly __ieee_instruction_pointer) is a relict from commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59) - and isn't used anymore. */ + and isn´t used anymore. */ } fenv_t; /* If the default argument is used we use this value. */ diff --git a/lib/libc/include/s390x-linux-gnu/bits/long-double.h b/lib/libc/include/s390x-linux-gnu/bits/long-double.h index b37f1929bd..391f7d62fe 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/long-double.h +++ b/lib/libc/include/s390x-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/semaphore.h b/lib/libc/include/s390x-linux-gnu/bits/semaphore.h index 97292723c8..d99eca3d90 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/s390x-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Martin Schwidefsky , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h index fecd80e33a..d31219c155 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h @@ -50,7 +50,6 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -82,16 +81,10 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h index 1f26b2ab53..268b163638 100644 --- a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/sparc-linux-gnu/bits/fenv.h b/lib/libc/include/sparc-linux-gnu/bits/fenv.h index 7eba346aa7..408a29f7b6 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparc-linux-gnu/bits/fenv.h @@ -83,6 +83,15 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif +/* For internal use only: access the fp state register. */ +#if __WORDSIZE == 64 +# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X)) +# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X)) +#else +# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X)) +# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X)) +#endif + #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparc-linux-gnu/bits/long-double.h b/lib/libc/include/sparc-linux-gnu/bits/long-double.h index de5e60beb8..e32f6ad721 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/sparc-linux-gnu/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h b/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..6e05183c93 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct msqid_ds. SPARC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#define __MSQ_PAD_AFTER_TIME 0 +#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/resource.h b/lib/libc/include/sparc-linux-gnu/bits/resource.h index 3cfbfd381c..34605679a3 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/resource.h +++ b/lib/libc/include/sparc-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h b/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..75a0a010c9 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct semid_ds. SPARC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/semaphore.h b/lib/libc/include/sparc-linux-gnu/bits/semaphore.h index 97292723c8..ee2f8e0ca5 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/sparc-linux-gnu/bits/semaphore.h @@ -1,6 +1,7 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Machine-specific POSIX semaphore type layouts. SPARC version. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h b/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..6f9480247f --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h @@ -0,0 +1,28 @@ +/* Define where padding goes in struct shmid_ds. SPARC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) +#define __SHM_SEGSZ_AFTER_TIME 1 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/signum.h b/lib/libc/include/sparc-linux-gnu/bits/signum.h new file mode 100644 index 0000000000..2890ba7808 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/signum.h @@ -0,0 +1,39 @@ +/* Signal number definitions. Linux/SPARC version. + Copyright (C) 1996-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/SPARC systems. Signal values on this platform were chosen + for SunOS binary compatibility. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */ +#define SIGPWR SIGLOST /* Power failure imminent (SysV). */ + +#undef __SIGRTMAX +#define __SIGRTMAX 64 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/typesizes.h b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h index ebff4bdbcc..123acf7d25 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h @@ -50,7 +50,6 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -76,16 +75,10 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h index 0f86fee604..08e73abcba 100644 --- a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h b/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h index 7eba346aa7..408a29f7b6 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h @@ -83,6 +83,15 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif +/* For internal use only: access the fp state register. */ +#if __WORDSIZE == 64 +# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X)) +# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X)) +#else +# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X)) +# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X)) +#endif + #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h b/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h index de5e60beb8..e32f6ad721 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h new file mode 100644 index 0000000000..6e05183c93 --- /dev/null +++ b/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct msqid_ds. SPARC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MSG_H +# error "Never use directly; include instead." +#endif + +#include + +#define __MSQ_PAD_AFTER_TIME 0 +#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/resource.h b/lib/libc/include/sparcv9-linux-gnu/bits/resource.h index 3cfbfd381c..34605679a3 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/resource.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in microseconds that a process scheduled under a real-time + /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..75a0a010c9 --- /dev/null +++ b/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h @@ -0,0 +1,26 @@ +/* Define where padding goes in struct semid_ds. SPARC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SEM_PAD_AFTER_TIME 0 +#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h b/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h index 97292723c8..ee2f8e0ca5 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h @@ -1,6 +1,7 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Machine-specific POSIX semaphore type layouts. SPARC version. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h new file mode 100644 index 0000000000..6f9480247f --- /dev/null +++ b/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h @@ -0,0 +1,28 @@ +/* Define where padding goes in struct shmid_ds. SPARC version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never use directly; include instead." +#endif + +#include + +#define __SHM_PAD_AFTER_TIME 0 +#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) +#define __SHM_SEGSZ_AFTER_TIME 1 +#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/signum.h b/lib/libc/include/sparcv9-linux-gnu/bits/signum.h new file mode 100644 index 0000000000..2890ba7808 --- /dev/null +++ b/lib/libc/include/sparcv9-linux-gnu/bits/signum.h @@ -0,0 +1,39 @@ +/* Signal number definitions. Linux/SPARC version. + Copyright (C) 1996-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +#include + +/* Adjustments and additions to the signal number constants for + Linux/SPARC systems. Signal values on this platform were chosen + for SunOS binary compatibility. */ + +#define SIGEMT 7 /* Emulator trap. */ +#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */ +#define SIGPWR SIGLOST /* Power failure imminent (SysV). */ + +#undef __SIGRTMAX +#define __SIGRTMAX 64 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h b/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h index ebff4bdbcc..123acf7d25 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h @@ -50,7 +50,6 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -76,16 +75,10 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h index b504e27b15..3164b63556 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h @@ -113,4 +113,58 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) +#endif + + +#ifdef __USE_EXTERN_INLINES +__BEGIN_DECLS + +/* Optimized versions. */ +#ifndef _LIBC +extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); +#endif +__extern_always_inline void +__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) +{ + if ((FE_INVALID & __excepts) != 0) + { + /* One example of an invalid operation is 0.0 / 0.0. */ + float __f = 0.0; + +# ifdef __SSE_MATH__ + __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); +# else + __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" + : "=t" (__f) : "0" (__f)); +# endif + (void) &__f; + } + if ((FE_DIVBYZERO & __excepts) != 0) + { + float __f = 1.0; + float __g = 0.0; + +# ifdef __SSE_MATH__ + __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); +# else + __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" + : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); +# endif + (void) &__f; + } +} +__extern_inline int +__NTH (feraiseexcept (int __excepts)) +{ + if (__builtin_constant_p (__excepts) + && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) + { + __feraiseexcept_invalid_divbyzero (__excepts); + return 0; + } + + return __feraiseexcept_renamed (__excepts); +} + +__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/long-double.h b/lib/libc/include/x86_64-linux-gnu/bits/long-double.h index 75bc1fcce4..a7bd8fb163 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/select.h b/lib/libc/include/x86_64-linux-gnu/bits/select.h index d71b5e4ce2..959d998266 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/select.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/select.h @@ -19,19 +19,45 @@ # error "Never use directly; include instead." #endif +#include + + +#if defined __GNUC__ && __GNUC__ >= 2 + +# if __WORDSIZE == 64 +# define __FD_ZERO_STOS "stosq" +# else +# define __FD_ZERO_STOS "stosl" +# endif + +# define __FD_ZERO(fdsp) \ + do { \ + int __d0, __d1; \ + __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ + : "=c" (__d0), "=D" (__d1) \ + : "a" (0), "0" (sizeof (fd_set) \ + / sizeof (__fd_mask)), \ + "1" (&__FDS_BITS (fdsp)[0]) \ + : "memory"); \ + } while (0) + +#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -#define __FD_ZERO(s) \ +# define __FD_ZERO(set) \ do { \ unsigned int __i; \ - fd_set *__arr = (s); \ + fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) -#define __FD_SET(d, s) \ - ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) -#define __FD_CLR(d, s) \ - ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) -#define __FD_ISSET(d, s) \ - ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file + +#endif /* GNU CC */ + +#define __FD_SET(d, set) \ + ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) +#define __FD_CLR(d, set) \ + ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) +#define __FD_ISSET(d, set) \ + ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h b/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h new file mode 100644 index 0000000000..10534c61cf --- /dev/null +++ b/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. x86 version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 1 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h b/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h index 97292723c8..7f41d9a880 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,7 @@ # define __SIZEOF_SEM_T 16 #endif + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h b/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h new file mode 100644 index 0000000000..5e2b946cdf --- /dev/null +++ b/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2012-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if defined __x86_64__ && defined __ILP32__ +# error "sysctl system call is unsupported in x32 kernel" +#endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h b/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h index 53ae0bd5ef..7ad60c3f43 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h @@ -64,7 +64,6 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -88,15 +87,10 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h index 03d0df5edf..3d707eaca3 100644 --- a/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h b/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h index d4b87af1a5..5ce8c64bba 100644 --- a/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h +++ b/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h @@ -11,7 +11,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h index b504e27b15..3164b63556 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h @@ -113,4 +113,58 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) +#endif + + +#ifdef __USE_EXTERN_INLINES +__BEGIN_DECLS + +/* Optimized versions. */ +#ifndef _LIBC +extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); +#endif +__extern_always_inline void +__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) +{ + if ((FE_INVALID & __excepts) != 0) + { + /* One example of an invalid operation is 0.0 / 0.0. */ + float __f = 0.0; + +# ifdef __SSE_MATH__ + __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); +# else + __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" + : "=t" (__f) : "0" (__f)); +# endif + (void) &__f; + } + if ((FE_DIVBYZERO & __excepts) != 0) + { + float __f = 1.0; + float __g = 0.0; + +# ifdef __SSE_MATH__ + __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); +# else + __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" + : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); +# endif + (void) &__f; + } +} +__extern_inline int +__NTH (feraiseexcept (int __excepts)) +{ + if (__builtin_constant_p (__excepts) + && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) + { + __feraiseexcept_invalid_divbyzero (__excepts); + return 0; + } + + return __feraiseexcept_renamed (__excepts); +} + +__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h b/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h index 75bc1fcce4..a7bd8fb163 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file +#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/select.h b/lib/libc/include/x86_64-linux-gnux32/bits/select.h index d71b5e4ce2..959d998266 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/select.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/select.h @@ -19,19 +19,45 @@ # error "Never use directly; include instead." #endif +#include + + +#if defined __GNUC__ && __GNUC__ >= 2 + +# if __WORDSIZE == 64 +# define __FD_ZERO_STOS "stosq" +# else +# define __FD_ZERO_STOS "stosl" +# endif + +# define __FD_ZERO(fdsp) \ + do { \ + int __d0, __d1; \ + __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ + : "=c" (__d0), "=D" (__d1) \ + : "a" (0), "0" (sizeof (fd_set) \ + / sizeof (__fd_mask)), \ + "1" (&__FDS_BITS (fdsp)[0]) \ + : "memory"); \ + } while (0) + +#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -#define __FD_ZERO(s) \ +# define __FD_ZERO(set) \ do { \ unsigned int __i; \ - fd_set *__arr = (s); \ + fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) -#define __FD_SET(d, s) \ - ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) -#define __FD_CLR(d, s) \ - ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) -#define __FD_ISSET(d, s) \ - ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file + +#endif /* GNU CC */ + +#define __FD_SET(d, set) \ + ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) +#define __FD_CLR(d, set) \ + ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) +#define __FD_ISSET(d, set) \ + ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h b/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h new file mode 100644 index 0000000000..10534c61cf --- /dev/null +++ b/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h @@ -0,0 +1,24 @@ +/* Define where padding goes in struct semid_ds. x86 version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SEM_H +# error "Never use directly; include instead." +#endif + +#define __SEM_PAD_AFTER_TIME 1 +#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h b/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h index 97292723c8..7f41d9a880 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Generic POSIX semaphore type layout - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,7 @@ # define __SIZEOF_SEM_T 16 #endif + /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h b/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h new file mode 100644 index 0000000000..5e2b946cdf --- /dev/null +++ b/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2012-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if defined __x86_64__ && defined __ILP32__ +# error "sysctl system call is unsupported in x32 kernel" +#endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h b/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h index 53ae0bd5ef..7ad60c3f43 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h @@ -64,7 +64,6 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -88,15 +87,10 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h b/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h index cdc4ac90f9..e9ea9cb4be 100644 --- a/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h +++ b/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h @@ -20,6 +20,8 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" +#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h b/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h index b3af77d56c..9f943854b0 100644 --- a/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h +++ b/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h @@ -16,7 +16,9 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty +#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn +#define __stub_sstk #define __stub_stty \ No newline at end of file From d62c12e077e4e3993864317bf8af5f0fcc631515 Mon Sep 17 00:00:00 2001 From: Vexu Date: Sat, 22 Aug 2020 15:48:41 +0300 Subject: [PATCH 46/55] stage2: astgen prefix ops --- src-self-hosted/astgen.zig | 30 ++++++++++++++++++++++++++---- src-self-hosted/zir.zig | 2 ++ src-self-hosted/zir_sema.zig | 1 + 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src-self-hosted/astgen.zig b/src-self-hosted/astgen.zig index 8276b191cb..210ba0008e 100644 --- a/src-self-hosted/astgen.zig +++ b/src-self-hosted/astgen.zig @@ -232,6 +232,11 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .BoolAnd => return boolBinOp(mod, scope, rl, node.castTag(.BoolAnd).?), .BoolOr => return boolBinOp(mod, scope, rl, node.castTag(.BoolOr).?), + .BoolNot => return rlWrap(mod, scope, rl, try boolNot(mod, scope, node.castTag(.BoolNot).?)), + .BitNot => return rlWrap(mod, scope, rl, try bitNot(mod, scope, node.castTag(.BitNot).?)), + .Negation => return rlWrap(mod, scope, rl, try negation(mod, scope, node.castTag(.Negation).?, .sub)), + .NegationWrap => return rlWrap(mod, scope, rl, try negation(mod, scope, node.castTag(.NegationWrap).?, .subwrap)), + .Identifier => return try identifier(mod, scope, rl, node.castTag(.Identifier).?), .Asm => return rlWrap(mod, scope, rl, try assembly(mod, scope, node.castTag(.Asm).?)), .StringLiteral => return rlWrap(mod, scope, rl, try stringLiteral(mod, scope, node.castTag(.StringLiteral).?)), @@ -244,7 +249,6 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .While => return whileExpr(mod, scope, rl, node.castTag(.While).?), .Period => return rlWrap(mod, scope, rl, try field(mod, scope, node.castTag(.Period).?)), .Deref => return rlWrap(mod, scope, rl, try deref(mod, scope, node.castTag(.Deref).?)), - .BoolNot => return rlWrap(mod, scope, rl, try boolNot(mod, scope, node.castTag(.BoolNot).?)), .AddressOf => return rlWrap(mod, scope, rl, try addressOf(mod, scope, node.castTag(.AddressOf).?)), .FloatLiteral => return rlWrap(mod, scope, rl, try floatLiteral(mod, scope, node.castTag(.FloatLiteral).?)), .UndefinedLiteral => return rlWrap(mod, scope, rl, try undefLiteral(mod, scope, node.castTag(.UndefinedLiteral).?)), @@ -271,9 +275,6 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .Range => return mod.failNode(scope, node, "TODO implement astgen.expr for .Range", .{}), .OrElse => return mod.failNode(scope, node, "TODO implement astgen.expr for .OrElse", .{}), .Await => return mod.failNode(scope, node, "TODO implement astgen.expr for .Await", .{}), - .BitNot => return mod.failNode(scope, node, "TODO implement astgen.expr for .BitNot", .{}), - .Negation => return mod.failNode(scope, node, "TODO implement astgen.expr for .Negation", .{}), - .NegationWrap => return mod.failNode(scope, node, "TODO implement astgen.expr for .NegationWrap", .{}), .Resume => return mod.failNode(scope, node, "TODO implement astgen.expr for .Resume", .{}), .Try => return mod.failNode(scope, node, "TODO implement astgen.expr for .Try", .{}), .Slice => return mod.failNode(scope, node, "TODO implement astgen.expr for .Slice", .{}), @@ -554,6 +555,27 @@ fn boolNot(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp) InnerErr return addZIRUnOp(mod, scope, src, .boolnot, operand); } +fn bitNot(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp) InnerError!*zir.Inst { + const tree = scope.tree(); + const src = tree.token_locs[node.op_token].start; + const operand = try expr(mod, scope, .none, node.rhs); + return addZIRUnOp(mod, scope, src, .bitnot, operand); +} + +fn negation(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp, op_inst_tag: zir.Inst.Tag) InnerError!*zir.Inst { + const tree = scope.tree(); + const src = tree.token_locs[node.op_token].start; + + const lhs = addZIRInstConst(mod, scope, src, .{ + .ty = Type.initTag(.comptime_int), + .val = Value.initTag(.zero), + }); + const rhs = try expr(mod, scope, .none, node.rhs); + + const result = try addZIRBinOp(mod, scope, src, op_inst_tag, lhs, rhs); + return rlWrap(mod, scope, rl, result); +} + fn addressOf(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp) InnerError!*zir.Inst { return expr(mod, scope, .ref, node.rhs); } diff --git a/src-self-hosted/zir.zig b/src-self-hosted/zir.zig index a3ea1f11ab..a5d91aa690 100644 --- a/src-self-hosted/zir.zig +++ b/src-self-hosted/zir.zig @@ -70,6 +70,8 @@ pub const Inst = struct { /// A typed result location pointer is bitcasted to a new result location pointer. /// The new result location pointer has an inferred type. bitcast_result_ptr, + /// Bitwise NOT. `~` + bitnot, /// Bitwise OR. `|` bitor, /// A labeled block of code, which can return a value. diff --git a/src-self-hosted/zir_sema.zig b/src-self-hosted/zir_sema.zig index 75ec7f6306..6ac29e02c9 100644 --- a/src-self-hosted/zir_sema.zig +++ b/src-self-hosted/zir_sema.zig @@ -97,6 +97,7 @@ pub fn analyzeInst(mod: *Module, scope: *Scope, old_inst: *zir.Inst) InnerError! .array_cat => return analyzeInstArrayCat(mod, scope, old_inst.castTag(.array_cat).?), .array_mul => return analyzeInstArrayMul(mod, scope, old_inst.castTag(.array_mul).?), .bitand => return analyzeInstBitwise(mod, scope, old_inst.castTag(.bitand).?), + .bitnot => return analyzeInstBitwise(mod, scope, old_inst.castTag(.bitnot).?), .bitor => return analyzeInstBitwise(mod, scope, old_inst.castTag(.bitor).?), .xor => return analyzeInstBitwise(mod, scope, old_inst.castTag(.xor).?), .shl => return analyzeInstShl(mod, scope, old_inst.castTag(.shl).?), From 16d7db59ed9b0b1be6790bdb80777fbe5f80c7ed Mon Sep 17 00:00:00 2001 From: Vexu Date: Sat, 22 Aug 2020 16:30:57 +0300 Subject: [PATCH 47/55] stage2: anyframe and error union types --- src-self-hosted/Module.zig | 22 +++++ src-self-hosted/astgen.zig | 41 ++++++-- src-self-hosted/type.zig | 179 +++++++++++++++++++++++++++++++++-- src-self-hosted/value.zig | 14 +++ src-self-hosted/zir.zig | 14 +++ src-self-hosted/zir_sema.zig | 30 +++++- 6 files changed, 287 insertions(+), 13 deletions(-) diff --git a/src-self-hosted/Module.zig b/src-self-hosted/Module.zig index c0d1d0d654..f97254f29a 100644 --- a/src-self-hosted/Module.zig +++ b/src-self-hosted/Module.zig @@ -3309,6 +3309,28 @@ pub fn arrayType(self: *Module, scope: *Scope, len: u64, sentinel: ?Value, elem_ return Type.initPayload(&payload.base); } +pub fn errorUnionType(self: *Module, scope: *Scope, error_set: Type, payload: Type) Allocator.Error!Type { + assert(error_set.zigTypeTag() == .ErrorSet); + if (error_set.eql(Type.initTag(.anyerror)) and payload.eql(Type.initTag(.void))) { + return Type.initTag(.anyerror_void_error_union); + } + + const result = try scope.arena().create(Type.Payload.ErrorUnion); + result.* = .{ + .error_set = error_set, + .payload = payload, + }; + return Type.initPayload(&result.base); +} + +pub fn anyframeType(self: *Module, scope: *Scope, return_type: Type) Allocator.Error!Type { + const result = try scope.arena().create(Type.Payload.AnyFrame); + result.* = .{ + .return_type = return_type, + }; + return Type.initPayload(&result.base); +} + pub fn dumpInst(self: *Module, scope: *Scope, inst: *Inst) void { const zir_module = scope.namespace(); const source = zir_module.getSource(self) catch @panic("dumpInst failed to get source"); diff --git a/src-self-hosted/astgen.zig b/src-self-hosted/astgen.zig index 210ba0008e..32041fbc2b 100644 --- a/src-self-hosted/astgen.zig +++ b/src-self-hosted/astgen.zig @@ -267,11 +267,12 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .MultilineStringLiteral => return rlWrap(mod, scope, rl, try multilineStrLiteral(mod, scope, node.castTag(.MultilineStringLiteral).?)), .CharLiteral => return rlWrap(mod, scope, rl, try charLiteral(mod, scope, node.castTag(.CharLiteral).?)), .SliceType => return rlWrap(mod, scope, rl, try sliceType(mod, scope, node.castTag(.SliceType).?)), + .ErrorUnion => return rlWrap(mod, scope, rl, try typeInixOp(mod, scope, node.castTag(.ErrorUnion).?, .error_union_type)), + .MergeErrorSets => return rlWrap(mod, scope, rl, try typeInixOp(mod, scope, node.castTag(.MergeErrorSets).?, .merge_error_sets)), + .AnyFrameType => return rlWrap(mod, scope, rl, try anyFrameType(mod, scope, node.castTag(.AnyFrameType).?)), .Defer => return mod.failNode(scope, node, "TODO implement astgen.expr for .Defer", .{}), .Catch => return mod.failNode(scope, node, "TODO implement astgen.expr for .Catch", .{}), - .ErrorUnion => return mod.failNode(scope, node, "TODO implement astgen.expr for .ErrorUnion", .{}), - .MergeErrorSets => return mod.failNode(scope, node, "TODO implement astgen.expr for .MergeErrorSets", .{}), .Range => return mod.failNode(scope, node, "TODO implement astgen.expr for .Range", .{}), .OrElse => return mod.failNode(scope, node, "TODO implement astgen.expr for .OrElse", .{}), .Await => return mod.failNode(scope, node, "TODO implement astgen.expr for .Await", .{}), @@ -290,7 +291,6 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .AnyType => return mod.failNode(scope, node, "TODO implement astgen.expr for .AnyType", .{}), .ErrorType => return mod.failNode(scope, node, "TODO implement astgen.expr for .ErrorType", .{}), .FnProto => return mod.failNode(scope, node, "TODO implement astgen.expr for .FnProto", .{}), - .AnyFrameType => return mod.failNode(scope, node, "TODO implement astgen.expr for .AnyFrameType", .{}), .ErrorSetDecl => return mod.failNode(scope, node, "TODO implement astgen.expr for .ErrorSetDecl", .{}), .ContainerDecl => return mod.failNode(scope, node, "TODO implement astgen.expr for .ContainerDecl", .{}), .Comptime => return mod.failNode(scope, node, "TODO implement astgen.expr for .Comptime", .{}), @@ -566,14 +566,13 @@ fn negation(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp, op_inst const tree = scope.tree(); const src = tree.token_locs[node.op_token].start; - const lhs = addZIRInstConst(mod, scope, src, .{ + const lhs = try addZIRInstConst(mod, scope, src, .{ .ty = Type.initTag(.comptime_int), .val = Value.initTag(.zero), }); const rhs = try expr(mod, scope, .none, node.rhs); - const result = try addZIRBinOp(mod, scope, src, op_inst_tag, lhs, rhs); - return rlWrap(mod, scope, rl, result); + return addZIRBinOp(mod, scope, src, op_inst_tag, lhs, rhs); } fn addressOf(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp) InnerError!*zir.Inst { @@ -703,6 +702,36 @@ fn arrayTypeSentinel(mod: *Module, scope: *Scope, node: *ast.Node.ArrayTypeSenti }, .{}); } +fn anyFrameType(mod: *Module, scope: *Scope, node: *ast.Node.AnyFrameType) InnerError!*zir.Inst { + const tree = scope.tree(); + const src = tree.token_locs[node.anyframe_token].start; + if (node.result) |some| { + const meta_type = try addZIRInstConst(mod, scope, src, .{ + .ty = Type.initTag(.type), + .val = Value.initTag(.type_type), + }); + const return_type = try expr(mod, scope, .{ .ty = meta_type}, some.return_type); + return addZIRUnOp(mod, scope, src, .anyframe_type, return_type); + } else { + return addZIRInstConst(mod, scope, src, .{ + .ty = Type.initTag(.type), + .val = Value.initTag(.anyframe_type), + }); + } +} + +fn typeInixOp(mod: *Module, scope: *Scope, node: *ast.Node.SimpleInfixOp, op_inst_tag: zir.Inst.Tag) InnerError!*zir.Inst { + const tree = scope.tree(); + const src = tree.token_locs[node.op_token].start; + const meta_type = try addZIRInstConst(mod, scope, src, .{ + .ty = Type.initTag(.type), + .val = Value.initTag(.type_type), + }); + const error_set = try expr(mod, scope, .{ .ty = meta_type }, node.lhs); + const payload = try expr(mod, scope, .{ .ty = meta_type }, node.rhs); + return addZIRBinOp(mod, scope, src, op_inst_tag, error_set, payload); +} + fn enumLiteral(mod: *Module, scope: *Scope, node: *ast.Node.EnumLiteral) !*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.name].start; diff --git a/src-self-hosted/type.zig b/src-self-hosted/type.zig index 37b13c1d15..37f9f0c638 100644 --- a/src-self-hosted/type.zig +++ b/src-self-hosted/type.zig @@ -84,6 +84,10 @@ pub const Type = extern union { .optional_single_mut_pointer, => return .Optional, .enum_literal => return .EnumLiteral, + + .anyerror_void_error_union, .error_union => return .ErrorUnion, + + .anyframe_T, .@"anyframe" => return .AnyFrame, } } @@ -151,6 +155,9 @@ pub const Type = extern union { .ComptimeInt => return true, .Undefined => return true, .Null => return true, + .AnyFrame => { + return a.elemType().eql(b.elemType()); + }, .Pointer => { // Hot path for common case: if (a.castPointer()) |a_payload| { @@ -225,7 +232,6 @@ pub const Type = extern union { .BoundFn, .Opaque, .Frame, - .AnyFrame, .Vector, => std.debug.panic("TODO implement Type equality comparison of {} and {}", .{ a, b }), } @@ -343,6 +349,8 @@ pub const Type = extern union { .single_const_pointer_to_comptime_int, .const_slice_u8, .enum_literal, + .anyerror_void_error_union, + .@"anyframe", => unreachable, .array_u8_sentinel_0 => return self.copyPayloadShallow(allocator, Payload.Array_u8_Sentinel0), @@ -397,6 +405,7 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, => return self.copyPayloadSingleField(allocator, Payload.PointerSimple, "pointee_type"), + .anyframe_T => return self.copyPayloadSingleField(allocator, Payload.AnyFrame, "return_type"), .pointer => { const payload = @fieldParentPtr(Payload.Pointer, "base", self.ptr_otherwise); @@ -416,6 +425,17 @@ pub const Type = extern union { }; return Type{ .ptr_otherwise = &new_payload.base }; }, + .error_union => { + const payload = @fieldParentPtr(Payload.ErrorUnion, "base", self.ptr_otherwise); + const new_payload = try allocator.create(Payload.ErrorUnion); + new_payload.* = .{ + .base = payload.base, + + .error_set = try payload.error_set.copy(allocator), + .payload = try payload.payload.copy(allocator), + }; + return Type{ .ptr_otherwise = &new_payload.base }; + }, } } @@ -482,6 +502,8 @@ pub const Type = extern union { .@"null" => return out_stream.writeAll("@TypeOf(null)"), .@"undefined" => return out_stream.writeAll("@TypeOf(undefined)"), + .@"anyframe" => return out_stream.writeAll("anyframe"), + .anyerror_void_error_union => return out_stream.writeAll("anyerror!void"), .const_slice_u8 => return out_stream.writeAll("[]const u8"), .fn_noreturn_no_args => return out_stream.writeAll("fn() noreturn"), .fn_void_no_args => return out_stream.writeAll("fn() void"), @@ -500,6 +522,12 @@ pub const Type = extern union { continue; }, + .anyframe_T => { + const payload = @fieldParentPtr(Payload.AnyFrame, "base", ty.ptr_otherwise); + try out_stream.print("anyframe->", .{}); + ty = payload.return_type; + continue; + }, .array_u8 => { const payload = @fieldParentPtr(Payload.Array_u8, "base", ty.ptr_otherwise); return out_stream.print("[{}]u8", .{payload.len}); @@ -622,6 +650,13 @@ pub const Type = extern union { ty = payload.pointee_type; continue; }, + .error_union => { + const payload = @fieldParentPtr(Payload.ErrorUnion, "base", ty.ptr_otherwise); + try payload.error_set.format("", .{}, out_stream); + try out_stream.writeAll("!"); + ty = payload.payload; + continue; + }, } unreachable; } @@ -715,6 +750,9 @@ pub const Type = extern union { .optional, .optional_single_mut_pointer, .optional_single_const_pointer, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => true, // TODO lazy types .array => self.elemType().hasCodeGenBits() and self.arrayLen() != 0, @@ -723,6 +761,11 @@ pub const Type = extern union { .int_signed => self.cast(Payload.IntSigned).?.bits == 0, .int_unsigned => self.cast(Payload.IntUnsigned).?.bits == 0, + .error_union => { + const payload = self.cast(Payload.ErrorUnion).?; + return payload.error_set.hasCodeGenBits() or payload.payload.hasCodeGenBits(); + }, + .c_void, .void, .type, @@ -779,6 +822,8 @@ pub const Type = extern union { .mut_slice, .optional_single_const_pointer, .optional_single_mut_pointer, + .@"anyframe", + .anyframe_T, => return @divExact(target.cpu.arch.ptrBitWidth(), 8), .pointer => { @@ -803,7 +848,7 @@ pub const Type = extern union { .f128 => return 16, .c_longdouble => return 16, - .anyerror => return 2, // TODO revisit this when we have the concept of the error tag type + .anyerror_void_error_union, .anyerror => return 2, // TODO revisit this when we have the concept of the error tag type .array, .array_sentinel => return self.elemType().abiAlignment(target), @@ -829,6 +874,16 @@ pub const Type = extern union { return child_type.abiAlignment(target); }, + .error_union => { + const payload = self.cast(Payload.ErrorUnion).?; + if (!payload.error_set.hasCodeGenBits()) { + return payload.payload.abiAlignment(target); + } else if (!payload.payload.hasCodeGenBits()) { + return payload.error_set.abiAlignment(target); + } + @panic("TODO abiAlignment error union"); + }, + .c_void, .void, .type, @@ -882,12 +937,15 @@ pub const Type = extern union { .i32, .u32 => return 4, .i64, .u64 => return 8, - .isize, .usize => return @divExact(target.cpu.arch.ptrBitWidth(), 8), + .@"anyframe", .anyframe_T, .isize, .usize => return @divExact(target.cpu.arch.ptrBitWidth(), 8), .const_slice, .mut_slice, - .const_slice_u8, - => return @divExact(target.cpu.arch.ptrBitWidth(), 8) * 2, + => { + if (self.elemType().hasCodeGenBits()) return @divExact(target.cpu.arch.ptrBitWidth(), 8) * 2; + return @divExact(target.cpu.arch.ptrBitWidth(), 8); + }, + .const_slice_u8 => return @divExact(target.cpu.arch.ptrBitWidth(), 8) * 2, .optional_single_const_pointer, .optional_single_mut_pointer, @@ -923,7 +981,7 @@ pub const Type = extern union { .f128 => return 16, .c_longdouble => return 16, - .anyerror => return 2, // TODO revisit this when we have the concept of the error tag type + .anyerror_void_error_union, .anyerror => return 2, // TODO revisit this when we have the concept of the error tag type .int_signed, .int_unsigned => { const bits: u16 = if (self.cast(Payload.IntSigned)) |pl| @@ -950,6 +1008,18 @@ pub const Type = extern union { // to the child type's ABI alignment. return child_type.abiAlignment(target) + child_type.abiSize(target); }, + + .error_union => { + const payload = self.cast(Payload.ErrorUnion).?; + if (!payload.error_set.hasCodeGenBits() and !payload.payload.hasCodeGenBits()) { + return 0; + } else if (!payload.error_set.hasCodeGenBits()) { + return payload.payload.abiSize(target); + } else if (!payload.payload.hasCodeGenBits()) { + return payload.error_set.abiSize(target); + } + @panic("TODO abiSize error union"); + }, }; } @@ -1010,6 +1080,10 @@ pub const Type = extern union { .c_mut_pointer, .const_slice, .mut_slice, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .single_const_pointer, @@ -1078,6 +1152,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .const_slice, @@ -1143,6 +1221,10 @@ pub const Type = extern union { .optional_single_const_pointer, .enum_literal, .mut_slice, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .single_const_pointer, @@ -1217,6 +1299,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .pointer => { @@ -1328,6 +1414,10 @@ pub const Type = extern union { .optional_single_const_pointer, .optional_single_mut_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, .array => self.cast(Payload.Array).?.elem_type, @@ -1449,6 +1539,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, .array => self.cast(Payload.Array).?.len, @@ -1516,6 +1610,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, .array, .array_u8 => return null, @@ -1581,6 +1679,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .int_signed, @@ -1649,6 +1751,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .int_unsigned, @@ -1707,6 +1813,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, .int_unsigned => .{ .signed = false, .bits = self.cast(Payload.IntUnsigned).?.bits }, @@ -1783,6 +1893,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, .usize, @@ -1888,6 +2002,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, }; } @@ -1959,6 +2077,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, } } @@ -2029,6 +2151,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, } } @@ -2099,6 +2225,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, }; } @@ -2166,6 +2296,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, }; } @@ -2233,6 +2367,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => unreachable, }; } @@ -2300,6 +2438,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => false, }; } @@ -2351,6 +2493,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .anyerror_void_error_union, + .anyframe_T, + .@"anyframe", + .error_union, => return null, .void => return Value.initTag(.void_value), @@ -2454,6 +2600,10 @@ pub const Type = extern union { .optional_single_mut_pointer, .optional_single_const_pointer, .enum_literal, + .error_union, + .@"anyframe", + .anyframe_T, + .anyerror_void_error_union, => return false, .c_const_pointer, @@ -2511,6 +2661,8 @@ pub const Type = extern union { fn_naked_noreturn_no_args, fn_ccc_void_no_args, single_const_pointer_to_comptime_int, + anyerror_void_error_union, + @"anyframe", const_slice_u8, // See last_no_payload_tag below. // After this, the tag requires a payload. @@ -2533,6 +2685,8 @@ pub const Type = extern union { optional, optional_single_mut_pointer, optional_single_const_pointer, + error_union, + anyframe_T, pub const last_no_payload_tag = Tag.const_slice_u8; pub const no_payload_count = @enumToInt(last_no_payload_tag) + 1; @@ -2614,6 +2768,19 @@ pub const Type = extern union { @"volatile": bool, size: std.builtin.TypeInfo.Pointer.Size, }; + + pub const ErrorUnion = struct { + base: Payload = .{ .tag = .error_union }, + + error_set: Type, + payload: Type, + }; + + pub const AnyFrame = struct { + base: Payload = .{ .tag = .anyframe_T }, + + return_type: Type, + }; }; }; diff --git a/src-self-hosted/value.zig b/src-self-hosted/value.zig index 95a0746e19..7b43c66200 100644 --- a/src-self-hosted/value.zig +++ b/src-self-hosted/value.zig @@ -61,6 +61,7 @@ pub const Value = extern union { single_const_pointer_to_comptime_int_type, const_slice_u8_type, enum_literal_type, + anyframe_type, undef, zero, @@ -168,6 +169,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .undef, .zero, .void_value, @@ -300,6 +302,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type => return out_stream.writeAll("*const comptime_int"), .const_slice_u8_type => return out_stream.writeAll("[]const u8"), .enum_literal_type => return out_stream.writeAll("@TypeOf(.EnumLiteral)"), + .anyframe_type => return out_stream.writeAll("anyframe"), .null_value => return out_stream.writeAll("null"), .undef => return out_stream.writeAll("undefined"), @@ -408,6 +411,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type => Type.initTag(.single_const_pointer_to_comptime_int), .const_slice_u8_type => Type.initTag(.const_slice_u8), .enum_literal_type => Type.initTag(.enum_literal), + .anyframe_type => Type.initTag(.@"anyframe"), .undef, .zero, @@ -482,6 +486,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .null_value, .function, .variable, @@ -560,6 +565,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .null_value, .function, .variable, @@ -638,6 +644,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .null_value, .function, .variable, @@ -742,6 +749,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .null_value, .function, .variable, @@ -825,6 +833,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .null_value, .function, .variable, @@ -988,6 +997,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .bool_true, .bool_false, .null_value, @@ -1063,6 +1073,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .null_value, .function, .variable, @@ -1197,6 +1208,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .zero, .bool_true, .bool_false, @@ -1276,6 +1288,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .zero, .bool_true, .bool_false, @@ -1372,6 +1385,7 @@ pub const Value = extern union { .single_const_pointer_to_comptime_int_type, .const_slice_u8_type, .enum_literal_type, + .anyframe_type, .zero, .empty_array, .bool_true, diff --git a/src-self-hosted/zir.zig b/src-self-hosted/zir.zig index a5d91aa690..9460e3b2bb 100644 --- a/src-self-hosted/zir.zig +++ b/src-self-hosted/zir.zig @@ -43,6 +43,8 @@ pub const Inst = struct { alloc, /// Same as `alloc` except the type is inferred. alloc_inferred, + /// Create an `anyframe->T`. + anyframe_type, /// Array concatenation. `a ++ b` array_cat, /// Array multiplication `a ** b` @@ -135,6 +137,8 @@ pub const Inst = struct { ensure_result_used, /// Emits a compile error if an error is ignored. ensure_result_non_error, + /// Create a `E!T` type. + error_union_type, /// Export the provided Decl as the provided name in the compilation's output object file. @"export", /// Given a pointer to a struct or object that contains virtual fields, returns a pointer @@ -162,6 +166,8 @@ pub const Inst = struct { /// A labeled block of code that loops forever. At the end of the body it is implied /// to repeat; no explicit "repeat" instruction terminates loop bodies. loop, + /// Merge two error sets into one, `E1 || E2`. + merge_error_sets, /// Ambiguously remainder division or modulus. If the computation would possibly have /// a different value depending on whether the operation is remainder division or modulus, /// a compile error is emitted. Otherwise the computation is performed. @@ -288,6 +294,8 @@ pub const Inst = struct { .unwrap_err_safe, .unwrap_err_unsafe, .ensure_err_payload_void, + .anyframe_type, + .bitnot, => UnOp, .add, @@ -318,6 +326,8 @@ pub const Inst = struct { .bitcast, .coerce_result_ptr, .xor, + .error_union_type, + .merge_error_sets, => BinOp, .arg => Arg, @@ -440,6 +450,10 @@ pub const Inst = struct { .ptr_type, .ensure_err_payload_void, .enum_literal, + .merge_error_sets, + .anyframe_type, + .error_union_type, + .bitnot, => false, .@"break", diff --git a/src-self-hosted/zir_sema.zig b/src-self-hosted/zir_sema.zig index 6ac29e02c9..bfe58daf7e 100644 --- a/src-self-hosted/zir_sema.zig +++ b/src-self-hosted/zir_sema.zig @@ -97,7 +97,7 @@ pub fn analyzeInst(mod: *Module, scope: *Scope, old_inst: *zir.Inst) InnerError! .array_cat => return analyzeInstArrayCat(mod, scope, old_inst.castTag(.array_cat).?), .array_mul => return analyzeInstArrayMul(mod, scope, old_inst.castTag(.array_mul).?), .bitand => return analyzeInstBitwise(mod, scope, old_inst.castTag(.bitand).?), - .bitnot => return analyzeInstBitwise(mod, scope, old_inst.castTag(.bitnot).?), + .bitnot => return analyzeInstBitNot(mod, scope, old_inst.castTag(.bitnot).?), .bitor => return analyzeInstBitwise(mod, scope, old_inst.castTag(.bitor).?), .xor => return analyzeInstBitwise(mod, scope, old_inst.castTag(.xor).?), .shl => return analyzeInstShl(mod, scope, old_inst.castTag(.shl).?), @@ -123,6 +123,9 @@ pub fn analyzeInst(mod: *Module, scope: *Scope, old_inst: *zir.Inst) InnerError! .array_type => return analyzeInstArrayType(mod, scope, old_inst.castTag(.array_type).?), .array_type_sentinel => return analyzeInstArrayTypeSentinel(mod, scope, old_inst.castTag(.array_type_sentinel).?), .enum_literal => return analyzeInstEnumLiteral(mod, scope, old_inst.castTag(.enum_literal).?), + .merge_error_sets => return analyzeInstMergeErrorSets(mod, scope, old_inst.castTag(.merge_error_sets).?), + .error_union_type => return analyzeInstErrorUnionType(mod, scope, old_inst.castTag(.error_union_type).?), + .anyframe_type => return analyzeInstAnyframeType(mod, scope, old_inst.castTag(.anyframe_type).?), } } @@ -717,6 +720,27 @@ fn analyzeInstArrayTypeSentinel(mod: *Module, scope: *Scope, array: *zir.Inst.Ar return mod.constType(scope, array.base.src, try mod.arrayType(scope, len.val.toUnsignedInt(), sentinel.val, elem_type)); } +fn analyzeInstErrorUnionType(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerError!*Inst { + const error_union = try resolveType(mod, scope, inst.positionals.lhs); + const payload = try resolveType(mod, scope, inst.positionals.rhs); + + if (error_union.zigTypeTag() != .ErrorSet) { + return mod.fail(scope, inst.base.src, "expected error set type, found {}", .{error_union.elemType()}); + } + + return mod.constType(scope, inst.base.src, try mod.errorUnionType(scope, error_union, payload)); +} + +fn analyzeInstAnyframeType(mod: *Module, scope: *Scope, inst: *zir.Inst.UnOp) InnerError!*Inst { + const return_type = try resolveType(mod, scope, inst.positionals.operand); + + return mod.constType(scope, inst.base.src, try mod.anyframeType(scope, return_type)); +} + +fn analyzeInstMergeErrorSets(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerError!*Inst { + return mod.fail(scope, inst.base.src, "TODO implement merge_error_sets", .{}); +} + fn analyzeInstEnumLiteral(mod: *Module, scope: *Scope, inst: *zir.Inst.EnumLiteral) InnerError!*Inst { const payload = try scope.arena().create(Value.Payload.Bytes); payload.* = .{ @@ -984,6 +1008,10 @@ fn analyzeInstBitwise(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerE return mod.fail(scope, inst.base.src, "TODO implement analyzeInstBitwise", .{}); } +fn analyzeInstBitNot(mod: *Module, scope: *Scope, inst: *zir.Inst.UnOp) InnerError!*Inst { + return mod.fail(scope, inst.base.src, "TODO implement analyzeInstBitNot", .{}); +} + fn analyzeInstArrayCat(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerError!*Inst { return mod.fail(scope, inst.base.src, "TODO implement analyzeInstArrayCat", .{}); } From e9b15ac9a099fd17e6b68d0f04ec42a2dbfda0ca Mon Sep 17 00:00:00 2001 From: Vexu Date: Sun, 23 Aug 2020 15:50:36 +0300 Subject: [PATCH 48/55] stage2: error set declarations --- src-self-hosted/Module.zig | 17 ++++++++ src-self-hosted/astgen.zig | 75 ++++++++++++++---------------------- src-self-hosted/value.zig | 30 +++++++++++++++ src-self-hosted/zir.zig | 39 +++++++++++++++++++ src-self-hosted/zir_sema.zig | 28 +++++++++++++- 5 files changed, 142 insertions(+), 47 deletions(-) diff --git a/src-self-hosted/Module.zig b/src-self-hosted/Module.zig index f97254f29a..9b3e72e7aa 100644 --- a/src-self-hosted/Module.zig +++ b/src-self-hosted/Module.zig @@ -80,6 +80,9 @@ deletion_set: std.ArrayListUnmanaged(*Decl) = .{}, root_name: []u8, keep_source_files_loaded: bool, +/// Error tags and their values, tag names are duped with mod.gpa. +global_error_set: std.StringHashMapUnmanaged(u16) = .{}, + pub const InnerError = error{ OutOfMemory, AnalysisFail }; const WorkItem = union(enum) { @@ -928,6 +931,11 @@ pub fn deinit(self: *Module) void { self.symbol_exports.deinit(gpa); self.root_scope.destroy(gpa); + + for (self.global_error_set.items()) |entry| { + gpa.free(entry.key); + } + self.global_error_set.deinit(gpa); self.* = undefined; } @@ -2072,6 +2080,15 @@ fn createNewDecl( return new_decl; } +/// Get error value for error tag `name`. +pub fn getErrorValue(self: *Module, name: []const u8) !u16 { + const new_val = @intCast(u16, self.global_error_set.items().len); + if (self.global_error_set.get(name)) |some| return some; + + try self.global_error_set.put(self.gpa, try self.gpa.dupe(u8, name), new_val); + return new_val; +} + /// TODO split this into `requireRuntimeBlock` and `requireFunctionBlock` and audit callsites. pub fn requireRuntimeBlock(self: *Module, scope: *Scope, src: usize) !*Scope.Block { return scope.cast(Scope.Block) orelse diff --git a/src-self-hosted/astgen.zig b/src-self-hosted/astgen.zig index 32041fbc2b..b77cf97dfc 100644 --- a/src-self-hosted/astgen.zig +++ b/src-self-hosted/astgen.zig @@ -270,6 +270,7 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .ErrorUnion => return rlWrap(mod, scope, rl, try typeInixOp(mod, scope, node.castTag(.ErrorUnion).?, .error_union_type)), .MergeErrorSets => return rlWrap(mod, scope, rl, try typeInixOp(mod, scope, node.castTag(.MergeErrorSets).?, .merge_error_sets)), .AnyFrameType => return rlWrap(mod, scope, rl, try anyFrameType(mod, scope, node.castTag(.AnyFrameType).?)), + .ErrorSetDecl => return rlWrap(mod, scope, rl, try errorSetDecl(mod, scope, node.castTag(.ErrorSetDecl).?)), .Defer => return mod.failNode(scope, node, "TODO implement astgen.expr for .Defer", .{}), .Catch => return mod.failNode(scope, node, "TODO implement astgen.expr for .Catch", .{}), @@ -291,7 +292,6 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .AnyType => return mod.failNode(scope, node, "TODO implement astgen.expr for .AnyType", .{}), .ErrorType => return mod.failNode(scope, node, "TODO implement astgen.expr for .ErrorType", .{}), .FnProto => return mod.failNode(scope, node, "TODO implement astgen.expr for .FnProto", .{}), - .ErrorSetDecl => return mod.failNode(scope, node, "TODO implement astgen.expr for .ErrorSetDecl", .{}), .ContainerDecl => return mod.failNode(scope, node, "TODO implement astgen.expr for .ContainerDecl", .{}), .Comptime => return mod.failNode(scope, node, "TODO implement astgen.expr for .Comptime", .{}), .Nosuspend => return mod.failNode(scope, node, "TODO implement astgen.expr for .Nosuspend", .{}), @@ -459,7 +459,9 @@ fn varDecl( const tree = scope.tree(); const name_src = tree.token_locs[node.name_token].start; const ident_name = try identifierTokenString(mod, scope, node.name_token); - const init_node = node.getTrailer("init_node").?; + const init_node = node.getTrailer("init_node") orelse + return mod.fail(scope, name_src, "variables must be initialized", .{}); + switch (tree.token_ids[node.mut_token]) { .Keyword_const => { // Depending on the type of AST the initialization expression is, we may need an lvalue @@ -582,11 +584,7 @@ fn addressOf(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp) InnerE fn optionalType(mod: *Module, scope: *Scope, node: *ast.Node.SimplePrefixOp) InnerError!*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.op_token].start; - const meta_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); - const operand = try expr(mod, scope, .{ .ty = meta_type }, node.rhs); + const operand = try typeExpr(mod, scope, node.rhs); return addZIRUnOp(mod, scope, src, .optional_type, operand); } @@ -611,18 +609,13 @@ fn ptrType(mod: *Module, scope: *Scope, node: *ast.Node.PtrType) InnerError!*zir } fn ptrSliceType(mod: *Module, scope: *Scope, src: usize, ptr_info: *ast.PtrInfo, rhs: *ast.Node, size: std.builtin.TypeInfo.Pointer.Size) InnerError!*zir.Inst { - const meta_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); - const simple = ptr_info.allowzero_token == null and ptr_info.align_info == null and ptr_info.volatile_token == null and ptr_info.sentinel == null; if (simple) { - const child_type = try expr(mod, scope, .{ .ty = meta_type }, rhs); + const child_type = try typeExpr(mod, scope, rhs); const mutable = ptr_info.const_token == null; // TODO stage1 type inference bug const T = zir.Inst.Tag; @@ -650,7 +643,7 @@ fn ptrSliceType(mod: *Module, scope: *Scope, src: usize, ptr_info: *ast.PtrInfo, kw_args.sentinel = try expr(mod, scope, .none, some); } - const child_type = try expr(mod, scope, .{ .ty = meta_type }, rhs); + const child_type = try typeExpr(mod, scope, rhs); if (kw_args.sentinel) |some| { kw_args.sentinel = try addZIRBinOp(mod, scope, some.src, .as, child_type, some); } @@ -661,10 +654,6 @@ fn ptrSliceType(mod: *Module, scope: *Scope, src: usize, ptr_info: *ast.PtrInfo, fn arrayType(mod: *Module, scope: *Scope, node: *ast.Node.ArrayType) !*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.op_token].start; - const meta_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); const usize_type = try addZIRInstConst(mod, scope, src, .{ .ty = Type.initTag(.type), .val = Value.initTag(.usize_type), @@ -672,18 +661,14 @@ fn arrayType(mod: *Module, scope: *Scope, node: *ast.Node.ArrayType) !*zir.Inst // TODO check for [_]T const len = try expr(mod, scope, .{ .ty = usize_type }, node.len_expr); - const child_type = try expr(mod, scope, .{ .ty = meta_type }, node.rhs); + const elem_type = try typeExpr(mod, scope, node.rhs); - return addZIRBinOp(mod, scope, src, .array_type, len, child_type); + return addZIRBinOp(mod, scope, src, .array_type, len, elem_type); } fn arrayTypeSentinel(mod: *Module, scope: *Scope, node: *ast.Node.ArrayTypeSentinel) !*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.op_token].start; - const meta_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); const usize_type = try addZIRInstConst(mod, scope, src, .{ .ty = Type.initTag(.type), .val = Value.initTag(.usize_type), @@ -692,7 +677,7 @@ fn arrayTypeSentinel(mod: *Module, scope: *Scope, node: *ast.Node.ArrayTypeSenti // TODO check for [_]T const len = try expr(mod, scope, .{ .ty = usize_type }, node.len_expr); const sentinel_uncasted = try expr(mod, scope, .none, node.sentinel); - const elem_type = try expr(mod, scope, .{ .ty = meta_type }, node.rhs); + const elem_type = try typeExpr(mod, scope, node.rhs); const sentinel = try addZIRBinOp(mod, scope, src, .as, elem_type, sentinel_uncasted); return addZIRInst(mod, scope, src, zir.Inst.ArrayTypeSentinel, .{ @@ -706,11 +691,7 @@ fn anyFrameType(mod: *Module, scope: *Scope, node: *ast.Node.AnyFrameType) Inner const tree = scope.tree(); const src = tree.token_locs[node.anyframe_token].start; if (node.result) |some| { - const meta_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); - const return_type = try expr(mod, scope, .{ .ty = meta_type}, some.return_type); + const return_type = try typeExpr(mod, scope, some.return_type); return addZIRUnOp(mod, scope, src, .anyframe_type, return_type); } else { return addZIRInstConst(mod, scope, src, .{ @@ -723,12 +704,8 @@ fn anyFrameType(mod: *Module, scope: *Scope, node: *ast.Node.AnyFrameType) Inner fn typeInixOp(mod: *Module, scope: *Scope, node: *ast.Node.SimpleInfixOp, op_inst_tag: zir.Inst.Tag) InnerError!*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.op_token].start; - const meta_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); - const error_set = try expr(mod, scope, .{ .ty = meta_type }, node.lhs); - const payload = try expr(mod, scope, .{ .ty = meta_type }, node.rhs); + const error_set = try typeExpr(mod, scope, node.lhs); + const payload = try typeExpr(mod, scope, node.rhs); return addZIRBinOp(mod, scope, src, op_inst_tag, error_set, payload); } @@ -751,6 +728,20 @@ fn unwrapOptional(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node.Si return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, src, .deref, unwrapped_ptr)); } +fn errorSetDecl(mod: *Module, scope: *Scope, node: *ast.Node.ErrorSetDecl) InnerError!*zir.Inst { + const tree = scope.tree(); + const src = tree.token_locs[node.error_token].start; + const decls = node.decls(); + const fields = try scope.arena().alloc([]const u8, decls.len); + + for (decls) |decl, i| { + const tag = decl.castTag(.ErrorTag).?; + fields[i] = try identifierTokenString(mod, scope, tag.name_token); + } + + return addZIRInst(mod, scope, src, zir.Inst.ErrorSet, .{ .fields = fields }, .{}); +} + /// Return whether the identifier names of two tokens are equal. Resolves @"" tokens without allocating. /// OK in theory it could do it without allocating. This implementation allocates when the @"" form is used. fn tokenIdentEql(mod: *Module, scope: *Scope, token1: ast.TokenIndex, token2: ast.TokenIndex) !bool { @@ -1517,12 +1508,8 @@ fn simpleCast( try ensureBuiltinParamCount(mod, scope, call, 2); const tree = scope.tree(); const src = tree.token_locs[call.builtin_token].start; - const type_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); const params = call.params(); - const dest_type = try expr(mod, scope, .{ .ty = type_type }, params[0]); + const dest_type = try typeExpr(mod, scope, params[0]); const rhs = try expr(mod, scope, .none, params[1]); const result = try addZIRBinOp(mod, scope, src, inst_tag, dest_type, rhs); return rlWrap(mod, scope, rl, result); @@ -1584,12 +1571,8 @@ fn bitCast(mod: *Module, scope: *Scope, rl: ResultLoc, call: *ast.Node.BuiltinCa try ensureBuiltinParamCount(mod, scope, call, 2); const tree = scope.tree(); const src = tree.token_locs[call.builtin_token].start; - const type_type = try addZIRInstConst(mod, scope, src, .{ - .ty = Type.initTag(.type), - .val = Value.initTag(.type_type), - }); const params = call.params(); - const dest_type = try expr(mod, scope, .{ .ty = type_type }, params[0]); + const dest_type = try typeExpr(mod, scope, params[0]); switch (rl) { .none => { const operand = try expr(mod, scope, .none, params[1]); diff --git a/src-self-hosted/value.zig b/src-self-hosted/value.zig index 7b43c66200..f7917b9d44 100644 --- a/src-self-hosted/value.zig +++ b/src-self-hosted/value.zig @@ -91,6 +91,7 @@ pub const Value = extern union { float_64, float_128, enum_literal, + error_set, pub const last_no_payload_tag = Tag.bool_false; pub const no_payload_count = @enumToInt(last_no_payload_tag) + 1; @@ -243,6 +244,9 @@ pub const Value = extern union { }; return Value{ .ptr_otherwise = &new_payload.base }; }, + + // memory is managed by the declaration + .error_set => return self, } } @@ -346,6 +350,14 @@ pub const Value = extern union { .float_32 => return out_stream.print("{}", .{val.cast(Payload.Float_32).?.val}), .float_64 => return out_stream.print("{}", .{val.cast(Payload.Float_64).?.val}), .float_128 => return out_stream.print("{}", .{val.cast(Payload.Float_128).?.val}), + .error_set => { + const error_set = val.cast(Payload.ErrorSet).?; + try out_stream.writeAll("error{"); + for (error_set.fields.items()) |entry| { + try out_stream.print("{},", .{entry.value}); + } + return out_stream.writeAll("}"); + }, }; } @@ -437,6 +449,7 @@ pub const Value = extern union { .float_64, .float_128, .enum_literal, + .error_set, => unreachable, }; } @@ -503,6 +516,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .undef => unreachable, @@ -582,6 +596,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .undef => unreachable, @@ -661,6 +676,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .undef => unreachable, @@ -767,6 +783,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .zero, @@ -850,6 +867,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .zero, @@ -1017,6 +1035,7 @@ pub const Value = extern union { .void_value, .unreachable_value, .enum_literal, + .error_set, => unreachable, .zero => false, @@ -1087,6 +1106,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .zero, @@ -1230,6 +1250,7 @@ pub const Value = extern union { .unreachable_value, .empty_array, .enum_literal, + .error_set, => unreachable, .ref_val => self.cast(Payload.RefVal).?.val, @@ -1310,6 +1331,7 @@ pub const Value = extern union { .void_value, .unreachable_value, .enum_literal, + .error_set, => unreachable, .empty_array => unreachable, // out of bounds array index @@ -1407,6 +1429,7 @@ pub const Value = extern union { .float_128, .void_value, .enum_literal, + .error_set, => false, .undef => unreachable, @@ -1536,6 +1559,13 @@ pub const Value = extern union { base: Payload = .{ .tag = .float_128 }, val: f128, }; + + pub const ErrorSet = struct { + base: Payload = .{ .tag = .error_set }, + + // TODO revisit this when we have the concept of the error tag type + fields: std.StringHashMapUnmanaged(u16), + }; }; /// Big enough to fit any non-BigInt value diff --git a/src-self-hosted/zir.zig b/src-self-hosted/zir.zig index 9460e3b2bb..079dc13c35 100644 --- a/src-self-hosted/zir.zig +++ b/src-self-hosted/zir.zig @@ -139,6 +139,8 @@ pub const Inst = struct { ensure_result_non_error, /// Create a `E!T` type. error_union_type, + /// Create an error set. + error_set, /// Export the provided Decl as the provided name in the compilation's output object file. @"export", /// Given a pointer to a struct or object that contains virtual fields, returns a pointer @@ -359,6 +361,7 @@ pub const Inst = struct { .condbr => CondBr, .ptr_type => PtrType, .enum_literal => EnumLiteral, + .error_set => ErrorSet, }; } @@ -454,6 +457,7 @@ pub const Inst = struct { .anyframe_type, .error_union_type, .bitnot, + .error_set, => false, .@"break", @@ -924,6 +928,16 @@ pub const Inst = struct { }, kw_args: struct {}, }; + + pub const ErrorSet = struct { + pub const base_tag = Tag.error_set; + base: Inst, + + positionals: struct { + fields: [][]const u8, + }, + kw_args: struct {}, + }; }; pub const ErrorMsg = struct { @@ -1158,6 +1172,16 @@ const Writer = struct { const name = self.loop_table.get(param).?; return std.zig.renderStringLiteral(name, stream); }, + [][]const u8 => { + try stream.writeByte('['); + for (param) |str, i| { + if (i != 0) { + try stream.writeAll(", "); + } + try std.zig.renderStringLiteral(str, stream); + } + try stream.writeByte(']'); + }, else => |T| @compileError("unimplemented: rendering parameter of type " ++ @typeName(T)), } } @@ -1555,6 +1579,21 @@ const Parser = struct { const name = try self.parseStringLiteral(); return self.loop_table.get(name).?; }, + [][]const u8 => { + try requireEatBytes(self, "["); + skipSpace(self); + if (eatByte(self, ']')) return &[0][]const u8{}; + + var strings = std.ArrayList([]const u8).init(&self.arena.allocator); + while (true) { + skipSpace(self); + try strings.append(try self.parseStringLiteral()); + skipSpace(self); + if (!eatByte(self, ',')) break; + } + try requireEatBytes(self, "]"); + return strings.toOwnedSlice(); + }, else => @compileError("Unimplemented: ir parseParameterGeneric for type " ++ @typeName(T)), } return self.fail("TODO parse parameter {}", .{@typeName(T)}); diff --git a/src-self-hosted/zir_sema.zig b/src-self-hosted/zir_sema.zig index bfe58daf7e..6b30d58fdb 100644 --- a/src-self-hosted/zir_sema.zig +++ b/src-self-hosted/zir_sema.zig @@ -126,6 +126,7 @@ pub fn analyzeInst(mod: *Module, scope: *Scope, old_inst: *zir.Inst) InnerError! .merge_error_sets => return analyzeInstMergeErrorSets(mod, scope, old_inst.castTag(.merge_error_sets).?), .error_union_type => return analyzeInstErrorUnionType(mod, scope, old_inst.castTag(.error_union_type).?), .anyframe_type => return analyzeInstAnyframeType(mod, scope, old_inst.castTag(.anyframe_type).?), + .error_set => return analyzeInstErrorSet(mod, scope, old_inst.castTag(.error_set).?), } } @@ -435,6 +436,7 @@ fn analyzeInstStr(mod: *Module, scope: *Scope, str_inst: *zir.Inst.Str) InnerErr // The bytes references memory inside the ZIR module, which can get deallocated // after semantic analysis is complete. We need the memory to be in the new anonymous Decl's arena. var new_decl_arena = std.heap.ArenaAllocator.init(mod.gpa); + errdefer new_decl_arena.deinit(); const arena_bytes = try new_decl_arena.allocator.dupe(u8, str_inst.positionals.bytes); const ty_payload = try scope.arena().create(Type.Payload.Array_u8_Sentinel0); @@ -737,6 +739,30 @@ fn analyzeInstAnyframeType(mod: *Module, scope: *Scope, inst: *zir.Inst.UnOp) In return mod.constType(scope, inst.base.src, try mod.anyframeType(scope, return_type)); } +fn analyzeInstErrorSet(mod: *Module, scope: *Scope, inst: *zir.Inst.ErrorSet) InnerError!*Inst { + // The bytes references memory inside the ZIR module, which can get deallocated + // after semantic analysis is complete. We need the memory to be in the new anonymous Decl's arena. + var new_decl_arena = std.heap.ArenaAllocator.init(mod.gpa); + errdefer new_decl_arena.deinit(); + + const payload = try scope.arena().create(Value.Payload.ErrorSet); + payload.* = .{ .fields = .{} }; + try payload.fields.ensureCapacity(&new_decl_arena.allocator, inst.positionals.fields.len); + + for (inst.positionals.fields) |field_name| { + const value = try mod.getErrorValue(field_name); + if (payload.fields.fetchPutAssumeCapacity(field_name, value)) |prev| { + return mod.fail(scope, inst.base.src, "duplicate error: '{}'", .{field_name}); + } + } + // TODO create name in format "error:line:column" + const new_decl = try mod.createAnonymousDecl(scope, &new_decl_arena, .{ + .ty = Type.initTag(.type), + .val = Value.initPayload(&payload.base), + }); + return mod.analyzeDeclRef(scope, inst.base.src, new_decl); +} + fn analyzeInstMergeErrorSets(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerError!*Inst { return mod.fail(scope, inst.base.src, "TODO implement merge_error_sets", .{}); } @@ -1377,7 +1403,7 @@ fn analyzeInstPtrType(mod: *Module, scope: *Scope, inst: *zir.Inst.PtrType) Inne if (host_size != 0 and bit_offset >= host_size * 8) return mod.fail(scope, inst.base.src, "bit offset starts after end of host integer", .{}); - + const sentinel = if (inst.kw_args.sentinel) |some| (try resolveInstConst(mod, scope, some)).val else From 1520e084cb5fee08ddaf670046c38fd34d3d2cff Mon Sep 17 00:00:00 2001 From: Vexu Date: Sun, 23 Aug 2020 20:19:05 +0300 Subject: [PATCH 49/55] stage2: implement accessing error values --- src-self-hosted/Module.zig | 11 +++++--- src-self-hosted/astgen.zig | 51 ++++++++++++++++++++---------------- src-self-hosted/value.zig | 28 ++++++++++++++++++-- src-self-hosted/zir_sema.zig | 39 ++++++++++++++++++++++++--- 4 files changed, 96 insertions(+), 33 deletions(-) diff --git a/src-self-hosted/Module.zig b/src-self-hosted/Module.zig index 9b3e72e7aa..f23e09d44c 100644 --- a/src-self-hosted/Module.zig +++ b/src-self-hosted/Module.zig @@ -2081,12 +2081,15 @@ fn createNewDecl( } /// Get error value for error tag `name`. -pub fn getErrorValue(self: *Module, name: []const u8) !u16 { +pub fn getErrorValue(self: *Module, name: []const u8) !std.StringHashMapUnmanaged(u16).Entry { const new_val = @intCast(u16, self.global_error_set.items().len); - if (self.global_error_set.get(name)) |some| return some; + if (self.global_error_set.getEntry(name)) |some| return some.*; - try self.global_error_set.put(self.gpa, try self.gpa.dupe(u8, name), new_val); - return new_val; + const duped = try self.gpa.dupe(u8, name); + errdefer self.gpa.free(duped); + + try self.global_error_set.put(self.gpa, duped, new_val); + return self.global_error_set.getEntry(duped).?.*; } /// TODO split this into `requireRuntimeBlock` and `requireFunctionBlock` and audit callsites. diff --git a/src-self-hosted/astgen.zig b/src-self-hosted/astgen.zig index b77cf97dfc..cd5639d791 100644 --- a/src-self-hosted/astgen.zig +++ b/src-self-hosted/astgen.zig @@ -247,7 +247,7 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .Return => return ret(mod, scope, node.castTag(.Return).?), .If => return ifExpr(mod, scope, rl, node.castTag(.If).?), .While => return whileExpr(mod, scope, rl, node.castTag(.While).?), - .Period => return rlWrap(mod, scope, rl, try field(mod, scope, node.castTag(.Period).?)), + .Period => return field(mod, scope, rl, node.castTag(.Period).?), .Deref => return rlWrap(mod, scope, rl, try deref(mod, scope, node.castTag(.Deref).?)), .AddressOf => return rlWrap(mod, scope, rl, try addressOf(mod, scope, node.castTag(.AddressOf).?)), .FloatLiteral => return rlWrap(mod, scope, rl, try floatLiteral(mod, scope, node.castTag(.FloatLiteral).?)), @@ -270,7 +270,8 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .ErrorUnion => return rlWrap(mod, scope, rl, try typeInixOp(mod, scope, node.castTag(.ErrorUnion).?, .error_union_type)), .MergeErrorSets => return rlWrap(mod, scope, rl, try typeInixOp(mod, scope, node.castTag(.MergeErrorSets).?, .merge_error_sets)), .AnyFrameType => return rlWrap(mod, scope, rl, try anyFrameType(mod, scope, node.castTag(.AnyFrameType).?)), - .ErrorSetDecl => return rlWrap(mod, scope, rl, try errorSetDecl(mod, scope, node.castTag(.ErrorSetDecl).?)), + .ErrorSetDecl => return errorSetDecl(mod, scope, rl, node.castTag(.ErrorSetDecl).?), + .ErrorType => return rlWrap(mod, scope, rl, try errorType(mod, scope, node.castTag(.ErrorType).?)), .Defer => return mod.failNode(scope, node, "TODO implement astgen.expr for .Defer", .{}), .Catch => return mod.failNode(scope, node, "TODO implement astgen.expr for .Catch", .{}), @@ -290,7 +291,6 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerEr .Suspend => return mod.failNode(scope, node, "TODO implement astgen.expr for .Suspend", .{}), .Continue => return mod.failNode(scope, node, "TODO implement astgen.expr for .Continue", .{}), .AnyType => return mod.failNode(scope, node, "TODO implement astgen.expr for .AnyType", .{}), - .ErrorType => return mod.failNode(scope, node, "TODO implement astgen.expr for .ErrorType", .{}), .FnProto => return mod.failNode(scope, node, "TODO implement astgen.expr for .FnProto", .{}), .ContainerDecl => return mod.failNode(scope, node, "TODO implement astgen.expr for .ContainerDecl", .{}), .Comptime => return mod.failNode(scope, node, "TODO implement astgen.expr for .Comptime", .{}), @@ -722,13 +722,10 @@ fn unwrapOptional(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node.Si const src = tree.token_locs[node.rtoken].start; const operand = try expr(mod, scope, .ref, node.lhs); - const unwrapped_ptr = try addZIRUnOp(mod, scope, src, .unwrap_optional_safe, operand); - if (rl == .lvalue or rl == .ref) return unwrapped_ptr; - - return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, src, .deref, unwrapped_ptr)); + return rlWrapPtr(mod, scope, rl, try addZIRUnOp(mod, scope, src, .unwrap_optional_safe, operand)); } -fn errorSetDecl(mod: *Module, scope: *Scope, node: *ast.Node.ErrorSetDecl) InnerError!*zir.Inst { +fn errorSetDecl(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node.ErrorSetDecl) InnerError!*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.error_token].start; const decls = node.decls(); @@ -739,7 +736,17 @@ fn errorSetDecl(mod: *Module, scope: *Scope, node: *ast.Node.ErrorSetDecl) Inner fields[i] = try identifierTokenString(mod, scope, tag.name_token); } - return addZIRInst(mod, scope, src, zir.Inst.ErrorSet, .{ .fields = fields }, .{}); + // analyzing the error set results in a decl ref, so we might need to dereference it + return rlWrapPtr(mod, scope, rl, try addZIRInst(mod, scope, src, zir.Inst.ErrorSet, .{ .fields = fields }, .{})); +} + +fn errorType(mod: *Module, scope: *Scope, node: *ast.Node.OneToken) InnerError!*zir.Inst { + const tree = scope.tree(); + const src = tree.token_locs[node.token].start; + return addZIRInstConst(mod, scope, src, .{ + .ty = Type.initTag(.type), + .val = Value.initTag(.anyerror_type), + }); } /// Return whether the identifier names of two tokens are equal. Resolves @"" tokens without allocating. @@ -779,16 +786,16 @@ pub fn identifierStringInst(mod: *Module, scope: *Scope, node: *ast.Node.OneToke return addZIRInst(mod, scope, src, zir.Inst.Str, .{ .bytes = ident_name }, .{}); } -fn field(mod: *Module, scope: *Scope, node: *ast.Node.SimpleInfixOp) InnerError!*zir.Inst { - // TODO introduce lvalues +fn field(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node.SimpleInfixOp) InnerError!*zir.Inst { const tree = scope.tree(); const src = tree.token_locs[node.op_token].start; - const lhs = try expr(mod, scope, .none, node.lhs); + const lhs = try expr(mod, scope, .ref, node.lhs); const field_name = try identifierStringInst(mod, scope, node.rhs.castTag(.Identifier).?); const pointer = try addZIRInst(mod, scope, src, zir.Inst.FieldPtr, .{ .object_ptr = lhs, .field_name = field_name }, .{}); - return addZIRUnOp(mod, scope, src, .deref, pointer); + if (rl == .ref or rl == .lvalue) return pointer; + return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, src, .deref, pointer)); } fn deref(mod: *Module, scope: *Scope, node: *ast.Node.SimpleSuffixOp) InnerError!*zir.Inst { @@ -1274,12 +1281,7 @@ fn identifier(mod: *Module, scope: *Scope, rl: ResultLoc, ident: *ast.Node.OneTo .local_ptr => { const local_ptr = s.cast(Scope.LocalPtr).?; if (mem.eql(u8, local_ptr.name, ident_name)) { - if (rl == .lvalue or rl == .ref) { - return local_ptr.ptr; - } else { - const result = try addZIRUnOp(mod, scope, src, .deref, local_ptr.ptr); - return rlWrap(mod, scope, rl, result); - } + return rlWrapPtr(mod, scope, rl, local_ptr.ptr); } s = local_ptr.parent; }, @@ -1289,10 +1291,7 @@ fn identifier(mod: *Module, scope: *Scope, rl: ResultLoc, ident: *ast.Node.OneTo } if (mod.lookupDeclName(scope, ident_name)) |decl| { - const result = try addZIRInst(mod, scope, src, zir.Inst.DeclValInModule, .{ .decl = decl }, .{}); - if (rl == .lvalue or rl == .ref) - return result; - return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, src, .deref, result)); + return rlWrapPtr(mod, scope, rl, try addZIRInst(mod, scope, src, zir.Inst.DeclValInModule, .{ .decl = decl }, .{})); } return mod.failNode(scope, &ident.base, "use of undeclared identifier '{}'", .{ident_name}); @@ -1886,6 +1885,12 @@ fn rlWrapVoid(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node, resul return rlWrap(mod, scope, rl, void_inst); } +fn rlWrapPtr(mod: *Module, scope: *Scope, rl: ResultLoc, ptr: *zir.Inst) InnerError!*zir.Inst { + if (rl == .lvalue or rl == .ref) return ptr; + + return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, ptr.src, .deref, ptr)); +} + pub fn addZIRInstSpecial( mod: *Module, scope: *Scope, diff --git a/src-self-hosted/value.zig b/src-self-hosted/value.zig index f7917b9d44..eacbd4e9ab 100644 --- a/src-self-hosted/value.zig +++ b/src-self-hosted/value.zig @@ -92,6 +92,7 @@ pub const Value = extern union { float_128, enum_literal, error_set, + @"error", pub const last_no_payload_tag = Tag.bool_false; pub const no_payload_count = @enumToInt(last_no_payload_tag) + 1; @@ -244,9 +245,10 @@ pub const Value = extern union { }; return Value{ .ptr_otherwise = &new_payload.base }; }, + .@"error" => return self.copyPayloadShallow(allocator, Payload.Error), // memory is managed by the declaration - .error_set => return self, + .error_set => return self.copyPayloadShallow(allocator, Payload.ErrorSet), } } @@ -358,6 +360,7 @@ pub const Value = extern union { } return out_stream.writeAll("}"); }, + .@"error" => return out_stream.print("error.{}", .{val.cast(Payload.Error).?.name}), }; } @@ -424,6 +427,7 @@ pub const Value = extern union { .const_slice_u8_type => Type.initTag(.const_slice_u8), .enum_literal_type => Type.initTag(.enum_literal), .anyframe_type => Type.initTag(.@"anyframe"), + .error_set => @panic("TODO error set to type"), .undef, .zero, @@ -449,7 +453,7 @@ pub const Value = extern union { .float_64, .float_128, .enum_literal, - .error_set, + .@"error", => unreachable, }; } @@ -517,6 +521,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .undef => unreachable, @@ -597,6 +602,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .undef => unreachable, @@ -677,6 +683,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .undef => unreachable, @@ -784,6 +791,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .zero, @@ -868,6 +876,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .zero, @@ -1036,6 +1045,7 @@ pub const Value = extern union { .unreachable_value, .enum_literal, .error_set, + .@"error", => unreachable, .zero => false, @@ -1107,6 +1117,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .zero, @@ -1251,6 +1262,7 @@ pub const Value = extern union { .empty_array, .enum_literal, .error_set, + .@"error", => unreachable, .ref_val => self.cast(Payload.RefVal).?.val, @@ -1332,6 +1344,7 @@ pub const Value = extern union { .unreachable_value, .enum_literal, .error_set, + .@"error", => unreachable, .empty_array => unreachable, // out of bounds array index @@ -1430,6 +1443,7 @@ pub const Value = extern union { .void_value, .enum_literal, .error_set, + .@"error", => false, .undef => unreachable, @@ -1566,6 +1580,16 @@ pub const Value = extern union { // TODO revisit this when we have the concept of the error tag type fields: std.StringHashMapUnmanaged(u16), }; + + pub const Error = struct { + base: Payload = .{ .tag = .@"error" }, + + // TODO revisit this when we have the concept of the error tag type + /// `name` is owned by `Module` and will be valid for the entire + /// duration of the compilation. + name: []const u8, + value: u16, + }; }; /// Big enough to fit any non-BigInt value diff --git a/src-self-hosted/zir_sema.zig b/src-self-hosted/zir_sema.zig index 6b30d58fdb..acf5ca641f 100644 --- a/src-self-hosted/zir_sema.zig +++ b/src-self-hosted/zir_sema.zig @@ -740,8 +740,7 @@ fn analyzeInstAnyframeType(mod: *Module, scope: *Scope, inst: *zir.Inst.UnOp) In } fn analyzeInstErrorSet(mod: *Module, scope: *Scope, inst: *zir.Inst.ErrorSet) InnerError!*Inst { - // The bytes references memory inside the ZIR module, which can get deallocated - // after semantic analysis is complete. We need the memory to be in the new anonymous Decl's arena. + // The declarations arena will store the hashmap. var new_decl_arena = std.heap.ArenaAllocator.init(mod.gpa); errdefer new_decl_arena.deinit(); @@ -750,8 +749,8 @@ fn analyzeInstErrorSet(mod: *Module, scope: *Scope, inst: *zir.Inst.ErrorSet) In try payload.fields.ensureCapacity(&new_decl_arena.allocator, inst.positionals.fields.len); for (inst.positionals.fields) |field_name| { - const value = try mod.getErrorValue(field_name); - if (payload.fields.fetchPutAssumeCapacity(field_name, value)) |prev| { + const entry = try mod.getErrorValue(field_name); + if (payload.fields.fetchPutAssumeCapacity(entry.key, entry.value)) |prev| { return mod.fail(scope, inst.base.src, "duplicate error: '{}'", .{field_name}); } } @@ -909,6 +908,38 @@ fn analyzeInstFieldPtr(mod: *Module, scope: *Scope, fieldptr: *zir.Inst.FieldPtr ); } }, + .Type => { + _ = try mod.resolveConstValue(scope, object_ptr); + const result = try mod.analyzeDeref(scope, fieldptr.base.src, object_ptr, object_ptr.src); + const val = result.value().?; + const child_type = val.toType(); + switch (child_type.zigTypeTag()) { + .ErrorSet => { + // TODO resolve inferred error sets + const entry = if (val.cast(Value.Payload.ErrorSet)) |payload| + (payload.fields.getEntry(field_name) orelse + return mod.fail(scope, fieldptr.base.src, "no error named '{}' in '{}'", .{ field_name, child_type })).* + else + try mod.getErrorValue(field_name); + + const error_payload = try scope.arena().create(Value.Payload.Error); + error_payload.* = .{ + .name = entry.key, + .value = entry.value, + }; + + const ref_payload = try scope.arena().create(Value.Payload.RefVal); + ref_payload.* = .{ .val = Value.initPayload(&error_payload.base) }; + + // TODO if this is accessing the global error set create a `error{field_name}` type + return mod.constInst(scope, fieldptr.base.src, .{ + .ty = try mod.simplePtrType(scope, fieldptr.base.src, child_type, false, .One), + .val = Value.initPayload(&ref_payload.base), + }); + }, + else => return mod.fail(scope, fieldptr.base.src, "type '{}' does not support field access", .{child_type}), + } + }, else => return mod.fail(scope, fieldptr.base.src, "type '{}' does not support field access", .{elem_ty}), } } From bc1d55a1d19e1b4ad3826d58127396f27e96242c Mon Sep 17 00:00:00 2001 From: Vexu Date: Mon, 24 Aug 2020 16:05:34 +0300 Subject: [PATCH 50/55] stage2: fix field access of array pointers --- src-self-hosted/zir_sema.zig | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src-self-hosted/zir_sema.zig b/src-self-hosted/zir_sema.zig index acf5ca641f..85e6a764fb 100644 --- a/src-self-hosted/zir_sema.zig +++ b/src-self-hosted/zir_sema.zig @@ -908,6 +908,33 @@ fn analyzeInstFieldPtr(mod: *Module, scope: *Scope, fieldptr: *zir.Inst.FieldPtr ); } }, + .Pointer => { + const ptr_child = elem_ty.elemType(); + switch (ptr_child.zigTypeTag()) { + .Array => { + if (mem.eql(u8, field_name, "len")) { + const len_payload = try scope.arena().create(Value.Payload.Int_u64); + len_payload.* = .{ .int = ptr_child.arrayLen() }; + + const ref_payload = try scope.arena().create(Value.Payload.RefVal); + ref_payload.* = .{ .val = Value.initPayload(&len_payload.base) }; + + return mod.constInst(scope, fieldptr.base.src, .{ + .ty = Type.initTag(.single_const_pointer_to_comptime_int), + .val = Value.initPayload(&ref_payload.base), + }); + } else { + return mod.fail( + scope, + fieldptr.positionals.field_name.src, + "no member named '{}' in '{}'", + .{ field_name, elem_ty }, + ); + } + }, + else => {}, + } + }, .Type => { _ = try mod.resolveConstValue(scope, object_ptr); const result = try mod.analyzeDeref(scope, fieldptr.base.src, object_ptr, object_ptr.src); @@ -940,8 +967,9 @@ fn analyzeInstFieldPtr(mod: *Module, scope: *Scope, fieldptr: *zir.Inst.FieldPtr else => return mod.fail(scope, fieldptr.base.src, "type '{}' does not support field access", .{child_type}), } }, - else => return mod.fail(scope, fieldptr.base.src, "type '{}' does not support field access", .{elem_ty}), + else => {}, } + return mod.fail(scope, fieldptr.base.src, "type '{}' does not support field access", .{elem_ty}); } fn analyzeInstIntCast(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerError!*Inst { From 5de9aac7491958806164f46c356fce983b1c8624 Mon Sep 17 00:00:00 2001 From: Vexu Date: Mon, 24 Aug 2020 16:24:23 +0300 Subject: [PATCH 51/55] stage2: error set types --- src-self-hosted/type.zig | 82 ++++++++++++++++++++++++++++++++++-- src-self-hosted/value.zig | 25 +++++++++-- src-self-hosted/zir.zig | 2 +- src-self-hosted/zir_sema.zig | 26 ++++++++---- 4 files changed, 118 insertions(+), 17 deletions(-) diff --git a/src-self-hosted/type.zig b/src-self-hosted/type.zig index 37f9f0c638..eb8fa2acd7 100644 --- a/src-self-hosted/type.zig +++ b/src-self-hosted/type.zig @@ -3,6 +3,7 @@ const Value = @import("value.zig").Value; const assert = std.debug.assert; const Allocator = std.mem.Allocator; const Target = std.Target; +const Module = @import("Module.zig"); /// This is the raw data, with no bookkeeping, no memory awareness, no de-duplication. /// It's important for this type to be small. @@ -52,7 +53,7 @@ pub const Type = extern union { .bool => return .Bool, .void => return .Void, .type => return .Type, - .anyerror => return .ErrorSet, + .error_set, .error_set_single, .anyerror => return .ErrorSet, .comptime_int => return .ComptimeInt, .comptime_float => return .ComptimeFloat, .noreturn => return .NoReturn, @@ -436,6 +437,8 @@ pub const Type = extern union { }; return Type{ .ptr_otherwise = &new_payload.base }; }, + .error_set => return self.copyPayloadShallow(allocator, Payload.ErrorSet), + .error_set_single => return self.copyPayloadShallow(allocator, Payload.ErrorSetSingle), } } @@ -657,6 +660,14 @@ pub const Type = extern union { ty = payload.payload; continue; }, + .error_set => { + const payload = @fieldParentPtr(Payload.ErrorSet, "base", ty.ptr_otherwise); + return out_stream.writeAll(std.mem.spanZ(payload.decl.name)); + }, + .error_set_single => { + const payload = @fieldParentPtr(Payload.ErrorSetSingle, "base", ty.ptr_otherwise); + return out_stream.print("error{{{}}}", .{payload.name}); + }, } unreachable; } @@ -753,6 +764,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => true, // TODO lazy types .array => self.elemType().hasCodeGenBits() and self.arrayLen() != 0, @@ -848,7 +861,11 @@ pub const Type = extern union { .f128 => return 16, .c_longdouble => return 16, - .anyerror_void_error_union, .anyerror => return 2, // TODO revisit this when we have the concept of the error tag type + .error_set, + .error_set_single, + .anyerror_void_error_union, + .anyerror, + => return 2, // TODO revisit this when we have the concept of the error tag type .array, .array_sentinel => return self.elemType().abiAlignment(target), @@ -981,7 +998,11 @@ pub const Type = extern union { .f128 => return 16, .c_longdouble => return 16, - .anyerror_void_error_union, .anyerror => return 2, // TODO revisit this when we have the concept of the error tag type + .error_set, + .error_set_single, + .anyerror_void_error_union, + .anyerror, + => return 2, // TODO revisit this when we have the concept of the error tag type .int_signed, .int_unsigned => { const bits: u16 = if (self.cast(Payload.IntSigned)) |pl| @@ -1084,6 +1105,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .single_const_pointer, @@ -1156,6 +1179,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .const_slice, @@ -1225,6 +1250,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .single_const_pointer, @@ -1303,6 +1330,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .pointer => { @@ -1418,6 +1447,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, .array => self.cast(Payload.Array).?.elem_type, @@ -1543,6 +1574,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, .array => self.cast(Payload.Array).?.len, @@ -1614,6 +1647,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, .array, .array_u8 => return null, @@ -1683,6 +1718,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .int_signed, @@ -1755,6 +1792,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .int_unsigned, @@ -1817,6 +1856,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, .int_unsigned => .{ .signed = false, .bits = self.cast(Payload.IntUnsigned).?.bits }, @@ -1897,6 +1938,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, .usize, @@ -2006,6 +2049,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, }; } @@ -2081,6 +2126,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, } } @@ -2155,6 +2202,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, } } @@ -2229,6 +2278,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, }; } @@ -2300,6 +2351,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, }; } @@ -2371,6 +2424,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => unreachable, }; } @@ -2442,6 +2497,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => false, }; } @@ -2497,6 +2554,8 @@ pub const Type = extern union { .anyframe_T, .@"anyframe", .error_union, + .error_set, + .error_set_single, => return null, .void => return Value.initTag(.void_value), @@ -2604,6 +2663,8 @@ pub const Type = extern union { .@"anyframe", .anyframe_T, .anyerror_void_error_union, + .error_set, + .error_set_single, => return false, .c_const_pointer, @@ -2687,6 +2748,8 @@ pub const Type = extern union { optional_single_const_pointer, error_union, anyframe_T, + error_set, + error_set_single, pub const last_no_payload_tag = Tag.const_slice_u8; pub const no_payload_count = @enumToInt(last_no_payload_tag) + 1; @@ -2781,6 +2844,19 @@ pub const Type = extern union { return_type: Type, }; + + pub const ErrorSet = struct { + base: Payload = .{ .tag = .error_set }, + + decl: *Module.Decl, + }; + + pub const ErrorSetSingle = struct { + base: Payload = .{ .tag = .error_set_single }, + + /// memory is owned by `Module` + name: []const u8, + }; }; }; diff --git a/src-self-hosted/value.zig b/src-self-hosted/value.zig index eacbd4e9ab..f2e36b59a4 100644 --- a/src-self-hosted/value.zig +++ b/src-self-hosted/value.zig @@ -381,11 +381,9 @@ pub const Value = extern union { } /// Asserts that the value is representable as a type. - pub fn toType(self: Value) Type { + pub fn toType(self: Value, allocator: *Allocator) !Type { return switch (self.tag()) { .ty => self.cast(Payload.Ty).?.ty, - .int_type => @panic("TODO int type to type"), - .u8_type => Type.initTag(.u8), .i8_type => Type.initTag(.i8), .u16_type => Type.initTag(.u16), @@ -427,7 +425,25 @@ pub const Value = extern union { .const_slice_u8_type => Type.initTag(.const_slice_u8), .enum_literal_type => Type.initTag(.enum_literal), .anyframe_type => Type.initTag(.@"anyframe"), - .error_set => @panic("TODO error set to type"), + + .int_type => { + const payload = self.cast(Payload.IntType).?; + if (payload.signed) { + const new = try allocator.create(Type.Payload.IntSigned); + new.* = .{ .bits = payload.bits }; + return Type.initPayload(&new.base); + } else { + const new = try allocator.create(Type.Payload.IntUnsigned); + new.* = .{ .bits = payload.bits }; + return Type.initPayload(&new.base); + } + }, + .error_set => { + const payload = self.cast(Payload.ErrorSet).?; + const new = try allocator.create(Type.Payload.ErrorSet); + new.* = .{ .decl = payload.decl }; + return Type.initPayload(&new.base); + }, .undef, .zero, @@ -1579,6 +1595,7 @@ pub const Value = extern union { // TODO revisit this when we have the concept of the error tag type fields: std.StringHashMapUnmanaged(u16), + decl: *Module.Decl, }; pub const Error = struct { diff --git a/src-self-hosted/zir.zig b/src-self-hosted/zir.zig index 079dc13c35..3557c88f4e 100644 --- a/src-self-hosted/zir.zig +++ b/src-self-hosted/zir.zig @@ -2016,7 +2016,7 @@ const EmitZIR = struct { return self.emitUnnamedDecl(&as_inst.base); }, .Type => { - const ty = typed_value.val.toType(); + const ty = try typed_value.val.toType(&self.arena.allocator); return self.emitType(src, ty); }, .Fn => { diff --git a/src-self-hosted/zir_sema.zig b/src-self-hosted/zir_sema.zig index 85e6a764fb..7106bda090 100644 --- a/src-self-hosted/zir_sema.zig +++ b/src-self-hosted/zir_sema.zig @@ -150,7 +150,7 @@ pub fn analyzeBodyValueAsType(mod: *Module, block_scope: *Scope.Block, body: zir for (block_scope.instructions.items) |inst| { if (inst.castTag(.ret)) |ret| { const val = try mod.resolveConstValue(&block_scope.base, ret.operand); - return val.toType(); + return val.toType(block_scope.base.arena()); } else { return mod.fail(&block_scope.base, inst.src, "unable to resolve comptime value", .{}); } @@ -275,7 +275,7 @@ fn resolveType(mod: *Module, scope: *Scope, old_inst: *zir.Inst) !Type { const wanted_type = Type.initTag(.@"type"); const coerced_inst = try mod.coerce(scope, wanted_type, new_inst); const val = try mod.resolveConstValue(scope, coerced_inst); - return val.toType(); + return val.toType(scope.arena()); } fn resolveInt(mod: *Module, scope: *Scope, old_inst: *zir.Inst, dest_type: Type) !u64 { @@ -745,7 +745,10 @@ fn analyzeInstErrorSet(mod: *Module, scope: *Scope, inst: *zir.Inst.ErrorSet) In errdefer new_decl_arena.deinit(); const payload = try scope.arena().create(Value.Payload.ErrorSet); - payload.* = .{ .fields = .{} }; + payload.* = .{ + .fields = .{}, + .decl = undefined, // populated below + }; try payload.fields.ensureCapacity(&new_decl_arena.allocator, inst.positionals.fields.len); for (inst.positionals.fields) |field_name| { @@ -759,6 +762,7 @@ fn analyzeInstErrorSet(mod: *Module, scope: *Scope, inst: *zir.Inst.ErrorSet) In .ty = Type.initTag(.type), .val = Value.initPayload(&payload.base), }); + payload.decl = new_decl; return mod.analyzeDeclRef(scope, inst.base.src, new_decl); } @@ -939,18 +943,17 @@ fn analyzeInstFieldPtr(mod: *Module, scope: *Scope, fieldptr: *zir.Inst.FieldPtr _ = try mod.resolveConstValue(scope, object_ptr); const result = try mod.analyzeDeref(scope, fieldptr.base.src, object_ptr, object_ptr.src); const val = result.value().?; - const child_type = val.toType(); + const child_type = try val.toType(scope.arena()); switch (child_type.zigTypeTag()) { .ErrorSet => { // TODO resolve inferred error sets const entry = if (val.cast(Value.Payload.ErrorSet)) |payload| (payload.fields.getEntry(field_name) orelse return mod.fail(scope, fieldptr.base.src, "no error named '{}' in '{}'", .{ field_name, child_type })).* - else - try mod.getErrorValue(field_name); + else try mod.getErrorValue(field_name); const error_payload = try scope.arena().create(Value.Payload.Error); - error_payload.* = .{ + error_payload.* = .{ .name = entry.key, .value = entry.value, }; @@ -958,9 +961,14 @@ fn analyzeInstFieldPtr(mod: *Module, scope: *Scope, fieldptr: *zir.Inst.FieldPtr const ref_payload = try scope.arena().create(Value.Payload.RefVal); ref_payload.* = .{ .val = Value.initPayload(&error_payload.base) }; - // TODO if this is accessing the global error set create a `error{field_name}` type + const result_type = if (child_type.tag() == .anyerror) blk: { + const result_payload = try scope.arena().create(Type.Payload.ErrorSetSingle); + result_payload.* = .{ .name = entry.key }; + break :blk Type.initPayload(&result_payload.base); + } else child_type; + return mod.constInst(scope, fieldptr.base.src, .{ - .ty = try mod.simplePtrType(scope, fieldptr.base.src, child_type, false, .One), + .ty = try mod.simplePtrType(scope, fieldptr.base.src, result_type, false, .One), .val = Value.initPayload(&ref_payload.base), }); }, From 16d54c70eb35b58e871c538bf172991aa81191fe Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 24 Aug 2020 15:41:59 -0700 Subject: [PATCH 52/55] stage2: getErrorValue takes advantage of HashMap getOrPut API --- src-self-hosted/Module.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src-self-hosted/Module.zig b/src-self-hosted/Module.zig index f23e09d44c..82029c1e9f 100644 --- a/src-self-hosted/Module.zig +++ b/src-self-hosted/Module.zig @@ -2082,14 +2082,14 @@ fn createNewDecl( /// Get error value for error tag `name`. pub fn getErrorValue(self: *Module, name: []const u8) !std.StringHashMapUnmanaged(u16).Entry { - const new_val = @intCast(u16, self.global_error_set.items().len); - if (self.global_error_set.getEntry(name)) |some| return some.*; + const gop = try self.global_error_set.getOrPut(self.gpa, name); + if (gop.found_existing) + return gop.entry.*; + errdefer self.global_error_set.removeAssertDiscard(name); - const duped = try self.gpa.dupe(u8, name); - errdefer self.gpa.free(duped); - - try self.global_error_set.put(self.gpa, duped, new_val); - return self.global_error_set.getEntry(duped).?.*; + gop.entry.key = try self.gpa.dupe(u8, name); + gop.entry.value = @intCast(u16, self.global_error_set.items().len - 1); + return gop.entry.*; } /// TODO split this into `requireRuntimeBlock` and `requireFunctionBlock` and audit callsites. From 84d50c892d41850f666f05e05472c23ffabee434 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 24 Aug 2020 16:13:10 -0700 Subject: [PATCH 53/55] stage2: astgen: kill the "lvalue" ResultLoc tag --- src-self-hosted/astgen.zig | 276 ++++++++++++++++++------------------- 1 file changed, 137 insertions(+), 139 deletions(-) diff --git a/src-self-hosted/astgen.zig b/src-self-hosted/astgen.zig index cd5639d791..0d8e0dc874 100644 --- a/src-self-hosted/astgen.zig +++ b/src-self-hosted/astgen.zig @@ -18,9 +18,7 @@ pub const ResultLoc = union(enum) { /// The expression has an inferred type, and it will be evaluated as an rvalue. none, /// The expression must generate a pointer rather than a value. For example, the left hand side - /// of an assignment uses an "LValue" result location. - lvalue, - /// The expression must generate a pointer + /// of an assignment uses this kind of result location. ref, /// The expression will be type coerced into this type, but it will be evaluated as an rvalue. ty: *zir.Inst, @@ -46,134 +44,136 @@ pub fn typeExpr(mod: *Module, scope: *Scope, type_node: *ast.Node) InnerError!*z return expr(mod, scope, type_rl, type_node); } +fn lvalExpr(mod: *Module, scope: *Scope, node: *ast.Node) InnerError!*zir.Inst { + switch (node.tag) { + .Root => unreachable, + .Use => unreachable, + .TestDecl => unreachable, + .DocComment => unreachable, + .VarDecl => unreachable, + .SwitchCase => unreachable, + .SwitchElse => unreachable, + .Else => unreachable, + .Payload => unreachable, + .PointerPayload => unreachable, + .PointerIndexPayload => unreachable, + .ErrorTag => unreachable, + .FieldInitializer => unreachable, + .ContainerField => unreachable, + + .Assign, + .AssignBitAnd, + .AssignBitOr, + .AssignBitShiftLeft, + .AssignBitShiftRight, + .AssignBitXor, + .AssignDiv, + .AssignSub, + .AssignSubWrap, + .AssignMod, + .AssignAdd, + .AssignAddWrap, + .AssignMul, + .AssignMulWrap, + .Add, + .AddWrap, + .Sub, + .SubWrap, + .Mul, + .MulWrap, + .Div, + .Mod, + .BitAnd, + .BitOr, + .BitShiftLeft, + .BitShiftRight, + .BitXor, + .BangEqual, + .EqualEqual, + .GreaterThan, + .GreaterOrEqual, + .LessThan, + .LessOrEqual, + .ArrayCat, + .ArrayMult, + .BoolAnd, + .BoolOr, + .Asm, + .StringLiteral, + .IntegerLiteral, + .Call, + .Unreachable, + .Return, + .If, + .While, + .BoolNot, + .AddressOf, + .FloatLiteral, + .UndefinedLiteral, + .BoolLiteral, + .NullLiteral, + .OptionalType, + .Block, + .LabeledBlock, + .Break, + .PtrType, + .GroupedExpression, + .ArrayType, + .ArrayTypeSentinel, + .EnumLiteral, + .MultilineStringLiteral, + .CharLiteral, + .Defer, + .Catch, + .ErrorUnion, + .MergeErrorSets, + .Range, + .OrElse, + .Await, + .BitNot, + .Negation, + .NegationWrap, + .Resume, + .Try, + .SliceType, + .Slice, + .ArrayInitializer, + .ArrayInitializerDot, + .StructInitializer, + .StructInitializerDot, + .Switch, + .For, + .Suspend, + .Continue, + .AnyType, + .ErrorType, + .FnProto, + .AnyFrameType, + .ErrorSetDecl, + .ContainerDecl, + .Comptime, + .Nosuspend, + => return mod.failNode(scope, node, "invalid left-hand side to assignment", .{}), + + // @field can be assigned to + .BuiltinCall => { + const call = node.castTag(.BuiltinCall).?; + const tree = scope.tree(); + const builtin_name = tree.tokenSlice(call.builtin_token); + + if (!mem.eql(u8, builtin_name, "@field")) { + return mod.failNode(scope, node, "invalid left-hand side to assignment", .{}); + } + }, + + // can be assigned to + .UnwrapOptional, .Deref, .Period, .ArrayAccess, .Identifier => {}, + } + return expr(mod, scope, .ref, node); +} + /// Turn Zig AST into untyped ZIR istructions. pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node) InnerError!*zir.Inst { - if (rl == .lvalue) { - switch (node.tag) { - .Root => unreachable, - .Use => unreachable, - .TestDecl => unreachable, - .DocComment => unreachable, - .VarDecl => unreachable, - .SwitchCase => unreachable, - .SwitchElse => unreachable, - .Else => unreachable, - .Payload => unreachable, - .PointerPayload => unreachable, - .PointerIndexPayload => unreachable, - .ErrorTag => unreachable, - .FieldInitializer => unreachable, - .ContainerField => unreachable, - - .Assign, - .AssignBitAnd, - .AssignBitOr, - .AssignBitShiftLeft, - .AssignBitShiftRight, - .AssignBitXor, - .AssignDiv, - .AssignSub, - .AssignSubWrap, - .AssignMod, - .AssignAdd, - .AssignAddWrap, - .AssignMul, - .AssignMulWrap, - .Add, - .AddWrap, - .Sub, - .SubWrap, - .Mul, - .MulWrap, - .Div, - .Mod, - .BitAnd, - .BitOr, - .BitShiftLeft, - .BitShiftRight, - .BitXor, - .BangEqual, - .EqualEqual, - .GreaterThan, - .GreaterOrEqual, - .LessThan, - .LessOrEqual, - .ArrayCat, - .ArrayMult, - .BoolAnd, - .BoolOr, - .Asm, - .StringLiteral, - .IntegerLiteral, - .Call, - .Unreachable, - .Return, - .If, - .While, - .BoolNot, - .AddressOf, - .FloatLiteral, - .UndefinedLiteral, - .BoolLiteral, - .NullLiteral, - .OptionalType, - .Block, - .LabeledBlock, - .Break, - .PtrType, - .GroupedExpression, - .ArrayType, - .ArrayTypeSentinel, - .EnumLiteral, - .MultilineStringLiteral, - .CharLiteral, - .Defer, - .Catch, - .ErrorUnion, - .MergeErrorSets, - .Range, - .OrElse, - .Await, - .BitNot, - .Negation, - .NegationWrap, - .Resume, - .Try, - .SliceType, - .Slice, - .ArrayInitializer, - .ArrayInitializerDot, - .StructInitializer, - .StructInitializerDot, - .Switch, - .For, - .Suspend, - .Continue, - .AnyType, - .ErrorType, - .FnProto, - .AnyFrameType, - .ErrorSetDecl, - .ContainerDecl, - .Comptime, - .Nosuspend, - => return mod.failNode(scope, node, "invalid left-hand side to assignment", .{}), - - // @field can be assigned to - .BuiltinCall => { - const call = node.castTag(.BuiltinCall).?; - const tree = scope.tree(); - const builtin_name = tree.tokenSlice(call.builtin_token); - - if (!mem.eql(u8, builtin_name, "@field")) { - return mod.failNode(scope, node, "invalid left-hand side to assignment", .{}); - } - }, - - // can be assigned to - .UnwrapOptional, .Deref, .Period, .ArrayAccess, .Identifier => {}, - } - } switch (node.tag) { .Root => unreachable, // Top-level declaration. .Use => unreachable, // Top-level declaration. @@ -317,7 +317,7 @@ fn breakExpr(mod: *Module, parent_scope: *Scope, node: *ast.Node.ControlFlowExpr // proper type inference requires peer type resolution on the block's // break operand expressions. const branch_rl: ResultLoc = switch (label.result_loc) { - .discard, .none, .ty, .ptr, .lvalue, .ref => label.result_loc, + .discard, .none, .ty, .ptr, .ref => label.result_loc, .inferred_ptr, .bitcasted_ptr, .block_ptr => .{ .block_ptr = label.block_inst }, }; const operand = try expr(mod, parent_scope, branch_rl, rhs); @@ -524,7 +524,7 @@ fn assign(mod: *Module, scope: *Scope, infix_node: *ast.Node.SimpleInfixOp) Inne return; } } - const lvalue = try expr(mod, scope, .lvalue, infix_node.lhs); + const lvalue = try lvalExpr(mod, scope, infix_node.lhs); _ = try expr(mod, scope, .{ .ptr = lvalue }, infix_node.rhs); } @@ -534,7 +534,7 @@ fn assignOp( infix_node: *ast.Node.SimpleInfixOp, op_inst_tag: zir.Inst.Tag, ) InnerError!void { - const lhs_ptr = try expr(mod, scope, .lvalue, infix_node.lhs); + const lhs_ptr = try lvalExpr(mod, scope, infix_node.lhs); const lhs = try addZIRUnOp(mod, scope, lhs_ptr.src, .deref, lhs_ptr); const lhs_type = try addZIRUnOp(mod, scope, lhs_ptr.src, .typeof, lhs); const rhs = try expr(mod, scope, .{ .ty = lhs_type }, infix_node.rhs); @@ -794,7 +794,7 @@ fn field(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node.SimpleInfix const field_name = try identifierStringInst(mod, scope, node.rhs.castTag(.Identifier).?); const pointer = try addZIRInst(mod, scope, src, zir.Inst.FieldPtr, .{ .object_ptr = lhs, .field_name = field_name }, .{}); - if (rl == .ref or rl == .lvalue) return pointer; + if (rl == .ref) return pointer; return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, src, .deref, pointer)); } @@ -1020,7 +1020,7 @@ fn ifExpr(mod: *Module, scope: *Scope, rl: ResultLoc, if_node: *ast.Node.If) Inn // proper type inference requires peer type resolution on the if's // branches. const branch_rl: ResultLoc = switch (rl) { - .discard, .none, .ty, .ptr, .lvalue, .ref => rl, + .discard, .none, .ty, .ptr, .ref => rl, .inferred_ptr, .bitcasted_ptr, .block_ptr => .{ .block_ptr = block }, }; @@ -1150,7 +1150,7 @@ fn whileExpr(mod: *Module, scope: *Scope, rl: ResultLoc, while_node: *ast.Node.W // proper type inference requires peer type resolution on the while's // branches. const branch_rl: ResultLoc = switch (rl) { - .discard, .none, .ty, .ptr, .lvalue, .ref => rl, + .discard, .none, .ty, .ptr, .ref => rl, .inferred_ptr, .bitcasted_ptr, .block_ptr => .{ .block_ptr = while_block }, }; @@ -1535,7 +1535,6 @@ fn as(mod: *Module, scope: *Scope, rl: ResultLoc, call: *ast.Node.BuiltinCall) I _ = try addZIRUnOp(mod, scope, result.src, .ensure_result_non_error, result); return result; }, - .lvalue => unreachable, .ref => { const result = try expr(mod, scope, .{ .ty = dest_type }, params[1]); return addZIRUnOp(mod, scope, result.src, .ref, result); @@ -1583,7 +1582,6 @@ fn bitCast(mod: *Module, scope: *Scope, rl: ResultLoc, call: *ast.Node.BuiltinCa _ = try addZIRUnOp(mod, scope, result.src, .ensure_result_non_error, result); return result; }, - .lvalue => unreachable, .ref => { const operand = try expr(mod, scope, .ref, params[1]); const result = try addZIRBinOp(mod, scope, src, .bitcast_ref, dest_type, operand); @@ -1851,7 +1849,7 @@ fn rlWrap(mod: *Module, scope: *Scope, rl: ResultLoc, result: *zir.Inst) InnerEr _ = try addZIRUnOp(mod, scope, result.src, .ensure_result_non_error, result); return result; }, - .lvalue, .ref => { + .ref => { // We need a pointer but we have a value. return addZIRUnOp(mod, scope, result.src, .ref, result); }, @@ -1886,7 +1884,7 @@ fn rlWrapVoid(mod: *Module, scope: *Scope, rl: ResultLoc, node: *ast.Node, resul } fn rlWrapPtr(mod: *Module, scope: *Scope, rl: ResultLoc, ptr: *zir.Inst) InnerError!*zir.Inst { - if (rl == .lvalue or rl == .ref) return ptr; + if (rl == .ref) return ptr; return rlWrap(mod, scope, rl, try addZIRUnOp(mod, scope, ptr.src, .deref, ptr)); } From ea6a076065efb6de5450d945540f825523d5d6e3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 25 Aug 2020 13:36:15 -0700 Subject: [PATCH 54/55] stage2: fix use-after-free in elf linker code --- src-self-hosted/link/Elf.zig | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index eeb0289b05..1d18344cbb 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -1348,6 +1348,7 @@ fn freeTextBlock(self: *Elf, text_block: *TextBlock) void { var already_have_free_list_node = false; { var i: usize = 0; + // TODO turn text_block_free_list into a hash map while (i < self.text_block_free_list.items.len) { if (self.text_block_free_list.items[i] == text_block) { _ = self.text_block_free_list.swapRemove(i); @@ -1359,11 +1360,19 @@ fn freeTextBlock(self: *Elf, text_block: *TextBlock) void { i += 1; } } + // TODO process free list for dbg info just like we do above for vaddrs if (self.last_text_block == text_block) { // TODO shrink the .text section size here self.last_text_block = text_block.prev; } + if (self.dbg_info_decl_first == text_block) { + self.dbg_info_decl_first = text_block.dbg_info_next; + } + if (self.dbg_info_decl_last == text_block) { + // TODO shrink the .debug_info section size here + self.dbg_info_decl_last = text_block.dbg_info_prev; + } if (text_block.prev) |prev| { prev.next = text_block.next; @@ -1382,6 +1391,20 @@ fn freeTextBlock(self: *Elf, text_block: *TextBlock) void { } else { text_block.next = null; } + + if (text_block.dbg_info_prev) |prev| { + prev.dbg_info_next = text_block.dbg_info_next; + + // TODO the free list logic like we do for text blocks above + } else { + text_block.dbg_info_prev = null; + } + + if (text_block.dbg_info_next) |next| { + next.dbg_info_prev = text_block.dbg_info_prev; + } else { + text_block.dbg_info_next = null; + } } fn shrinkTextBlock(self: *Elf, text_block: *TextBlock, new_block_size: u64) void { @@ -1583,10 +1606,10 @@ pub fn freeDecl(self: *Elf, decl: *Module.Decl) void { next.prev = null; } if (self.dbg_line_fn_first == &decl.fn_link.elf) { - self.dbg_line_fn_first = null; + self.dbg_line_fn_first = decl.fn_link.elf.next; } if (self.dbg_line_fn_last == &decl.fn_link.elf) { - self.dbg_line_fn_last = null; + self.dbg_line_fn_last = decl.fn_link.elf.prev; } } From 6fb105fdd7798dc988de09a7b6709c5168355dfa Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 25 Aug 2020 13:36:40 -0700 Subject: [PATCH 55/55] std: GeneralPurposeAllocator: set freed bytes to undefined Helps catch use-after-free. Caught a couple issues in the self-hosted compiler. --- lib/std/heap/general_purpose_allocator.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/std/heap/general_purpose_allocator.zig b/lib/std/heap/general_purpose_allocator.zig index 5d8de5845d..ba710059aa 100644 --- a/lib/std/heap/general_purpose_allocator.zig +++ b/lib/std/heap/general_purpose_allocator.zig @@ -433,8 +433,7 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type { const bucket_slice = @ptrCast([*]align(@alignOf(BucketHeader)) u8, bucket)[0..bucket_size]; self.backing_allocator.free(bucket_slice); } else { - // TODO Set the slot data to undefined. - // Related: https://github.com/ziglang/zig/issues/4298 + @memset(bucket.page + slot_index * size_class, undefined, size_class); } } @@ -567,6 +566,9 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type { const new_aligned_size = math.max(new_size, old_align); const new_size_class = math.ceilPowerOfTwoAssert(usize, new_aligned_size); if (new_size_class <= size_class) { + if (old_mem.len > new_size) { + @memset(old_mem.ptr + new_size, undefined, old_mem.len - new_size); + } return new_size; } return error.OutOfMemory;