Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 487788 Details for
Bug 626952
sys-boot/syslinux-6.04_pre1-r5 won't compile on musl: wrapper.h:30:2: error: unknown type name ‘__uint16_t’
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed
syslinux.patch (text/plain), 8.44 KB, created by
Felix Janda
on 2017-08-03 10:57:21 UTC
(
hide
)
Description:
proposed
Filename:
MIME Type:
Creator:
Felix Janda
Created:
2017-08-03 10:57:21 UTC
Size:
8.44 KB
patch
obsolete
>diff --git a/efi/wrapper.c b/efi/wrapper.c >index 19881248..d8bdba5b 100644 >--- a/efi/wrapper.c >+++ b/efi/wrapper.c >@@ -17,6 +17,7 @@ > #include <linux/elf.h> > #include <sys/types.h> > #include <sys/stat.h> >+#include <stdint.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> >@@ -43,8 +44,8 @@ typedef Elf64_Addr Elf_Addr; > * For 64bit machines (class == ELFCLASS64), the optional > * header includes PE32+header fields > */ >-static void write_header(FILE *f, __uint32_t entry, size_t data_size, >- __uint32_t so_memsz, __uint8_t class) >+static void write_header(FILE *f, uint32_t entry, size_t data_size, >+ uint32_t so_memsz, uint8_t class) > { > struct optional_hdr o_hdr; > struct optional_hdr_pe32p o_hdr_pe32p; >@@ -53,9 +54,9 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, > struct extra_hdr_pe32p e_hdr_pe32p; > struct coff_hdr c_hdr; > struct header hdr; >- __uint32_t total_sz = data_size; >- __uint32_t hdr_sz; >- __uint32_t reloc_start, reloc_end; >+ uint32_t total_sz = data_size; >+ uint32_t hdr_sz; >+ uint32_t reloc_start, reloc_end; > > /* > * The header size have to be a multiple of file_align, which currently >@@ -103,7 +104,7 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, > e_hdr.image_sz = hdr_sz + so_memsz; > e_hdr.headers_sz = hdr_sz; > e_hdr.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION; >- e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(__uint64_t); >+ e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(uint64_t); > fwrite(&e_hdr, sizeof(e_hdr), 1, f); > } > else if (class == ELFCLASS64) { >@@ -126,7 +127,7 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, > e_hdr_pe32p.image_sz = hdr_sz + so_memsz; > e_hdr_pe32p.headers_sz = hdr_sz; > e_hdr_pe32p.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION; >- e_hdr_pe32p.rva_and_sizes_nr = sizeof(e_hdr_pe32p.data_directory) / sizeof(__uint64_t); >+ e_hdr_pe32p.rva_and_sizes_nr = sizeof(e_hdr_pe32p.data_directory) / sizeof(uint64_t); > fwrite(&e_hdr_pe32p, sizeof(e_hdr_pe32p), 1, f); > } > >@@ -163,10 +164,10 @@ int main(int argc, char **argv) > { > Elf32_Ehdr e32_hdr; > Elf64_Ehdr e64_hdr; >- __uint32_t entry; >- __uint8_t class; >- __uint64_t phoff = 0; >- __uint16_t phnum = 0, phentsize = 0; >+ uint32_t entry; >+ uint8_t class; >+ uint64_t phoff = 0; >+ uint16_t phnum = 0, phentsize = 0; > unsigned char *id; > FILE *f_in, *f_out; > void *buf; >diff --git a/efi/wrapper.h b/efi/wrapper.h >index 0e6b38ea..bc1c64e3 100644 >--- a/efi/wrapper.h >+++ b/efi/wrapper.h >@@ -27,13 +27,13 @@ > #define OFFSETOF(t,m) ((size_t)&((t *)0)->m) > > struct header { >- __uint16_t msdos_signature; >- __uint8_t _pad1[0x16]; >- __uint16_t relocs_ptr; >- __uint8_t __pad2[0x3c - 0x1a]; >- __uint32_t pe_hdr; >- __uint16_t pe_signature; >- __uint16_t _pad2; >+ uint16_t msdos_signature; >+ uint8_t _pad1[0x16]; >+ uint16_t relocs_ptr; >+ uint8_t __pad2[0x3c - 0x1a]; >+ uint32_t pe_hdr; >+ uint16_t pe_signature; >+ uint16_t _pad2; > } __packed; > > /* FIXME: when setting up coff_hdr, set up optional_hdr_sz >@@ -43,72 +43,72 @@ struct header { > * COFF header > */ > struct coff_hdr { >- __uint16_t arch; >- __uint16_t nr_sections; >- __uint32_t timedatestamp; >- __uint32_t symtab; >- __uint32_t nr_syms; >- __uint16_t optional_hdr_sz; >- __uint16_t characteristics; >+ uint16_t arch; >+ uint16_t nr_sections; >+ uint32_t timedatestamp; >+ uint32_t symtab; >+ uint32_t nr_syms; >+ uint16_t optional_hdr_sz; >+ uint16_t characteristics; > } __packed; > > struct optional_hdr { >- __uint16_t format; >- __uint8_t major_linker_version; >- __uint8_t minor_linker_version; >- __uint32_t code_sz; >- __uint32_t initialized_data_sz; >- __uint32_t uninitialized_data_sz; >- __uint32_t entry_point; >- __uint32_t base_code; >- __uint32_t data; >+ uint16_t format; >+ uint8_t major_linker_version; >+ uint8_t minor_linker_version; >+ uint32_t code_sz; >+ uint32_t initialized_data_sz; >+ uint32_t uninitialized_data_sz; >+ uint32_t entry_point; >+ uint32_t base_code; >+ uint32_t data; > } __packed; > > /* For PE32+, the optional_header does NOT have > * data after base_code > */ > struct optional_hdr_pe32p { >- __uint16_t format; >- __uint8_t major_linker_version; >- __uint8_t minor_linker_version; >- __uint32_t code_sz; >- __uint32_t initialized_data_sz; >- __uint32_t uninitialized_data_sz; >- __uint32_t entry_point; >- __uint32_t base_code; >+ uint16_t format; >+ uint8_t major_linker_version; >+ uint8_t minor_linker_version; >+ uint32_t code_sz; >+ uint32_t initialized_data_sz; >+ uint32_t uninitialized_data_sz; >+ uint32_t entry_point; >+ uint32_t base_code; > } __packed; > /* > * Extra header fields > */ > struct extra_hdr { >- __uint32_t image_base; >- __uint32_t section_align; >- __uint32_t file_align; >- __uint16_t major_os_version; >- __uint16_t minor_os_version; >- __uint16_t major_image_version; >- __uint16_t minor_image_version; >- __uint16_t major_subsystem_version; >- __uint16_t minor_subsystem_version; >- __uint32_t win32_version; >- __uint32_t image_sz; >- __uint32_t headers_sz; >- __uint32_t checksum; >- __uint16_t subsystem; >- __uint16_t dll_characteristics; >- __uint32_t stack_reserve_sz; >- __uint32_t stack_commit_sz; >- __uint32_t heap_reserve_sz; >- __uint32_t heap_commit_sz; >- __uint32_t loader_flags; >- __uint32_t rva_and_sizes_nr; >+ uint32_t image_base; >+ uint32_t section_align; >+ uint32_t file_align; >+ uint16_t major_os_version; >+ uint16_t minor_os_version; >+ uint16_t major_image_version; >+ uint16_t minor_image_version; >+ uint16_t major_subsystem_version; >+ uint16_t minor_subsystem_version; >+ uint32_t win32_version; >+ uint32_t image_sz; >+ uint32_t headers_sz; >+ uint32_t checksum; >+ uint16_t subsystem; >+ uint16_t dll_characteristics; >+ uint32_t stack_reserve_sz; >+ uint32_t stack_commit_sz; >+ uint32_t heap_reserve_sz; >+ uint32_t heap_commit_sz; >+ uint32_t loader_flags; >+ uint32_t rva_and_sizes_nr; > struct { >- __uint64_t export_table; >- __uint64_t import_table; >- __uint64_t resource_table; >- __uint64_t exception_table; >- __uint64_t certification_table; >- __uint64_t base_relocation_table; >+ uint64_t export_table; >+ uint64_t import_table; >+ uint64_t resource_table; >+ uint64_t exception_table; >+ uint64_t certification_table; >+ uint64_t base_relocation_table; > } data_directory; > } __packed; > >@@ -117,54 +117,54 @@ struct extra_hdr { > */ > > struct extra_hdr_pe32p { >- __uint64_t image_base; >- __uint32_t section_align; >- __uint32_t file_align; >- __uint16_t major_os_version; >- __uint16_t minor_os_version; >- __uint16_t major_image_version; >- __uint16_t minor_image_version; >- __uint16_t major_subsystem_version; >- __uint16_t minor_subsystem_version; >- __uint32_t win32_version; >- __uint32_t image_sz; >- __uint32_t headers_sz; >- __uint32_t checksum; >- __uint16_t subsystem; >- __uint16_t dll_characteristics; >- __uint64_t stack_reserve_sz; >- __uint64_t stack_commit_sz; >- __uint64_t heap_reserve_sz; >- __uint64_t heap_commit_sz; >- __uint32_t loader_flags; >- __uint32_t rva_and_sizes_nr; >+ uint64_t image_base; >+ uint32_t section_align; >+ uint32_t file_align; >+ uint16_t major_os_version; >+ uint16_t minor_os_version; >+ uint16_t major_image_version; >+ uint16_t minor_image_version; >+ uint16_t major_subsystem_version; >+ uint16_t minor_subsystem_version; >+ uint32_t win32_version; >+ uint32_t image_sz; >+ uint32_t headers_sz; >+ uint32_t checksum; >+ uint16_t subsystem; >+ uint16_t dll_characteristics; >+ uint64_t stack_reserve_sz; >+ uint64_t stack_commit_sz; >+ uint64_t heap_reserve_sz; >+ uint64_t heap_commit_sz; >+ uint32_t loader_flags; >+ uint32_t rva_and_sizes_nr; > struct { >- __uint64_t export_table; >- __uint64_t import_table; >- __uint64_t resource_table; >- __uint64_t exception_table; >- __uint64_t certification_table; >- __uint64_t base_relocation_table; >+ uint64_t export_table; >+ uint64_t import_table; >+ uint64_t resource_table; >+ uint64_t exception_table; >+ uint64_t certification_table; >+ uint64_t base_relocation_table; > } data_directory; > } __packed; > > struct section { >- __uint8_t name[8]; >- __uint32_t virtual_sz; >- __uint32_t virtual_address; >- __uint32_t raw_data_sz; >- __uint32_t raw_data; >- __uint32_t relocs; >- __uint32_t line_numbers; >- __uint16_t relocs_nr; >- __uint16_t line_numbers_nr; >- __uint32_t characteristics; >+ uint8_t name[8]; >+ uint32_t virtual_sz; >+ uint32_t virtual_address; >+ uint32_t raw_data_sz; >+ uint32_t raw_data; >+ uint32_t relocs; >+ uint32_t line_numbers; >+ uint16_t relocs_nr; >+ uint16_t line_numbers_nr; >+ uint32_t characteristics; > } __packed; > > struct coff_reloc { >- __uint32_t virtual_address; >- __uint32_t symtab_index; >- __uint16_t type; >+ uint32_t virtual_address; >+ uint32_t symtab_index; >+ uint16_t type; > }; > > #endif /* EFI_WRAPPER_H */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 626952
:
487776
| 487788 |
487790
|
487792