DeskLib and GCC 4.7.4
Pages: 1 2
Dave Higton (1515) 3409 posts |
I think there may be a problem with asasm. I’ve reduced the code to just this:
and assembled it with:
and still I get these error lines from the link phase:
There is nothing about FP anywhere in the assembler file, and it doesn’t use any includes, yet still the resulting elf file appears to specify hardware FP. Does anyone else think it’s a bug? Or can anyone see an alternative explanation or anything I can try? |
David Pitt (102) 743 posts |
I don’t see those errors here. The test piece above built to an ELF :- *asasm -o md5bits.o md5bits.s *ld -o md5bits md5bits.o /ADFS::Titan4.$/Progm/GCC/gcc474r2pi3/!GCC/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008068 * This from the gcc mailing list may be of general interest. |
Jeffrey Lee (213) 6046 posts |
There is nothing about FP anywhere in the assembler file, and it doesn’t use any includes, yet still the resulting elf file appears to specify hardware FP. The flags in the ELF header which indicate the floating point type are determined by the command line flags that you pass to the compiler/assembler. For asasm, you want to specify |
Dave Higton (1515) 3409 posts |
|
Jeffrey Lee (213) 6046 posts |
Ah, looks like they’ve changed the options (I was looking at a GCC 4.1 install). With 4.7 (asasm 2.01) it looks like it now accepts an |
Dave Higton (1515) 3409 posts |
Sorry, Jeffrey, but if you look further up the thread, you’ll see that I’ve already tried all 53 listed options to “-fpu=” without success. I also specifically tried “-fpu=SoftFPA” earlier this evening on my minimalist code, with the same result. |
Colin Ferris (399) 1753 posts |
I have asasm ver 2.01 (r5871) only installed. trying *asasm -soft-float -o md5bits.o md5bits.s |
Dave Higton (1515) 3409 posts |
Interesting, Colin:
-h does not include -soft-float on mine. Something has changed within asasm. |
Colin Ferris (399) 1753 posts |
Might be worth getting in contact with John Tytgat – he has done work on Asasm. |
Dave Higton (1515) 3409 posts |
I’ve posted to the RO GCCSDK mailing list. Colin has emailed me a copy of his earlier version of asasm, which accepts the -soft-float switch and assembles a file that links OK. So I have a temporary solution and I’ve alerted the people so that a permanent solution can be worked on. |
Dave Higton (1515) 3409 posts |
How does anyone debug a Wimp ELF application? I’m working on an update to iyoPhone. I noticed that an incoming call doesn’t show the “Incoming call” window. OK, I thought, I’ll put in an fprintf(logfile, …) statement (of which there are of course many already). Now it segfaults instead, showing PC addresses nearly halfway up the memory map, claiming that the last function called is fwrite. Note that explicit calls to fwrite do not occur anywhere in the code that segfaults, but fprintf (which is called) must eventually call fwrite. This used to work, of course, in the previous version, but that’s from several years ago, with a very different version of gcc, a different build of DeskLib, and it’s on a BBxM rather than an Iyonix. Plus of course I am changing the audio to use USB. |
Dave Higton (1515) 3409 posts |
I tried compiling all the code with -mstatic so that I could use elf2aif, but elf2aif still complains that there are non-static data. I take it this means that DeskLib must have been compiled without -mstatic? and, if so, I have to recompile Desklib? One other thing: -O0, -O1 and -O2 all resulted in elf binaries of identical size. Is this to be expected? (I haven’t checked -O3 yet.) |
Matthew Phillips (473) 688 posts |
I am also struggling with DeskLib, which I have not used before. I don’t mind whether I use GCC or Norcroft, but I am wanting to recompile a couple of applications to work with a Raspberry Pi 3 so I just want to use whichever will be easiest. I am doing the compilation on an Iyonix. I have PackMan set up with http://packages.riscosopen.org/packages/pkg/programs-armv5 as the sole source. I have installed the following: (Unimportant: I don’t know what the difference is between all those DeskLib packages. In installed DeskLib on its own first, but after adding the other three nothing further seemed to appear. I was expecting DeskLib to be an empty package that just depends on the other three but it does not seem to be like that.) Unlike Dave higher up this thread I did not get a !DeskLib inside a DeskLib, and I cannot see any “h” directory with header files in. All the header files are in !DeskLib.include and have names like BackTrace/h and so on. Inside DeskLib there is DeskLib/a and libDesk/so which tallies with what others have found above. I thought I would get started by compiling one of the DeskLib examples. I went into Dialog2EG and set that location as the current directory. I set my Next slot to something massive (26M) and opened a Task Window. To start with I forgot to tell it to use GCC. I just did wimpslot 10000K make and got the results: File 'mkdir' not found Makefile:67: recipe for target 'Main.o' failed make: *** [Main.o] Error 1 I tried again with “make COMPILER=gcc” and got exactly the same. I think I then must have booted Acorn C/C++, which I see invcludes a Utility file called mkdir so with further attempts via GCC an “o” directory got created. If I now delete “o” and try “make COMPILER=gcc” again then the “o” directory gets recreated but we get the following errors: gccbin:gcc -mlibscl -mthrowback -O2 -ansi -pedantic -Wall -Wundef -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wno-unused -Wno-long-long -W -Wcast-qual -Wshadow -c Main.c -o Main.o cc1: fatal error: Main.c: No such file or directory compilation terminated. Makefile:67: recipe for target 'Main.o' failed make: *** [Main.o] Error 1 It doesn’t seem to be able to find Main/c which is sitting in the !Dialog2EG directory. I then created a “c” directory and copied Main/c inside, renaming it Main. But then compiling gives us this: gccbin:gcc -mlibscl -mthrowback -O2 -ansi -pedantic -Wall -Wundef -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wno-unused -Wno-long-long -W -Wcast-qual -Wshadow -c Main.c -o Main.o Main.c:1:29: fatal error: DeskLib:Dialog2.h: No such file or directory compilation terminated. Makefile:67: recipe for target 'Main.o' failed make: *** [Main.o] Error 1 So it looks like the header files cannot be found either. Am I doing something horribly wrong, or is DeskLib currently supplied in a form which does not actually work? |
RonM (387) 60 posts |
File ‘mkdir’ not found The makefile is trying to run the linux port of mkdir. |
Chris Mahoney (1684) 2113 posts |
Which I think is in the CoreUtils package. But combined with Matthew’s mention of “/h” files instead of an “h” directory it seems like he’s actually ended up with a version of DeskLib designed for cross-compiling under Linux… which makes me wonder why it’s in a RISC OS package in the first place. But I’ve never used it myself so I’m certainly not an authority here :) |
Jeffrey Lee (213) 6046 posts |
A bit late to the party, but…
My gut instinct would be that one of the calls is being made before the log file has been opened (or opening the file has failed). But hopefully you’ve checked that by now!
Yes, you need to make sure all the libraries are compiled with -mstatic.
That sounds wrong. Did you remember to delete the object files, so that it would actually rebuild the code? |
Jeffrey Lee (213) 6046 posts |
And now for Matthew’s problems:
Yes, it definitely sounds like the sources have been supplied in cross-compile form. srcrename should be able to rearrange everything; if you’re lucky that will be the main blocker to getting it building. |
Matthew Phillips (473) 688 posts |
Thanks. I have also been pointed to https://www.heyrick.co.uk/desklib/ and I think it may be this version which was used to compile the source code I am struggling with. |
Rick Murray (539) 13429 posts |
My version of DeskLib builds and works. I know this because I made some enhancements to the Error functions, rebuilt DeskLib, then modified my Manga reader and rebuilt that to use the new code. My source code, and my version of DeskLib, is intended for the DDE. Oh – it’s worth pointing out – if you wish to rebuild an older program with my DeskLib, you should modify the MakeFile to link with o.desklib32 and not o.desklib (which will be the older 26 bit version, if you have it). What program(s) are you wanting to compile? |
Pages: 1 2