linux-openrisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Question]or1k-elf/or1k-linux Windows/Cygwin toolchain availability?
@ 2025-07-12  7:09 Gary Lau
  0 siblings, 0 replies; 5+ messages in thread
From: Gary Lau @ 2025-07-12  7:09 UTC (permalink / raw)
  To: linux-openrisc

Hello openrisc community,

I'm interested in building the Linux kernel and busybox rootfs for OpenRISC on a Windows/Cygwin environment.
Could anyone advise if there are working or1k-elf and or1k-linux toolchains available for Windows/Cygwin? 
I checked the OpenRISC docs and toolchain repos but couldn’t find Windows-specific  guidance. Any pointers would be helpful!  

Best regards,
Gary




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Question]or1k-elf/or1k-linux Windows/Cygwin toolchain availability?
@ 2025-07-12  7:11 Gary Lau
  2025-07-13  5:59 ` Stafford Horne
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Lau @ 2025-07-12  7:11 UTC (permalink / raw)
  To: linux-openrisc

Hi openrisc folks,  

I’m exploring OpenRISC development and would like to build the linux kernel/busybox rootfs on Windows/Cygwin. 
I wanted to check:  
1. Are prebuilt or1k-elf and or1k-linux toolchains available for Windows/Cygwin?  
2. If not, is cross-compiling from Cygwin feasible, or is a native Linux host strongly recommended?  

I checked the OpenRISC docs and toolchain repos but couldn’t find Windows-specific  
guidance. Any pointers would be helpful!  

Thanks,  
Gary Lau


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Question]or1k-elf/or1k-linux Windows/Cygwin toolchain availability?
  2025-07-12  7:11 [Question]or1k-elf/or1k-linux Windows/Cygwin toolchain availability? Gary Lau
@ 2025-07-13  5:59 ` Stafford Horne
  2025-07-14  9:40   ` [Question]or1k-elf/or1k-linux Windows/Cygwin toolchainavailability? Gary Lau
       [not found]   ` <tencent_AB1F05656F2D0DC53C8ECD792547FB8E8707@qq.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Stafford Horne @ 2025-07-13  5:59 UTC (permalink / raw)
  To: Gary Lau; +Cc: linux-openrisc

Hi Gary,

I see you sent 2 emails which are about the same.  I will reply only to this
one.

On Sat, Jul 12, 2025 at 03:11:43PM +0800, Gary Lau wrote:
> Hi openrisc folks,  
> 
> I’m exploring OpenRISC development and would like to build the linux kernel/busybox rootfs on Windows/Cygwin. 
> I wanted to check:  
> 1. Are prebuilt or1k-elf and or1k-linux toolchains available for Windows/Cygwin?  

There are none available at the moment.  We do have docker images however.  It
seems possible to run containers on windows.  But I haven't tried it.

 - Docker images: https://openrisc.io/tutorials/images.html
 - Containers on windows: https://ubuntu.com/tutorials/windows-ubuntu-hyperv-containers#1-overview

In terms of toolchains, you may only need an or1k-elf toolchain. The or1k-linux
toolchain is a special build with no libc library which is only good for
building the kernel, you can use or1k-elf to build the kernel too.

> 2. If not, is cross-compiling from Cygwin feasible, or is a native Linux host strongly recommended?  

I am sure it's possible, I have seen that ARM and Risc-V toolchains are
available on windows via cygwin.  They mention that to build the toolchain you
must ensure the filesystem is case-sensitive.  If you can get cygwin installed
with the GCC toolchain, you can then run our normal toolchain build script, the
one I use is this:

  - newlib.build: From https://github.com/stffrdhrn/or1k-utils/tree/master
  - example usage: From https://github.com/stffrdhrn/or1k-toolchain-build/blob/master/or1k-toolchain-build/build-gcc.sh

      # Setup overrides for newlib.config
      export NOTIFY=n
      export BUILDDIR=$PWD
      export GCC_SRC=$(archive_src gcc ${GCC_VERSION})
      export BINUTILS_SRC=$(archive_src binutils ${BINUTILS_VERSION})
      export GDB_SRC=$(archive_src gdb ${GDB_VERSION})
      export NEWLIB_SRC=$(archive_src newlib ${NEWLIB_VERSION})
      export INSTALLDIR=$PREFIX
      export CROSS=${target}
      ../or1k-utils/toolchains/newlib.build

> I checked the OpenRISC docs and toolchain repos but couldn’t find Windows-specific  
> guidance. Any pointers would be helpful!  

You can mainly look for risc-v and arm guidance and then translate it to
OpenRISC.  If you get anything working please let me know, we can try to add it
as a tutorial to our main documentation.

-Stafford

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Question]or1k-elf/or1k-linux Windows/Cygwin toolchainavailability?
  2025-07-13  5:59 ` Stafford Horne
@ 2025-07-14  9:40   ` Gary Lau
       [not found]   ` <tencent_AB1F05656F2D0DC53C8ECD792547FB8E8707@qq.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Gary Lau @ 2025-07-14  9:40 UTC (permalink / raw)
  To: Stafford Horne; +Cc: linux-openrisc

Hi Stafford,
The load elf failure seems not be related to the alignment issue.
It seems be related to the memory stack conflict between main program and client elf.
I will fix it.
Anyway, thanks that you confirmed the or1k-gcc does not take care of 4B alignment.


Original
From:Stafford Horne <shorne@gmail.com>
Sent Time:2025-07-13- 13:59
To:Gary Lau <zgliu@foxmail.com>
Cc:linux-openrisc <linux-openrisc@vger.kernel.org>
Subject:Re: [Question]or1k-elf/or1k-linux Windows/Cygwin toolchainavailability?


Hi Gary,

I see you sent 2 emails which are about the same.  I will reply only to this
one.

On Sat, Jul 12, 2025 at 03:11:43PM +0800, Gary Lau wrote:
> Hi openrisc folks,  
> 
> I’m exploring OpenRISC development and would like to build the linux kernel/busybox rootfs on Windows/Cygwin. 
> I wanted to check:  
> 1. Are prebuilt or1k-elf and or1k-linux toolchains available for Windows/Cygwin?  

There are none available at the moment.  We do have docker images however.  It
seems possible to run containers on windows.  But I haven't tried it.

 - Docker images: https://openrisc.io/tutorials/images.html
 - Containers on windows: https://ubuntu.com/tutorials/windows-ubuntu-hyperv-containers#1-overview

In terms of toolchains, you may only need an or1k-elf toolchain. The or1k-linux
toolchain is a special build with no libc library which is only good for
building the kernel, you can use or1k-elf to build the kernel too.

> 2. If not, is cross-compiling from Cygwin feasible, or is a native Linux host strongly recommended?  

I am sure it's possible, I have seen that ARM and Risc-V toolchains are
available on windows via cygwin.  They mention that to build the toolchain you
must ensure the filesystem is case-sensitive.  If you can get cygwin installed
with the GCC toolchain, you can then run our normal toolchain build script, the
one I use is this:

  - newlib.build: From https://github.com/stffrdhrn/or1k-utils/tree/master
  - example usage: From https://github.com/stffrdhrn/or1k-toolchain-build/blob/master/or1k-toolchain-build/build-gcc.sh

      # Setup overrides for newlib.config
      export NOTIFY=n
      export BUILDDIR=$PWD
      export GCC_SRC=$(archive_src gcc ${GCC_VERSION})
      export BINUTILS_SRC=$(archive_src binutils ${BINUTILS_VERSION})
      export GDB_SRC=$(archive_src gdb ${GDB_VERSION})
      export NEWLIB_SRC=$(archive_src newlib ${NEWLIB_VERSION})
      export INSTALLDIR=$PREFIX
      export CROSS=${target}
      ../or1k-utils/toolchains/newlib.build

> I checked the OpenRISC docs and toolchain repos but couldn’t find Windows-specific  
> guidance. Any pointers would be helpful!  

You can mainly look for risc-v and arm guidance and then translate it to
OpenRISC.  If you get anything working please let me know, we can try to add it
as a tutorial to our main documentation.

-Stafford


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Question]or1k-elf/or1k-linux Windows/Cygwin toolchainavailability?
       [not found]   ` <tencent_AB1F05656F2D0DC53C8ECD792547FB8E8707@qq.com>
@ 2025-07-14 15:03     ` Stafford Horne
  0 siblings, 0 replies; 5+ messages in thread
From: Stafford Horne @ 2025-07-14 15:03 UTC (permalink / raw)
  To: Gary Lau; +Cc: linux-openrisc

On Mon, Jul 14, 2025 at 03:06:15PM +0800, Gary Lau wrote:
> Hi Stafford,
> 
> 
> I found there is already or1k toolchain for windows in below link:
> https://www.embecosm.com/resources/tool-chain-downloads/

Oh, thats right.  I forgot about it.

-Stafford

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-14 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12  7:11 [Question]or1k-elf/or1k-linux Windows/Cygwin toolchain availability? Gary Lau
2025-07-13  5:59 ` Stafford Horne
2025-07-14  9:40   ` [Question]or1k-elf/or1k-linux Windows/Cygwin toolchainavailability? Gary Lau
     [not found]   ` <tencent_AB1F05656F2D0DC53C8ECD792547FB8E8707@qq.com>
2025-07-14 15:03     ` Stafford Horne
  -- strict thread matches above, loose matches on Subject: below --
2025-07-12  7:09 [Question]or1k-elf/or1k-linux Windows/Cygwin toolchain availability? Gary Lau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).