Author Topic: Alternatives to compiling Rust in Firefox port OS/2  (Read 6006 times)

Marcoapc

  • Guest
Alternatives to compiling Rust in Firefox port OS/2
« on: May 07, 2018, 10:09:08 am »
There are alternatives to llvm, using gcc, but need to be ported to OS/2. 8)

https://www.phoronix.com/scan.php?page=news_item&px=MTUzMzM Mozilla's Rust Language Gets A GCC Compiler Front-End - Phoronix

https://gcc.gnu.org/wiki/RustFrontEnd

https://github.com/redbrain/gccrs

https://dragonegg.llvm.org/  Using LLVM as a GCC backend

https://github.com/thepowersgang/mrustc It is not gcc, but it may have port to OS/2


Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #1 on: May 08, 2018, 06:33:18 am »
The problems are that RUST is a fast moving target with each new version of Firefox needing the latest version and it seems that it takes a lot of address space to link mixed RUST and C++ code to the point that it likely not linkable on a 32 bit OS.

Marcoapc

  • Guest
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #2 on: May 10, 2018, 09:38:19 am »
This is one of the problems with rust, but is need to have more languages for OS/2!

Carlos de Luna Saenz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #3 on: January 07, 2021, 05:08:36 pm »
I must agree and i think Rust can be a good news not just if someone wants to por Mozilla but for being a good framework where even the compiler checks some good  coding practices .

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #4 on: January 07, 2021, 06:12:54 pm »
I agree, the other day I looked at librsvg, now needs Rust to compile. Has a bunch of GTK dependencies too, which I doubt are needed for what I want it for.
The problem is skilled developers and to port something like Rust will take special skills. Before that we really need to switch GCC from outputting AOUT object files to ELF which means updating the tool chain to produce OMF from ELF and once again no one with the skills has the time and motivation.

Rob

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #5 on: May 07, 2021, 07:30:56 am »
What all is required to produce OMF from ELF? Is there a doc to read?

OS4User

  • Sr. Member
  • ****
  • Thank You
  • -Given: 97
  • -Receive: 16
  • Posts: 306
  • Karma: +9/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #6 on: May 07, 2021, 08:05:11 am »
to produce OMF from ELF

What all is required to produce OMF from ELF? Is there a doc to read?

From my point of view - there is no need to produce OMF from ELF as WLINK, can generate DLL/EXE from ELF (however, it may be necessary to improve WLINK)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #7 on: May 07, 2021, 08:39:38 am »
What all is required to produce OMF from ELF? Is there a doc to read?

Here's a program that can do it, https://www.agner.org/optimize/#objconv along with the documentation and source, it builds easy on OS/2, there's a copy on Hobbes.
I'm sure there is also lots of documentation out there on the OMF and the ELF formats.
As OS4User points out, another possibility is just staying with ELF until the linking stage and having a linker that can link ELF objects into LX executables and DLL's. Wlink can handle both file formats, whether it can currently build a LX executable or a DLL out of ELF obj files needs investigation. It's ELF support isn't the highest as it can't even create ELF shared libraries.
Either route needs someone who knows this stuff.

Lars

  • Hero Member
  • *****
  • Thank You
  • -Given: 2
  • -Receive: 77
  • Posts: 832
  • Karma: +24/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #8 on: May 07, 2021, 09:14:44 am »
Does EMXOMF only convert from AOUT to OMF but not from ELF to OMF ? I thought that if you called gcc with the -Zomf switch that then, OMF objects would he produced ?

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #9 on: May 07, 2021, 04:43:26 pm »
Does EMXOMF only convert from AOUT to OMF but not from ELF to OMF ? I thought that if you called gcc with the -Zomf switch that then, OMF objects would he produced ?

Yes, only AOUT to OMF, with the conversion happening at compile or linking time depending on whether -Zomf is in CFLAGS as well as LDFLAGS. GCC outputs AOUT and then can call emxomf to convert the object files to OMF and we can use the native linker, native debugger etc. There's also tools like emxomfar for creating static OMF libs.
It is also possible to build executables and DLLs directly out of AOUT objects.
The problems with AOUT range from officially unsupported by GCC to just plain old too simple. Doesn't allow much in alignment options for example.

Paul Smedley

  • Hero Member
  • *****
  • Thank You
  • -Given: 62
  • -Receive: 127
  • Posts: 886
  • Karma: +79/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #10 on: May 07, 2021, 11:47:42 pm »
Hey Dave,
The problems with AOUT range from officially unsupported by GCC to just plain old too simple. Doesn't allow much in alignment options for example.

Changing GCC to elf probably wouldn't be that hard - getting the necessary tools updated...... more difficult....

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #11 on: May 08, 2021, 02:04:58 am »
Changing GCC to elf probably wouldn't be that hard - getting the necessary tools updated...... more difficult....

I have gcc-elf binaries from 2.91 built with EMX, they were needed to build XFree/2 as we loaded the ELF modules, could even just copy over a Linux video module.
Code: [Select]
[E:\emx\bin]dir *_elf*

The volume label in drive E is WARP_V4.
The Volume Serial Number is 6C5C:6414.
Directory of E:\emx\bin

11-07-99  2:24p       417,796    124 a---  ar_elf.exe
11-07-99  4:03p       450,564    124 a---  as_elf.exe
11-07-99  7:27p     2,711,556    124 a---  cc1plus_elf.exe
11-07-99  7:18p     2,297,746    124 a---  cc1_elf.exe
11-07-99  7:11p       194,534    124 a---  cpp_elf.exe
11-07-99  1:46p       135,172    124 a---  gasp_elf.exe
11-08-99  9:08p       145,075    124 a---  gcc_elf.exe
 2-18-97 12:37a       145,075    124 a---  GCC_ELF1.EXE
11-08-99  7:45p       413,700    124 a---  ld_elf.exe
11-07-99  2:24p       409,604    124 a---  nm_elf.exe
11-08-99  8:18p       417,796    124 a---  objcopy_elf.exe
11-07-99  2:23p       450,564    124 a---  objdump_elf.exe
11-07-99  2:23p       417,796    124 a---  ranlib_elf.exe
11-07-99  2:23p       405,508    124 a---  size_elf.exe
11-08-99  8:18p       417,796    124 a---  strip_elf.exe

Paul Smedley

  • Hero Member
  • *****
  • Thank You
  • -Given: 62
  • -Receive: 127
  • Posts: 886
  • Karma: +79/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #12 on: May 08, 2021, 08:19:35 am »
Hey Dave,

Changing GCC to elf probably wouldn't be that hard - getting the necessary tools updated...... more difficult....

I have gcc-elf binaries from 2.91 built with EMX, they were needed to build XFree/2 as we loaded the ELF modules, could even just copy over a Linux video module.
Code: [Select]
[E:\emx\bin]dir *_elf*

The volume label in drive E is WARP_V4.
The Volume Serial Number is 6C5C:6414.
Directory of E:\emx\bin

11-07-99  2:24p       417,796    124 a---  ar_elf.exe
11-07-99  4:03p       450,564    124 a---  as_elf.exe
11-07-99  7:27p     2,711,556    124 a---  cc1plus_elf.exe
11-07-99  7:18p     2,297,746    124 a---  cc1_elf.exe
11-07-99  7:11p       194,534    124 a---  cpp_elf.exe
11-07-99  1:46p       135,172    124 a---  gasp_elf.exe
11-08-99  9:08p       145,075    124 a---  gcc_elf.exe
 2-18-97 12:37a       145,075    124 a---  GCC_ELF1.EXE
11-08-99  7:45p       413,700    124 a---  ld_elf.exe
11-07-99  2:24p       409,604    124 a---  nm_elf.exe
11-08-99  8:18p       417,796    124 a---  objcopy_elf.exe
11-07-99  2:23p       450,564    124 a---  objdump_elf.exe
11-07-99  2:23p       417,796    124 a---  ranlib_elf.exe
11-07-99  2:23p       405,508    124 a---  size_elf.exe
11-08-99  8:18p       417,796    124 a---  strip_elf.exe

Interesting - got a link?

Cheers,

Paul

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #13 on: May 08, 2021, 08:49:52 am »
It was on Holger's old pages which are long gone. Frank Giessler also offered to send me the package (60MB). Not sure what Frank is up to now a days. My original archive is also long gone it seems

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 225
  • Posts: 3140
  • Karma: +57/-0
    • View Profile
Re: Alternatives to compiling Rust in Firefox port OS/2
« Reply #14 on: May 08, 2021, 09:04:43 am »
Here's the binaries, they don't seem to need anything besides the emx dlls.