From 6849331bbc144253c00482235d31ce2088e1f2c0 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 27 Dec 2020 04:00:28 +0100 Subject: [PATCH] Avoid using .type with clang This is probably a more accurate fix than just for macOS. --- src/arch/amd64/crti.S | 4 ++++ src/arch/i386/crti.S | 4 ++-- src/arch/i386/gdt.S | 2 +- src/arch/i386/idt.S | 2 +- src/arch/i386/intr.S | 4 ++-- src/arch/i386/ioport.S | 6 +++--- src/arch/i386/kernel.S | 2 +- src/arch/i386/loader.S | 2 +- src/arch/i386/multiboot.S | 4 ++-- src/arch/i386/multiboot/header.S | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/arch/amd64/crti.S b/src/arch/amd64/crti.S index 78f5791..0d9f084 100644 --- a/src/arch/amd64/crti.S +++ b/src/arch/amd64/crti.S @@ -9,7 +9,9 @@ /* init */ .section .init .global _init +#ifndef __clang__ .type _init, @function +#endif _init: push %rbp mov %rsp, %rbp @@ -18,7 +20,9 @@ _init: /* fini */ .section .fini .global _fini +#ifndef __clang__ .type _fini, @function +#endif _fini: push %rbp mov %rsp, %rbp diff --git a/src/arch/i386/crti.S b/src/arch/i386/crti.S index 94e003d..c40b5ee 100644 --- a/src/arch/i386/crti.S +++ b/src/arch/i386/crti.S @@ -9,7 +9,7 @@ /* init */ .section .init .global _init -#ifndef __APPLE__ +#ifndef __clang__ .type _init, @function #endif _init: @@ -20,7 +20,7 @@ _init: /* fini */ .section .fini .global _fini -#ifndef __APPLE__ +#ifndef __clang__ .type _fini, @function #endif _fini: diff --git a/src/arch/i386/gdt.S b/src/arch/i386/gdt.S index d0fb555..8f4ed61 100644 --- a/src/arch/i386/gdt.S +++ b/src/arch/i386/gdt.S @@ -9,7 +9,7 @@ .section .text /* arch_setgdt */ .global __arch_setgdt -#ifndef __APPLE__ +#ifndef __clang__ .type __arch_setgdt, @function #endif __arch_setgdt: diff --git a/src/arch/i386/idt.S b/src/arch/i386/idt.S index 61ae3d8..ed00656 100644 --- a/src/arch/i386/idt.S +++ b/src/arch/i386/idt.S @@ -9,7 +9,7 @@ .section .text /* arch_setidt */ .global __arch_setidt -#ifndef __APPLE__ +#ifndef __clang__ .type __arch_setidt, @function #endif __arch_setidt: diff --git a/src/arch/i386/intr.S b/src/arch/i386/intr.S index 801a47b..8ad2342 100644 --- a/src/arch/i386/intr.S +++ b/src/arch/i386/intr.S @@ -8,7 +8,7 @@ /* text */ .section .text .global intr_disable -#ifndef __APPLE__ +#ifndef __clang__ .type intr_disable, @function #endif intr_disable: @@ -18,7 +18,7 @@ intr_disable: /* intr_enable */ .global intr_enable -#ifndef __APPLE__ +#ifndef __clang__ .type intr_enable, @function #endif intr_enable: diff --git a/src/arch/i386/ioport.S b/src/arch/i386/ioport.S index fc5e401..b9593ed 100644 --- a/src/arch/i386/ioport.S +++ b/src/arch/i386/ioport.S @@ -8,7 +8,7 @@ .section .text /* inb */ .global inb -#ifndef __APPLE__ +#ifndef __clang__ .type inb, @function #endif inb: @@ -24,7 +24,7 @@ inb: /* iowait */ .global iowait -#ifndef __APPLE__ +#ifndef __clang__ .type iowait, @function #endif iowait: @@ -37,7 +37,7 @@ iowait: /* outb */ .global outb -#ifndef __APPLE__ +#ifndef __clang__ .type outb, @function #endif outb: diff --git a/src/arch/i386/kernel.S b/src/arch/i386/kernel.S index 3eac922..3c8c9d3 100644 --- a/src/arch/i386/kernel.S +++ b/src/arch/i386/kernel.S @@ -33,7 +33,7 @@ stack_top: .section .text /* start */ .global _start -#ifndef __APPLE__ +#ifndef __clang__ .type _start, @function #endif _start: diff --git a/src/arch/i386/loader.S b/src/arch/i386/loader.S index b399649..eb0752e 100644 --- a/src/arch/i386/loader.S +++ b/src/arch/i386/loader.S @@ -33,7 +33,7 @@ stack_top: .section .text /* start */ .global _start -#ifndef __APPLE__ +#ifndef __clang__ .type _start, @function #endif _start: diff --git a/src/arch/i386/multiboot.S b/src/arch/i386/multiboot.S index b1171b9..588e237 100644 --- a/src/arch/i386/multiboot.S +++ b/src/arch/i386/multiboot.S @@ -25,7 +25,7 @@ .section .text /* multiboot_boot_kernel32 */ .global multiboot_boot_kernel32 -#ifndef __APPLE__ +#ifndef __clang__ .type multiboot_boot_kernel32, @function #endif multiboot_boot_kernel32: @@ -43,7 +43,7 @@ multiboot_boot_kernel32: .global multiboot_boot_kernel64 -#ifndef __APPLE__ +#ifndef __clang__ .type multiboot_boot_kernel64, @function #endif multiboot_boot_kernel64: diff --git a/src/arch/i386/multiboot/header.S b/src/arch/i386/multiboot/header.S index 9db0e8b..c8dd051 100644 --- a/src/arch/i386/multiboot/header.S +++ b/src/arch/i386/multiboot/header.S @@ -50,7 +50,7 @@ multiboot_header: .section .text /* multiboot_start */ .global _multiboot_start -# ifndef __APPLE__ +# ifndef __clang__ .type _multiboot_start, @function # endif _multiboot_start: