Re: Linking libraries?




Frank Kotler wrote:
Julienne Walker wrote:

...
global _main
extern _getenv

_main:

I still think we're going to want to lose the underscores for Linux...
Well, Solar's got it working...

Yea, underscores are iffy. It's probably better to never use them and
take advantage of the --prefix switch on systems that need them.

Still another option is to leave our entrypoint at "_start" (and *don't*
"ret"!), and add "--nostartfiles" to gcc's command line. Seems "risky"
to be calling C's library functions without having run C's startup code,
but it "seems to work".

Best,
Frank

I don't see how it wouldn't work, but a "half and half" solution seems
risky simply because you're mixing techniques. That usually falls
through unless you're extremely careful to do the right thing at the
right time and in the right place.

.