Skip to content

Commit 45cf4dc

Browse files
committed
picocrt: Adapt x86 crt0 code for old clang assembler
Before clang-12, the built-in x86 assembler seems to treat prefixes as separate instructions. This meant that it wouldn't allow them on the same source line as the rest of the instruction. Split out the 'cs' prefix used in the x86 crt0 code to a separate line so that old clang versions can also assemble the code. Signed-off-by: Keith Packard <[email protected]>
1 parent de31e5a commit 45cf4dc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

picocrt/machine/x86/crt0-32.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
.type start, @function
4646
_start:
4747
.code16
48-
cs lgdtl gdt_desc - _start + 0x10
48+
cs
49+
lgdtl gdt_desc - _start + 0x10
4950
mov $1, %eax
5051
mov %eax, %cr0
5152
ljmpl $0x10,$_start32

picocrt/machine/x86/crt0-64.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
.type start, @function
4646
_start:
4747
.code16
48-
cs lgdtl gdt_desc - _start + 0x10
48+
cs
49+
lgdtl gdt_desc - _start + 0x10
4950

5051
# enable sse and pae
5152
mov $0x620, %eax

0 commit comments

Comments
 (0)