-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use freestanding mode, but encounter incompatible size_t redefinition error by C #23228
Comments
fn main() {
message := "Hello, World!"
for ch in message {
asm x86 {
mov ah, 0x0e
mov al, ch // ch is a x86 register, cx high part. not the var ch
int 0x10
}
}
// Infinite loop to keep the program running
for {}
} maybe fix to : fn main() {
message := "Hello, World!"
for c in message {
asm x86 {
mov ah, 0x0e
mov al, c
int 0x10
; r (c) as c
}
}
// Infinite loop to keep the program running
for {}
} BTW: .text:0000000000417AEF int 10h ; - VIDEO - WRITE CHARACTER AND ADVANCE CURSOR (TTY WRITE)
.text:0000000000417AEF ; AL = character, BH = display page (alpha modes)
.text:0000000000417AEF ; BL = foreground color (graphics modes) |
Now first warning is eliminated, the bug reported still occurs, I check the generated C, it seems if compile as -freestanding will cause incompatible size_t error. |
|
-freestanding
Build the executable without dependency on libc.
Supported only on `linux` targets currently.
V does not support -freestanding mode under windows yet. For test: v self then you can compile. |
I see, thanks! I'll try to test on Linux to generate bare-metal code (As I already installed tinyc, i686-elf-gcc, I guess they can help cross-compile to bare-metal code on Windows also). BTW, though -freestanding is not supported on Windows, I finally got my bootsector running on logic implemented in V at Windows, with the help of generating C code from V compiler, :). |
V doctor:
What did you do?
./v -g -o vdbg cmd/v && ./vdbg bootsector.v
What did you expect to see?
Compile OK
What did you see instead?
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21662
The text was updated successfully, but these errors were encountered: