[comp.sys.amiga.programmer] Creating SAS C-run Time librarys! Help

slmt9@cc.usu.edu (01/14/91)

	I have a few questions when it comes to trying to build a shared
library for the LIBS: directory. 

	I am using the new SAS C v5.10 and have had a few problems with trying
to build the library. 

	I got some help from Peter at Commodore and got underway to get stopped
by some new problems. So ere they are. and please everyone who has any idea
respond. I can handle getting the correct answer a large number of times :->

	Anyway I define my functions the way that Peter said to do and so there
are no more errors there. The problem now Lies in the naming of the library and 
things like that. Basicaaly when I try to blink the Library with a command that 
looks like this
	BLINK LIBFD MyLib.fd to MyLib.library from libent.o+libinit.o+MyLib.o
(I am not sure which order the Libent.o and Libinit.o go in right now but I
used the order from the manual.)
	I get a list of blink errors. They (default _stub)

	and so on. When I try to define the names from that point the system
tells me that "MyLib.library" is an unknow symbol. So my question. Where do I
define all of these wonderfull things and what in the world is __xcvof?

	Any help would be greatly appriciated..
	
	Thanks,
	joshua
	SLMT9@cc.usu.edu

	1) Enter a DEFINE value for __xcovf (default _stub)
	2) Enter a DEFINE value for _LibName (default _stub	3) Enter a DEFINE value for _LibID   

tll@nntp-server.caltech.edu (Tal Lewis Lancaster) (01/15/91)

slmt9@cc.usu.edu writes:


>	I have a few questions when it comes to trying to build a shared
>library for the LIBS: directory. 

>looks like this
>	BLINK LIBFD MyLib.fd to MyLib.library from libent.o+libinit.o+MyLib.o
>(I am not sure which order the Libent.o and Libinit.o go in right now but I
>used the order from the manual.)

Why couldn't you use the SAS oml?  This is the program I use when I want
to build a library.  

Hope, this helps.

Tal

aoe@hpfcso.HP.COM (Alexander Elkins) (01/15/91)

>   	I am using the new SAS C v5.10 and have had a few problems with trying
>   to build the library. 
>
>    	BLINK LIBFD MyLib.fd to MyLib.library from libent.o+libinit.o+MyLib.o
>    (I am not sure which order the Libent.o and Libinit.o go in right now but I
>    used the order from the manual.)

You got the order right.  The manual uses spaces instead of '+' characters.

>    	I get a list of blink errors. They are
>
>   	1) Enter a DEFINE value for __xcovf (default _stub)
>   	2) Enter a DEFINE value for _LibName (default _stub)
>	3) Enter a DEFINE value for _LibID (default _stub)   
>
>  	and so on. When I try to define the names from that point the system
>  tells me that "MyLib.library" is an unknow symbol. So my question. Where do I
>   define all of these wonderfull things and what in the world is __xcvof?

__xcvof is jumped to if your stack overflows.  Compile with "-v" option
to avoid needing this (turns off stack checking).

Use "-u" flag when assembling libent.a which adds the additional leading '_'
you are missing.  Also note that you must also use "-ml"
(that a lowercase 'L' not the number one!) and "__saveds" when compiling.

Typical function (don't use __regargs):

int __saveds __asm test(register __d0 int i)
{
	/* rest of code */
	return 0;
}

>   	Any help would be greatly appriciated..
>
>   	Thanks,
>   	joshua
>   	SLMT9@cc.usu.edu

 - Alexander Elkins (aoe@hpfiaoe.fc.hp.com)

jesup@cbmvax.commodore.com (Randell Jesup) (01/15/91)

In article <101060004@hpfcso.HP.COM> aoe@hpfcso.HP.COM (Alexander Elkins) writes:
>>   	I am using the new SAS C v5.10 and have had a few problems with trying
>>   to build the library. 

>__xcvof is jumped to if your stack overflows.  Compile with "-v" option
>to avoid needing this (turns off stack checking).

	Yes, -v is absolutely needed for code that will be in a shared
library (you can't stack-check someone else's stack).  Also, as Mr Elkins
pointed out, -ml is required also.

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com  BIX: rjesup  
The compiler runs
Like a swift-flowing river
I wait in silence.  (From "The Zen of Programming")  ;-)