CLIB2 failures

Have a question about our Software Developer Kit? Ask them here.

Re: CLIB2 failures

Postby xenic » Wed Sep 30, 2015 4:23 pm

broadblues wrote:@xenic
but if you look at the commit logs on the github site you'll see Olaf added that header.

Could be it doesn't get included inot that one particular file somehow.

Just grab the source and build yourself a new copy.


O.K. I see that the "obsolete.h" header is included in clib2 stdio_headers.h that is included by the stdio files but it's not included by clib2 stdlib_headers.h that is included by the stdlib files.

I reported the problem so it could be fixed and have a clib2 update made available in Amiupdate. I'm not actually using clib2 in my program. I just got tired of entering a long command line to compile a program I'm working on and borrowed an old makefile to compile it with the make command instead. I forgot to remove the -mcrt=clib2 from the borrowed makefile and discovered the problem.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1020
Joined: Sun Jun 19, 2011 1:06 am

Re: CLIB2 failures

Postby xenic » Wed Sep 30, 2015 11:41 pm

salass00 wrote:Compiling with -Werror as well as -Wall would have stopped this accident from happening.

With only -Wall gcc would have produced an "implicit declaration of function" warning but because it's not treated as an error it can be really easy to miss in a project with lots of files to compile such as clib2.


While that sounds like a good idea, the clib2 sources are full of deprecated functions which might also be flagged as errors. It would appear that many parts of clib2 need to be rewritten to use current OS4 functions. Additionally, clib2 needs to be compiled with gcc 4.0.2 in order for the baserel code to be produced.

I added a define to fix the "GetProgramName" link failure, modified the makefile to compile on my X1000 and compiled clib2 with gcc 4.0.2 to get the baserel files. I seems to work so far. After examing the clib2 code, I have to wonder if all the deprecated functions and old names have been replaced in newlib.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1020
Joined: Sun Jun 19, 2011 1:06 am

Re: CLIB2 failures

Postby ssolie » Thu Oct 01, 2015 12:21 am

xenic wrote:I added a define to fix the "GetProgramName" link failure, modified the makefile to compile on my X1000 and compiled clib2 with gcc 4.0.2 to get the baserel files. I seems to work so far.

Can you show us here exactly what you changed?

I don't care about the baserel stuff. Just whatever that define was you were messing with.
AmigaOS Development Team Lead
Be authentic. Get AmigaOS.
User avatar
ssolie
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1000
Joined: Mon Dec 20, 2010 9:51 pm
Location: Canada

Re: CLIB2 failures

Postby salass00 » Thu Oct 01, 2015 10:48 am

xenic wrote:While that sounds like a good idea, the clib2 sources are full of deprecated functions which might also be flagged as errors.


Just add -Wno-deprecated-declarations until those are fixed.

It is also possible to set exceptions to the -Werror rule although I don't remember the exact details of how to do this off hand.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: CLIB2 failures

Postby xenic » Thu Oct 01, 2015 7:02 pm

ssolie wrote:Can you show us here exactly what you changed?

I don't care about the baserel stuff. Just whatever that define was you were messing with.


Olaf responded quickly to my bug report and added the inclusion of <dos/obsolete> in the stdlib_headers.h file. I downloaded the zip archive of clib2 sources from https://github.com/adtools/clib2 and was able to compile a working clib2 with the current SDK (with SDK:clib2/lib/libc.a from the previous SDK).

The GNUmakefile.os4 makefile cross-compiles by default but you need to make this change:
Change "COMPILER_VERSION := -V4.0.2" to "COMPILER_VERSION := -V4.2.4"

In order to compile clib2 (with Olaf's latest change) natively on my X1000 I had to make the following changes to GNUmakefile.os4:
Commented out lines 24 through 37.
Uncommented lines 42 through 51 (commands for OS4 native compile).
Changed line 50 from "COMPILER_VERSION := -V4.0.2" to "COMPILER_VERSION := -V4.2.4"
Changed line 51 from "LOG_COMMAND := *>< | tee >>compiler.log" LOG_COMMAND := *>< | tee >>ram:compiler.log (might not be necessary).
Removed "distcc" from line 44.

Although the gcc v4.2.4 compile produces baserel files, they may not actually be base relative. According to Olaf's notes in the makefile, gcc v4.0.2 or lower must be used to get real base relative code.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1020
Joined: Sun Jun 19, 2011 1:06 am

Re: CLIB2 failures

Postby ssolie » Thu Oct 01, 2015 9:38 pm

xenic wrote:Olaf responded quickly to my bug report and added the inclusion of <dos/obsolete> in the stdlib_headers.h file. I downloaded the zip archive of clib2 sources from https://github.com/adtools/clib2 and was able to compile a working clib2 with the current SDK (with SDK:clib2/lib/libc.a from the previous SDK).

Ah, good. I will prepare an SDK update with this important fix.
AmigaOS Development Team Lead
Be authentic. Get AmigaOS.
User avatar
ssolie
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1000
Joined: Mon Dec 20, 2010 9:51 pm
Location: Canada

Re: CLIB2 failures

Postby tonyw » Fri Oct 02, 2015 1:16 am

Well done, xenic !
cheers
tony
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1237
Joined: Wed Mar 09, 2011 2:36 pm
Location: Sydney, Australia

Re: CLIB2 failures

Postby salass00 » Fri Oct 02, 2015 10:15 am

xenic wrote:Additionally, clib2 needs to be compiled with gcc 4.0.2 in order for the baserel code to be produced.


If the gcc 4.2.4 that's included with the SDK can't generate baserel binaries then there seems to be absolutely no reason to include any baserel libraries in the SDK.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: CLIB2 failures

Postby xenic » Fri Oct 02, 2015 6:40 pm

salass00 wrote:
xenic wrote:Additionally, clib2 needs to be compiled with gcc 4.0.2 in order for the baserel code to be produced.


If the gcc 4.2.4 that's included with the SDK can't generate baserel binaries then there seems to be absolutely no reason to include any baserel libraries in the SDK.


I just mentioned baserel because of the note about it in the clib2 makefile. Personally, I don't know anything about the issue.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1020
Joined: Sun Jun 19, 2011 1:06 am

Re: CLIB2 failures

Postby salass00 » Sat Jul 29, 2017 10:04 pm

An updated build of clib2 is available on OS4Depot:

http://os4depot.net/index.php?function= ... /clib2.lha
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Previous

Return to SDK Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron