Author Topic: GCC - updates  (Read 71308 times)

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +11/-0
    • View Profile
Re: GCC - updates
« Reply #75 on: February 05, 2025, 03:19:11 pm »
No problems here, thanks!

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #76 on: February 17, 2025, 06:20:31 am »
GCC 15.10 is expected in the coming months...

gcc.exe (GCC) 15.0.1 20250209 (experimental)
Copyright (C) 2025 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.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #77 on: February 18, 2025, 12:10:49 am »
One interesting nit is that when attempting to build something with cmake/ninja in parallel mode, I get:
Code: [Select]
c++.exe: fatal error: cannot execute 'C:/usr/local1501/bin/../libexec/gcc/i686-pc-os2-emx/15/cc1plus.exe': spawnv: Resource busy
compilation terminated.

'ninja -j 1' seems to work OK.

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +11/-0
    • View Profile
Re: GCC - updates
« Reply #78 on: February 18, 2025, 12:20:54 pm »
One interesting nit is that when attempting to build something with cmake/ninja in parallel mode, I get:
Code: [Select]
c++.exe: fatal error: cannot execute 'C:/usr/local1501/bin/../libexec/gcc/i686-pc-os2-emx/15/cc1plus.exe': spawnv: Resource busy
compilation terminated.

'ninja -j 1' seems to work OK.

I've encountered this when building gcc v14.2.0 with 'ld.exe'. In my case, adding '-Zomf' to LDFLAGS when building gcc fixed this problem.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #79 on: February 18, 2025, 09:51:17 pm »
Thanks, but I checked and -Zomf is definitely being used :(

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +11/-0
    • View Profile
Re: GCC - updates
« Reply #80 on: February 19, 2025, 12:54:33 pm »
Thanks, but I checked and -Zomf is definitely being used :(

That's too bad. Then how about trying to build with kLIBC ? This could be a regression of LIBCn.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #81 on: February 20, 2025, 08:31:43 am »
Just noticed something weird about cc1.exe and cc1plus.exe - they have no EA's listed. The equivalent  executables for GCC 14 (and rpm for that matter) have 124 bytes of EA's

Checking the command lines used to build now...

Edit:
Interesting, when built there are no EA's on GCC 14 or 15 - the install must add them....
Edit2: the EA's aren't the problem...
Edit3: found a misapplied diff in libiberty/argv.c - rebuilding....
« Last Edit: February 20, 2025, 09:46:48 am by Paul Smedley »

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +11/-0
    • View Profile
Re: GCC - updates
« Reply #82 on: February 21, 2025, 09:29:13 am »
I've confirmed that there are no differences between kLIBC build and LIBCn build.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #83 on: February 21, 2025, 09:47:08 am »
I've confirmed that there are no differences between kLIBC build and LIBCn build.
Thanks for trying. I looked at some obvious areas of code and can't see what's changed. Still have a few months before 15.1.0 is released :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #84 on: February 23, 2025, 12:15:24 am »
So I installed a logging libc... the failed call from g++ is:
Code: [Select]
0003dcb5 01 03 0001 Mesg 0002 __spawnve (2 ms): Calling DosExecPgm pgm: C:/usr/local1501/libexec/gcc/i686-pc-os2-emx/15/cc1plus.exe args: C:/usr/local1501/bin/../libexec/gcc/i686-pc-os2-emx/15/cc1plus.exe\0kLIBC\0\0
0003dcbf 01 03 0001 Mesg 0002 __spawnve (12 ms): DosExecPgm returned 170
0003dcbf 01 03 0000 Mesg 0010 _sys_set_errno: Set errno 16 for OS/2 error 170

The only reference I can find to DosExecPgm and a return code of 170 is http://svn.netlabs.org/libc/ticket/131

Some clues...
GCC 14 - cc1plus.map - 2.8mb
GCC 15 - cc1plus.map - 19.7mb
« Last Edit: February 23, 2025, 12:29:52 am by Paul Smedley »

Steven Levine

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +12/-0
    • View Profile
Re: GCC - updates
« Reply #85 on: February 23, 2025, 03:08:35 am »
Interesting.  The error implies that the BSS segment is huge (i.e. bigger than 63MB).  For those that don't know, the BSS segment contains static uninitialized data.  This is a bit of a misnomer since the loader zeros the BSS segment when the application is loaded.

To check this do

  lxlite -c:exemap cc1plus.exe >tmp.exemap

and look at the size of object 2.  This will be the BSS segment unless the linkage changed drastically.

For gcc 14, we get

 ├ ## ─ Base ─── Size ──R─W─E─Res─Dis─Shr─Pre─Inv─Swp─Rsd─Loc─A16─32B─Cnf─IOP─
 │  2 02260000 00517B00 ¹ ¹                                        ¹

or about 5MB.  Well within the limits.  For Knut's (I think) testcase, it's

 ├ ## ─ Base ─── Size ──R─W─E─Res─Dis─Shr─Pre─Inv─Swp─Rsd─Loc─A16─32B─Cnf─IOP─
 │  2 00020000 080001C0 ¹ ¹                                        ¹         

or about 128MB.

I prefer to analyze the binaries, but you can get same info from the map file.  For the testcase, it's

  DGROUP                          0002:00000000        080001c0

I'm wondering if there is an overflow in some static data buffer calculation.



Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #86 on: February 23, 2025, 04:32:32 am »
Hey Steven,
I'll get you a debug cc1plus.exe once it's rebuilt.

Code: [Select]
à ## Ä Base ÄÄÄ Size ÄÄRÄWÄEÄResÄDisÄShrÄPreÄInvÄSwpÄRsdÄLocÄA16Ä32BÄCnfÄIOPÄ
³  2 032A0000 00B760A0 û û                                        û         

So 12017824 bytes or 12,017,824 - so shouldn't be an issue?

From the map file
Code: [Select]
DGROUP                          0002:00000000        00b75df0
edit: binaries at https://smedley.id.au/tmp/gcc-15.0.1-os2-20250223.zip
« Last Edit: February 23, 2025, 07:49:17 am by Paul Smedley »

Steven Levine

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +12/-0
    • View Profile
Re: GCC - updates
« Reply #87 on: February 23, 2025, 10:00:48 am »
My current testing says the problem is with fork's limits rather than your cc1plus.exe build per se.  It's too early to say what can be done about this.

The good news is that

  cc1plus --help

appears to run as expected.  Somewhat unexpectedly

  >cc1plus.exe -c xxx

reported

  cc1plus.exe: warning: command-line option '-c' is valid for Modula-2 but not for  C++
  cc1plus.exe: fatal error: xxx: No such file or directory compilation terminated.

which reminded me that gcc supports more than just C and C++.  It may be your build options are such that the size is totally expected.

Poking about, I found

  https://infinitecoder.github.io/posts/2018-03-29-building-gcc-docker-image/

which discusses using the

  --enable-languages

build option to reduce the size of the gcc binaries.  Have you made use of any of these build options to reduce the size of the gcc executables?

A quick scan of the cc1plus.exe --help output implies that gcc supports at least 14 languages.

Now to fade away for the night...


Paul Smedley

  • Hero Member
  • *****
  • Posts: 2447
  • Karma: +186/-0
    • View Profile
Re: GCC - updates
« Reply #88 on: February 23, 2025, 10:13:27 am »
Thanks Steven. We are currently only configuring c & c++:
Code: [Select]
dash ./configure --disable-bootstrap --enable-languages=c,c++ --build=i686-pc-os2-emx --with-sysroot=/@unixroot --prefix=/@unixroot/usr/local1501 --mandir=/@unixroot/usr/local1501/share/man --infodir=/@unixroot/usr/local1501/share/info --enable-shared --enable-threads --enable-checking=release --disable-multilib --with-system-zlib --with-gcc-major-version-only --without-isl --with-tune=generic --with-arch=i686 --with-gnu-as --disable-libstdcxx-pch
I'm currently building a non-debug build - I doubt it will change anything but who knows :)

When it doesn't help I start looking for other configuration options :)

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +11/-0
    • View Profile
Re: GCC - updates
« Reply #89 on: February 23, 2025, 11:13:05 am »
This happens to cc1.exe, too.