OS/2, eCS & ArcaOS - Technical > Programming
GCC - updates
Steven Levine:
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:
Hey Steven,
I'll get you a debug cc1plus.exe once it's rebuilt.
--- Code: ---Ã ## Ä Base ÄÄÄ Size ÄÄRÄWÄEÄResÄDisÄShrÄPreÄInvÄSwpÄRsdÄLocÄA16Ä32BÄCnfÄIOPÄ
³ 2 032A0000 00B760A0 û û û
--- End code ---
So 12017824 bytes or 12,017,824 - so shouldn't be an issue?
From the map file
--- Code: ---DGROUP 0002:00000000 00b75df0
--- End code ---
edit: binaries at https://smedley.id.au/tmp/gcc-15.0.1-os2-20250223.zip
Steven Levine:
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:
Thanks Steven. We are currently only configuring c & c++:
--- Code: ---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
--- End code ---
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:
This happens to cc1.exe, too.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version