Sunday, 1 August 2021

[gccsdk] Some feedback on using GCC 10.2.0

I've just started getting into RISC OS as a hobby project to do
something with my Raspberry Pi 3, GCC toolchain, and POSIX knowledge.
I managed to get the GCC 4.7.4 SDK running on my Ubuntu PC, and then
GCC 10.2.0 and binutils 2.30 as well. So far I've been extremely happy
and impressed with the quality of the autobuilder and toolchain. I'd
feared that UnixLib wouldn't be as capable as it is, and I'm happy to
see familiar GNU EABI and ELF formats.

I've been making a few improvements to the ports and toolchains in my
own git repo mirrored from Subversion and hosted on GitHub. Feel free
to integrate any of my changes into the main repo. In fact, I'd prefer
for any interested users to merge changes from my repo without asking
me for permission for each one.

https://github.com/jhamby/riscos-gccsdk

You probably don't want to take the patch I made to change the default
GCC 10 CPU/FPU target from ARMv7-A and VFPv3 to Cortex-A53 and Neon,
but I've tried to make everything else reasonably generic. Now, on to
a few areas of difficulty that I'd like to solicit some opinions on
how to fix.

First, I had a bizarre time with Qt 5.5.0 failing to load
libqriscos.so, which I finally tracked down to SOMLoader failing to
link in libbz2.so.1.0, by way of libfontconfig.so.1.8.0 and
libfreetype.so.6.

As a workaround, I've patched my setvars for libbz2-1.0 to only build
a static library, with "-fPIC" so it can be linked into other shared
libraries, and that worked around the issue well enough for me to run
AnalogClock and find another runtime failure with FontConfig itself if
I try to run any Qt programs that draw text.

I'm confused why this is happening, and unlike with missing shared
libs, there wasn't any output as to what went wrong. dlopen() just
returned NULL to libQt with a "filename not found" error. I had to set
DEBUG_PRINT to 1 in gcc4/riscos/soloader/module2/som_elf.c and build a
new SOMLoader to discover that it was libbz2.so.1.0 where the dlopen()
failed and returned NULL.

There's another SOMLoader issue I'm curious about, which is the patch
to binutils in autobuilder/develop/gcc/bfd.elf.c.pp that comments out
the section that merges a data segment into a previous text segment,
because the comment says RISC OS requires two segments. That patch
failed to apply cleanly when I attempted to upgrade to binutils 2.31,
so I left it out, and SOMLoader indeed complains that the data segment
is missing. I'm curious if it would make sense to patch SOMLoader to
not fail here. Is there a reason for the requirement for a separate
data segment?

One high-priority item for me is that I'd like to build the
system/khronos package for OpenGL ES 2.0 on my Pi using GCC 10, and I
did get it to work when built with GCC 4.7.4, but unfortunately, even
after modifying to use "arm-riscos-gnueabihf-" tools instead of
"arm-unknown-riscos-" (including adding a "-gnueabihf" option to
cmunge to tell it to do the same), I'm getting these failures linking
the RISC OS module with GCC 10 tools:

khronos.o: In function `__module_header':
(.riscos.module.header+0x0): multiple definition of `_start'
/home/jhamby/Projects/RISCOS/GitHub/riscos-gccsdk/env/lib/gcc/arm-riscos-gnueabihf/10.2.0/../../../../arm-riscos-gnueabihf/lib/crt0.o:/home/jhamby/Projects/RISCOS/GitHub/riscos-gccsdk/build/gcc/gcc-10.2.0/cross-build/arm-riscos-gnueabihf/libunixlib/crt0.S:16:
first defined here

/home/jhamby/Projects/RISCOS/GitHub/riscos-gccsdk/env/lib/gcc/arm-riscos-gnueabihf/10.2.0/../../../../arm-riscos-gnueabihf/bin/ld:
Unable to find Image$$RO$$Base

/home/jhamby/Projects/RISCOS/GitHub/riscos-gccsdk/env/lib/gcc/arm-riscos-gnueabihf/10.2.0/../../../../arm-riscos-gnueabihf/bin/ld:
Unable to find Image$$RW$$Base

khronos.o: In function `_CMUNGE_ce':
(.riscos.module.header+0x1a0): undefined reference to `_Lib$Reloc$Off$DP'
(.riscos.module.header+0x1ac): undefined reference to `_Lib$Reloc$Off$DP'
khronos.o: In function `_CMUNGE_init':
(.riscos.module.header+0x1e4): undefined reference to `_clib_initialisemodule'
(.riscos.module.header+0x1f0): undefined reference to `_Lib$Reloc$Off$DP'
(.riscos.module.header+0x204): undefined reference to `_Lib$Reloc$Off$DP'
(.riscos.module.header+0x22c): undefined reference to `_clib_finalisemodule'
khronos.o: In function `_CMUNGE_init_10':
(.riscos.module.header+0x234): undefined reference to `_Lib$Reloc$Off$DP'
khronos.o: In function `_CMUNGE_fin':
(.riscos.module.header+0x268): undefined reference to `_Lib$Reloc$Off$DP'
(.riscos.module.header+0x288): undefined reference to `_clib_finalisemodule'
khronos.o: In function `_CMUNGE_final_10':
(.riscos.module.header+0x290): undefined reference to `_Lib$Reloc$Off$DP'
khronos.o: In function `_CMUNGE_swi_handler':
(.riscos.module.header+0x2d0): undefined reference to `_Lib$Reloc$Off$DP'
(.riscos.module.header+0x2dc): undefined reference to `_Lib$Reloc$Off$DP'
/home/jhamby/Projects/RISCOS/GitHub/riscos-gccsdk/env/lib/gcc/arm-riscos-gnueabihf/10.2.0/../../../../arm-riscos-gnueabihf/lib/crt0.o:
In function `crt1_data':
crt0.S:(.data+0x14): undefined reference to `main'
collect2: error: ld returned 1 exit status

Can anyone shed some light on the way that this is supposed to work
(and does work with GCC 4)? Thanks in advance.

One final toolchain item that I noticed is "elf2aif" doesn't work yet
for converting statically-linked gnueabihf binaries to AIF. It
immediately fails due to the OS ABI changing from ARM to generic in
the ELF file header, but if I override that check, the resulting
binaries immediately crash with an EMT trap. Is there some special
startup code that needs to be executed that the AIF header isn't
calling, perhaps for C++?

Best regards,
Jake Hamby

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Re: [gccsdk] GCC development organisation

On Sun, Aug 01, 2021 at 10:53:48AM +0000, Stefan Fröhling wrote:
> Hello all!
> I would like to know how the RISC OS GCC development is organized.Is there
> any coordination? Is there only one mayor developer?
> As Noa Lee is working on GCC for built the !Iris browser.
> Are there others?
> Is all coordinated at Github?
> Do each work only by themselves without knowing what the others do?
> Is there a big boss? Is there a plan who does what and what needs to be
> done?

Organisation? What's that? :-)

TBH there isn't very much. Not much has been happening of late, things have
mostly been ticking along as and when individuals have time, which seems to
be rarely.

I set up a github org:
https://github.com/riscos-dot-info/
but most things have been happening in riscos.info SVN. The best place to
see the activity is the commit mailing list:
http://www.riscos.info/pipermail/riscos-commits/
About a dozen people have commit access, but a number of those aren't active
any more.

In summary, looking over recent commits:

I pay the hosting bills and maintain (in a very loose sense)
the riscos.info server. I also 'maintain' the riscos.info CI
system (which is broken and has been for ages, due to a move to a new server
meaning the config needs redesigning).

Lee Noar has been looking after GCC, including GCC 8 and 10, taking over
from John Tytgat who is no longer active.
Alan Buckley looks after PackMan and some (game?) ports.
Chris Gransden has worked on a lot of the ported software in the autobuilder
A few other folks have done occasional commits or have their own repos on
the server


There's no boss, because there's not much resource to 'manage'. This
mailing list is 'it', so if there's no commits or traffic on this mailing
list then you can assume nothing has happened.

> By the way looks we got a new capable programmer in the RISC OS community
> by Jake Hamby as he is trying to make GCC 10.3 work now. But as his
> example shows every starts from zero and must work himself through the
> problems. That is not very efficient.

We're very happy to help out with people having problems and to bring new
folks up to speed (lots of things are quite complicated and there's a fairly
steep learning curve), so I'd encourage him to join and post here. It would
help us improve documentation if nothing else.

Please bear in mind that some parts don't have a current 'owner', in that
the person who made them has moved on and so nobody actually knows the
answer to some questions. So it's possible that if nobody replies then
nobody knows.

I'm also generally happy to give active developers access to resources like
commit access to SVN (I'd suggest posting a few patches here first for
sanity checking since SVN doesn't have a code review process).

Much of the current infrastructure is a bit creaking and I'd be quite happy
for things to move to github if that's what people want to do and someone is
willing to do it (I had a go at converting the SVN repo to git but not in
the right way - it needs more work to do it right). If anyone wants to take
the lead on that then feel free to post here and we can work out the
details.

Theo

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

[gccsdk] GCC development organisation

Hello all!

I would like to know how the RISC OS GCC development is organized.
Is there any coordination? Is there only one mayor developer?
As Noa Lee is working on GCC for built the !Iris browser.
Are there others?
Is all coordinated at Github?
Do each work only by themselves without knowing what the others do?
Is there a big boss? Is there a plan who does what and what needs to be done?

In advance thanks for the answer.
By the way looks we got a new capable programmer in the RISC OS community by Jake Hamby as he is trying to make GCC 10.3 work now. But as his example shows every starts from zero and must work himself through the problems. That is not very efficient.

regards Stefan Fröhling

Am Sonntag, 1. August 2021, 02:00:04 GMT+7 hat <gcc-request@gccsdk.riscos.info> Folgendes geschrieben:


Send gcc mailing list submissions to

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to

You can reach the person managing the list at

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gcc digest..."

Saturday, 31 July 2021

Re: [gccsdk] Sorry. Forgot

On Sat, Jul 31, 2021 at 02:08:38PM +0100, wra1th+gavin wrote:
> For the first time I have launched the command
> ./build-world (using Raspbian on a rpi4). It requires considerable patience,
> and faith because there is little to tell you that the build process is not
> stuck in a loop. It would be good if the web page gave a hint of how many
> hours the build-process is likely to take. It feels like inspecting the DNA
> of an ant by telescope from the moon.

In general build processes don't get stuck in loops - if they're generating
output it means they're making progress. If the build stops with an error,
that's more of a concern.

The time the build takes really depends on your hardware - if you have a
fast PC or server with many cores it's a lot quicker than if you have a
lightweight laptop or a development board like a Pi. It also depends a lot
on your storage - an SSD is likely to be a lot better than an SD card or a
HDD.

That said, it appears the build instructions on the website didn't describe
how to run a build that uses all the cores in your computer - in the case of
your Pi4 that means running one core not four. Using four cores isn't 4x as
fast (the GCCSDK build has a lot of autoconf which doesn't use all the
cores) but it's better.

I've now edited the page:
https://www.riscos.info/index.php/Using_GCCSDK#Building_the_cross-compiler
to describe how to run parallel builds, and to clarify how long it might
take.

Using that on a server with 72 threads reduces the build time from 67 to 16
minutes. Nowhere near a 72x speedup, but worth having.

Theo

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

[gccsdk] Sorry. Forgot

> An attempt was made to subscribe your address to the mailing list

Sorry. Forgot I was already subscribed. For the first time I have
launched the command
./build-world (using Raspbian on a rpi4). It requires considerable
patience, and faith because there is little to tell you that the build
process is not stuck in a loop. It would be good if the web page gave a
hint of how many hours the build-process is likely to take. It feels
like inspecting the DNA of an ant by telescope from the moon.

-- Gavin WRaith

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Tuesday, 27 July 2021

[gccsdk] GCC 10 reply

Thanks Chris for the detailed information!
regads Stefan

Am Dienstag, 27. Juli 2021, 02:00:04 GMT+7 hat gcc-request@gccsdk.riscos.info <gcc-request@gccsdk.riscos.info> Folgendes geschrieben:


Today's Topics:

  1. Re: GCC 10 (Chris Gransden)


----------------------------------------------------------------------

Message: 1
Date: Mon, 26 Jul 2021 10:24:09 +0100
From: Chris Gransden <chrisg@care4free.net>
Subject: Re: [gccsdk] GCC 10
Content-Type: text/plain; charset=iso-8859-1

  Stefan Fr?hling <stefanfroehling@yahoo.de> wrote:
> Hello there!

> I have been told from Andrew Rawnsley that Iris is done with GCC10 and mostly ported by Lee Noa to create Iris.
> Where we can download the sources/binaries ?
> What is the status? What must be done to make it a RISC OS native compiler as we want to built an IDE around GCC and maybe support also other languages like BASIC, Python and Pascal.
> I want to find some programmers who are willing to port GCC 10 to RISC OS as now it is only available for Linux/Windows.
> (well with available I mean it is available at least for one or two or three RISC OS programmers?.)
> I appreciate any suggestions for a path forward so it can be made available for all RISC OS users soon.

> PS: Congratulation fot the good work on Iris and GCC10!

> regards Stefan
> from the Cloverleaf RISC OS project
> www.riscoscloverleaf.com


The GCCK 10.2.0 native compiler hasn't been released yet. Once you have the
autobuilder set up you can build it yourself.

mkdir gccsdk
cd gccsdk
svn co svn://svn.riscos.info/gccsdk/trunk/autobuilder/ autobuilder
svn co svn://svn.riscos.info/gccsdk/trunk/gcc4/ gcc4

mkdir build
cd build


Create a file call build-setvars containing the following contents.
(Assuming the autobuilder has been installed in /home/gccsdk.)

      GCCSDK_INSTALL_CROSSBIN=/home/gccsdk/cross/bin
      GCCSDK_INSTALL_ENV=/home/gccsdk/env
      RO_SHAREDLIBS=yes
      RO_USE_ARMEABIHF=yes
      AB_ELFBUILD=yes

rm -f /home/gccsdk/autobuilder/develop/gcc/gcc.dwarf2out.c.p
../autobuilder/build -v gcc

The packages for the native compiler will be created in
/home/gccsdk/autobuilder/autobuilder_packages/arm/Development.

Using GCC natively on RISC OS is very slow. It's OK for simple stuff.

I had to set a 32000k wimplot otherwise everything froze.

Using GCC 10.2.0 with the autobuilder successully builds e.g. Qupzilla,
RPCEmu, ffmpeg and  mplayer.




------------------------------

_______________________________________________
gcc mailing list

End of gcc Digest, Vol 158, Issue 3
***********************************

Monday, 26 July 2021

Re: [gccsdk] GCC 10

In article <2131397311.232135.1626596425379@mail.yahoo.com>,
Stefan Fröhling <stefanfroehling@yahoo.de> wrote:
> Hello there!

> I have been told from Andrew Rawnsley that Iris is done with GCC10 and mostly ported by Lee Noa to create Iris.
> Where we can download the sources/binaries ?
> What is the status? What must be done to make it a RISC OS native compiler as we want to built an IDE around GCC and maybe support also other languages like BASIC, Python and Pascal.
> I want to find some programmers who are willing to port GCC 10 to RISC OS as now it is only available for Linux/Windows.
> (well with available I mean it is available at least for one or two or three RISC OS programmersŒ.)
> I appreciate any suggestions for a path forward so it can be made available for all RISC OS users soon.

> PS: Congratulation fot the good work on Iris and GCC10!

> regards Stefan
> from the Cloverleaf RISC OS project
> www.riscoscloverleaf.com


The GCCK 10.2.0 native compiler hasn't been released yet. Once you have the
autobuilder set up you can build it yourself.

mkdir gccsdk
cd gccsdk
svn co svn://svn.riscos.info/gccsdk/trunk/autobuilder/ autobuilder
svn co svn://svn.riscos.info/gccsdk/trunk/gcc4/ gcc4

mkdir build
cd build


Create a file call build-setvars containing the following contents.
(Assuming the autobuilder has been installed in /home/gccsdk.)

GCCSDK_INSTALL_CROSSBIN=/home/gccsdk/cross/bin
GCCSDK_INSTALL_ENV=/home/gccsdk/env
RO_SHAREDLIBS=yes
RO_USE_ARMEABIHF=yes
AB_ELFBUILD=yes

rm -f /home/gccsdk/autobuilder/develop/gcc/gcc.dwarf2out.c.p
../autobuilder/build -v gcc

The packages for the native compiler will be created in
/home/gccsdk/autobuilder/autobuilder_packages/arm/Development.

Using GCC natively on RISC OS is very slow. It's OK for simple stuff.

I had to set a 32000k wimplot otherwise everything froze.

Using GCC 10.2.0 with the autobuilder successully builds e.g. Qupzilla,
RPCEmu, ffmpeg and mplayer.


_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK