f



Programming the WIMP in C (and the libraries)

Hi,

I wrotely some littely simpely stupidely programmely for the WIMP of
RISC OS using GCC (C) which you can easily downloadingly herely:

http://home.chiemgau-net.de/ausserstorfer/Computer/Mauszeiger.zip
http://home.chiemgau-net.de/ausserstorfer/Computer/Sanduhr.zip
http://home.chiemgau-net.de/ausserstorfer/Temp/Fensterln.zip

My question hereby is:

Using GCC I can create ELFs. But ELFs needs an installed !SharedLibs
before you can start them.

I can transform the ELFs to Absolute files using the command ELF2aif.
But then they will need the !unixlib and are much bigger.

Point is, when I do the job in BBC BASIC, the files are much smaller
as the Absolutes and doesn't need the upper named libraries in all. They
just run. Why is this happen und is it possible to make the some in C?
That the compiled files are small and just run?

A.

-- 
http://home.chiemgau-net.de/ausserstorfer/
Mein Gott! ER lebt!
0
Alexander
11/20/2016 11:28:59 AM
comp.sys.acorn.programmer 2499 articles. 0 followers. Post Follow

4 Replies
287 Views

Similar Articles

[PageSpeed] 54

On 20 Nov, Alexander Ausserstorfer wrote in message
    <4fecf2e155.Alex@bavariasound.chiemgau-net.de>:

> I wrotely some littely simpely stupidely programmely for the WIMP of RISC
> OS using GCC (C) which you can easily downloadingly herely:
> 
> http://home.chiemgau-net.de/ausserstorfer/Computer/Mauszeiger.zip
> http://home.chiemgau-net.de/ausserstorfer/Computer/Sanduhr.zip
> http://home.chiemgau-net.de/ausserstorfer/Temp/Fensterln.zip
> 
> My question hereby is:
> 
> Using GCC I can create ELFs. But ELFs needs an installed !SharedLibs
> before you can start them.
> 
> I can transform the ELFs to Absolute files using the command ELF2aif. But
> then they will need the !unixlib and are much bigger.
>
> Point is, when I do the job in BBC BASIC, the files are much smaller as
> the Absolutes and doesn't need the upper named libraries in all. They just
> run. Why is this happen und is it possible to make the some in C? That the
> compiled files are small and just run?

It is possible: just build AIFs which are linked to the Shared C Library in
ROM. This is the default when using Norcroft; with GCC, the -mlibscl option
is what you're after.

Normally, you'd only want to link with UnixLib if you're after the Unixy
features which don't come in the SCL -- in other words, if you're using
libraries ported over from Linux.

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/
0
Steve
11/20/2016 12:47:33 PM
In message <mpro.ogxy6w053eor601w2.news@stevefryatt.org.uk>
          Steve Fryatt <news@stevefryatt.org.uk> wrote:

>> I wrotely some littely simpely stupidely programmely for the WIMP of RISC
>> OS using GCC (C) which you can easily downloadingly :
>>
>> http://home.chiemgau-net.de/ausserstorfer/Computer/Mauszeiger.zip
>> http://home.chiemgau-net.de/ausserstorfer/Computer/Sanduhr.zip
>> http://home.chiemgau-net.de/ausserstorfer/Temp/Fensterln.zip
>>
>> My question hereby is:
>>
>> Using GCC I can create ELFs. But ELFs needs an installed !SharedLibs
>> before you can start them.
>>
>> I can transform the ELFs to Absolute files using the command ELF2aif. But
>> then they will need the !unixlib and are much bigger.
>>
>> Point is, when I do the job in BBC BASIC, the files are much smaller as
>> the Absolutes and doesn't need the upper named libraries in all. They just
>> run. Why is this happen und is it possible to make the some in C? That the
>> compiled files are small and just run?
>
> It is possible: just build AIFs which are linked to the Shared C Library in
> ROM. This is the default when using Norcroft; with GCC, the -mlibscl option
> is what you're after.

Thanks for the hint, Steve! I'm a bit surprised by the fact, that I
cannot find the -mlibscl option in the GCC manual (the manual about
Using the GNU Compiler Collection).

I tried it by the command

| *gcc wimp_events(9_4_1).c -owimp_events(9_4_1) -IOSLIB: -LOSLIB:
-lOSLib32 -mlibscl

what gives the result:

| wimp_events(9_4_1).c: In function 'main':
|
| wimp_events(9_4_1).c:54:2: warning: incompatible implicit declaration of
| built-in function 'snprintf' [enabled by default]
| /SDFS::RISCOSpi.$/Development/!GCC/bin/ld: error:
| /SDFS::RISCOSpi.$/Development/!GCC/bin/../lib/gcc/arm-unknown-riscos/4.7.4/
| ../../../scl/hard/fpa/libunixlib.a(chunkid01.o)
| uses hardware FP, whereas wimp_events(9_4_1) uses software FP
| /SDFS::RISCOSpi.$/Development/!GCC/bin/ld: failed to merge target
| specific data of file
| /SDFS::RISCOSpi.$/Development/!GCC/bin/../lib/gcc/arm-unknown-riscos/4.7.4/
| ../../../scl/hard/fpa/libunixlib.a(chunkid01.o)

[...]

I'm using OSlib which uses UnixLib (soft-float):

http://ro-oslib.sourceforge.net/release-7.00.html

May be this may be the problem here but I'm not sure.

As I understand, the UnixLib (soft-float) version uses !unixlib in
!Boot.resources, whereas the version of OSLib which uses the
SharedCLibrary application uses !SharedLibs in !Boot.resources and the
version which uses the SharedCLibrary module uses the SharedCLibrary
module in the memory which you can find by *modules.

I'm not sure about the differents of the three resources. Can I avoid
the upper named problem when I use one of the other versions of OSlib
(which are made for the SharedCLibrary or for the !SharedLibs)? I'm also
not sure why I'm using the UnixLib version.

> Normally, you'd only want to link with UnixLib if you're after the Unixy
> features which don't come in the SCL -- in other words, if you're using
> libraries ported over from Linux.

May be that GnuTLS (for POP3S and SMTPS) was once the cause for my
choise but I don't think that the linked programmes need !UnixLib.
But what is the meaning if I need !UnixLib and want to use OSLib? I
cannot find an OSLib hardfloat version for !UnixLib!

Thanks in advance,

Alex

-- 
http://home.chiemgau-net.de/ausserstorfer/
Ich habe gar kein Auto.
0
Alexander
11/26/2016 5:20:22 PM
In message <e91b2ae555.Alex@bavariasound.chiemgau-net.de>
          Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:

> 
> Thanks for the hint, Steve! I'm a bit surprised by the fact, that I
> cannot find the -mlibscl option in the GCC manual (the manual about
> Using the GNU Compiler Collection).
>

Info for !GCC may come from several places, one is !GCC.docs 
!GCC.docs.SharedCLibrary.README
 
> May be that GnuTLS (for POP3S and SMTPS) was once the cause for my
> choise but I don't think that the linked programmes need !UnixLib.
> But what is the meaning if I need !UnixLib and want to use OSLib? I
> cannot find an OSLib hardfloat version for !UnixLib!
>
 
Steve can say it better than I, but OSLib is only a wrapper for OS SWI's,
and if you are after modern hard-float/neon? it is only available via
GCC 4.7.4 and that means unixlib only I think.

Ron M.
0
Ron
11/26/2016 10:23:51 PM
On 26 Nov, Alexander Ausserstorfer wrote in message
    <e91b2ae555.Alex@bavariasound.chiemgau-net.de>:

> I'm using OSlib which uses UnixLib (soft-float):
> 
> http://ro-oslib.sourceforge.net/release-7.00.html
> 
> May be this may be the problem here but I'm not sure.
> 
> As I understand, the UnixLib (soft-float) version uses !unixlib in
> !Boot.resources, whereas the version of OSLib which uses the
> SharedCLibrary application uses !SharedLibs in !Boot.resources and the
> version which uses the SharedCLibrary module uses the SharedCLibrary
> module in the memory which you can find by *modules.

SharedCLibrary Application? That's a new one on me...

You can either link with UnixLib, or the SharedCLibrary module stubs. It's
an either/or choice.
 
> I'm not sure about the differents of the three resources. Can I avoid the
> upper named problem when I use one of the other versions of OSlib (which
> are made for the SharedCLibrary or for the !SharedLibs)? I'm also not sure
> why I'm using the UnixLib version.

OSLib isn't "made for" anything: it has no connection to the UnixLib vs.
SharedCLibrary question. You can use OSLib with either.

> > Normally, you'd only want to link with UnixLib if you're after the Unixy
> > features which don't come in the SCL -- in other words, if you're using
> > libraries ported over from Linux.
> 
> May be that GnuTLS (for POP3S and SMTPS) was once the cause for my choise
> but I don't think that the linked programmes need !UnixLib. But what is
> the meaning if I need !UnixLib and want to use OSLib? I cannot find an
> OSLib hardfloat version for !UnixLib!

IIRC you might need to build OSLib yourself from source to get the
soft-float or hard-float option: the pre-built binaries only come in one of
the two flavours.

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/
0
Steve
12/16/2016 11:00:38 PM
Reply: