Author Topic: FORTRAN  (Read 3374 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #15 on: March 13, 2022, 09:43:56 am »
Code: [Select]
[U:\DEV]gcc --version
gcc (GCC) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


[U:\DEV]gfortran hello.f90 -o hello.exe

[U:\DEV]hello
 Hello, World!

Binaries tomorrow after a bit more testing....

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 839
  • Karma: +21/-0
    • View Profile
    • Blonde Guy
Re: FORTRAN
« Reply #16 on: March 13, 2022, 02:32:04 pm »
Environments are hard to set up.

If I add f:/usr/lib to LIBRARY_PATH, then the error becomes

Code: [Select]
{0}[d:\neil\neil\coding\fortran] gfortran hello.f90
../.././libbacktrace/mmap.c:212 (f:/programs/gcc830/usr/local830/lib/gfortran.a(mmap.o)): Undefined symbol _munmap referenced from text segment
../.././libbacktrace/mmap.c:167 (f:/programs/gcc830/usr/local830/lib/gfortran.a(mmap.o)): Undefined symbol _mmap referenced from text segment

And sure enough, a huge gfortran.a has appeared in the lib directory.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3664
  • Karma: +77/-0
    • View Profile
Re: FORTRAN
« Reply #17 on: March 13, 2022, 09:42:31 pm »
it's interesting, compiling seems somewhat broken without the -Zomf, even adding "-Xlinker '/@unixroot/usr/lib/libcx0.a'" I get the mmap symbol failures and the huge static lib in the lib directory. Perhaps a fault with ld.exe.
Anyways it is usually encouraged to use -Zomf with the GCC toolchain, which leads to using the system linker (usually wlink now a days) to link. Our ld is ancient, GPL v1 with RMS as principal author and basically just uses emxbind to graft on the executable part to an aout object.
Looks like Paul has fixed/worked around the issues with mmap anyways.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #18 on: March 13, 2022, 09:53:22 pm »
https://smedley.id.au/tmp/gcc-9.4.0-os2-20220314.zip

It builds itself which is the only testing done thus far. No  gccenv.cmd included - it's expected/assumed you know what  you're doing if you're downloading this.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3664
  • Karma: +77/-0
    • View Profile
Re: FORTRAN
« Reply #19 on: March 13, 2022, 10:46:13 pm »
Seems to work. No sign of mmap, did you just eliminate it?
I'll try building SeaMonkey with it next.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #20 on: March 14, 2022, 02:20:49 am »
Hi Dave,

Seems to work. No sign of mmap, did you just eliminate it?
I'll try building SeaMonkey with it next.

Yeah - I modified configure for libbacktrace to not use mmap. I'll try building a few more things with it too..

Cheers,

Paul

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3664
  • Karma: +77/-0
    • View Profile
Re: FORTRAN
« Reply #21 on: March 14, 2022, 03:31:06 am »
It failed to link xul.dll here, likely a pipe issue. The linking stage pipes almost a thousand obj files to emxomfld and if IIRC, the issue with the Bitwise build was recursive piping.
I believe it was fixed in https://github.com/bitwiseworks/gcc-os2/issues/14

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #22 on: March 14, 2022, 03:55:17 am »
Hey Dave,

It failed to link xul.dll here, likely a pipe issue. The linking stage pipes almost a thousand obj files to emxomfld and if IIRC, the issue with the Bitwise build was recursive piping.
I believe it was fixed in https://github.com/bitwiseworks/gcc-os2/issues/14

I'll look into applying the  diffs  from that ticket.

Edit:  https://smedley.id.au/tmp/gcc-9.4.0-os2-20220314b.zip has the diffs from the above ticket included.

Cheers,

Paul
(Ian fixed URL)
« Last Edit: March 14, 2022, 08:48:14 am by Ian Manners »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #23 on: March 14, 2022, 08:37:05 am »
...and if you're feeling adventurous.... https://smedley.id.au/tmp/gcc-10.3.0-os2-20220314.zip

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 839
  • Karma: +21/-0
    • View Profile
    • Blonde Guy
Re: FORTRAN
« Reply #24 on: March 15, 2022, 03:52:34 am »

Edit:  https://smedley.id.au/tmp/gcc-9.4.0-os2-20220314b.zip has the diffs from the above ticket included.

Cheers,

Paul
(Ian fixed URL)

I tried gcc-9.4.0... and it works for hello world. The executable for hello world is 1.4 MB, but it works.

Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3664
  • Karma: +77/-0
    • View Profile
Re: FORTRAN
« Reply #25 on: March 15, 2022, 07:43:42 am »
Hi Paul, still not linking xul.dll. Looking closer, I can't see any problem though there must be. Comparing to a 992 cmd line with diff -u, it shows,
Code: [Select]
--- cmd_992     2022-03-14 23:13:36.000000000 -0700
+++ cmd_994     2022-03-14 23:35:56.000000000 -0700
@@ -391,4 +391,4 @@
 -pthread
 -lglib-2.0
 -lintl
--lcairo
+-lcairo
\ No newline at end of file

I probably added the newline to 992 while copy and pasting. It's weird, looking at the hex shows no difference in the -lcairo, I'll have to look more tomorrow.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #26 on: March 15, 2022, 08:38:00 am »
Hi Dave,

Hi Paul, still not linking xul.dll. Looking closer, I can't see any problem though there must be. Comparing to a 992 cmd line with diff -u, it shows,
Code: [Select]
--- cmd_992     2022-03-14 23:13:36.000000000 -0700
+++ cmd_994     2022-03-14 23:35:56.000000000 -0700
@@ -391,4 +391,4 @@
 -pthread
 -lglib-2.0
 -lintl
--lcairo
+-lcairo
\ No newline at end of file

I probably added the newline to 992 while copy and pasting. It's weird, looking at the hex shows no difference in the -lcairo, I'll have to look more tomorrow.

Can you share the XUL error? Perhaps there are additional diffs from the bww code that I'm missing?

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1021
  • Karma: +95/-0
    • View Profile
Re: FORTRAN
« Reply #27 on: March 15, 2022, 08:45:24 am »

Edit:  https://smedley.id.au/tmp/gcc-9.4.0-os2-20220314b.zip has the diffs from the above ticket included.

Cheers,

Paul
(Ian fixed URL)

I tried gcc-9.4.0... and it works for hello world. The executable for hello world is 1.4 MB, but it works.

With GCC 11.2.0 and:
gfortran -Zomf -Zmap hello.f90 -o hello.exe

it's 519,625 bytes, which after lxlite is 123,397

Cheers,

Paul

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 839
  • Karma: +21/-0
    • View Profile
    • Blonde Guy
Re: FORTRAN
« Reply #28 on: March 15, 2022, 03:54:05 pm »
I've got some kind of mis-configuration

{0} gfortran -Zomf -Zmap hello.f90 -o hello.exe
ilink.exe: No such file or directory
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3664
  • Karma: +77/-0
    • View Profile
Re: FORTRAN
« Reply #29 on: March 15, 2022, 04:05:44 pm »
Hi Dave,

Hi Paul, still not linking xul.dll. Looking closer, I can't see any problem though there must be. Comparing to a 992 cmd line with diff -u, it shows,
Code: [Select]
--- cmd_992     2022-03-14 23:13:36.000000000 -0700
+++ cmd_994     2022-03-14 23:35:56.000000000 -0700
@@ -391,4 +391,4 @@
 -pthread
 -lglib-2.0
 -lintl
--lcairo
+-lcairo
\ No newline at end of file

I probably added the newline to 992 while copy and pasting. It's weird, looking at the hex shows no difference in the -lcairo, I'll have to look more tomorrow.

Can you share the XUL error? Perhaps there are additional diffs from the bww code that I'm missing?