How to compile C and CPP to elf by win32 clang?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
SiliconOS
Posts: 17
Joined: Sun Feb 14, 2021 12:41 am

How to compile C and CPP to elf by win32 clang?

Post by SiliconOS »

My new OS(Hyperon, based macOS and FreeBSD and myself codes). But I don't know how to generate elf file by win32 clang?(I don't like GPL)
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: How to compile C and CPP to elf by win32 clang?

Post by Korona »

-target i686-elf
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
SiliconOS
Posts: 17
Joined: Sun Feb 14, 2021 12:41 am

Re: How to compile C and CPP to elf by win32 clang?

Post by SiliconOS »

Korona wrote:-target i686-elf
Thanks, but I want to compile on windows.
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: How to compile C and CPP to elf by win32 clang?

Post by Korona »

Clang does not care about your host OS, it is a cross compiler that can target any of its targets.

So that flag also works on Windows.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
Post Reply