9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] gcc install help needed
@ 2003-10-09 11:25 cej
  2003-10-10  6:48 ` okamoto
  0 siblings, 1 reply; 3+ messages in thread
From: cej @ 2003-10-09 11:25 UTC (permalink / raw)
  To: 9fans

Folks!
 
Could someone lead my hand through the correct install of gcc-3.0 port?
I obvoiously did something wrong ... I can compile C, but not C++
 
 
Please, HELP!
++pac.
 
Peter A. Cejchan
Lab of Paleobiology and Paleoecology
http://www.gli.cas.cz/home/cejchan
 
===============================================================
 
C++ is to C as lung cancer is to lung.
                                   Anonymous on the Web.
===============================================================
 
 


---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.522 / Virová báze: 320 - datum vydání: 29. 9. 2003
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] gcc install help needed
  2003-10-09 11:25 [9fans] gcc install help needed cej
@ 2003-10-10  6:48 ` okamoto
  2003-10-10  6:54   ` okamoto
  0 siblings, 1 reply; 3+ messages in thread
From: okamoto @ 2003-10-10  6:48 UTC (permalink / raw)
  To: 9fans

> Could someone lead my hand through the correct install of gcc-3.0 port?
> I obvoiously did something wrong ... I can compile C, but not C++

When I compile hpijs-1.4.1, I had to change some as follows:

1) add the function as suggested by Peter Bosch from bell-labs

to the file which contains main() function,

// Ugly, G++ for Plan 9 needs to be installed correctly.
void
ctors(void)
{
	typedef void (*func_ptr)(void);
	extern func_ptr ___CTOR_LIST__[];

	for (int i = 0; i != (int)___CTOR_LIST__[0]; i++)
		___CTOR_LIST__[i + 1]();
}

and and in the top of the main function call the function:

	ctors();

2) in my case I had to add two functions to vsnprintf() and snprintf() to libc library.
 then, I copied snprintf.c and vsnprintf.c files from /sys/src/ape/lib/ap/stdio to
/sys/src/gnu/ape/libc/stdio.   You may also want to add two lines for those two
functions into /sys/include/gnu/stdio.h like:

extern int snprintf(char *, size_t, const char *, ...);
extern int vsnprintf(char *, size_t, const char *, va_list);

Of course you have to change /sys/src/gnu/ape/libc/stdio/mkfile, too.

3) then, recompile /386/lib/gnu/libc.a.   Don't forget to ranlib to it.
You may want to add some neccessary files which I forgot.   I remember
it was neccessary to recompile the library.

Kenji



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] gcc install help needed
  2003-10-10  6:48 ` okamoto
@ 2003-10-10  6:54   ` okamoto
  0 siblings, 0 replies; 3+ messages in thread
From: okamoto @ 2003-10-10  6:54 UTC (permalink / raw)
  To: 9fans

> 3) then, recompile /386/lib/gnu/libc.a.   Don't forget to ranlib to it.
> You may want to add some neccessary files which I forgot.

It was adding three files to /sys/src/gnu/ape:
1) mkconfig
# global include file for the APE environment

< /$objtype/mkfile		# gives (compiler loader extension ranliber)
APEBIN=/$objtype/bin/gnu/ape	# where installed ape binaries go
APELIB=/rc/bin/gnu/ape		# where helper programs go
CC=gcc				# compiler (must be ansi)
LD=gcc				# loader
AS=as
CFLAGS=				# global defaults
FAMILY=plan9
AR=ar				# manipulating libraries
RANLIB=echo			# for updating libraries

INSTALL=$APELIB/install		# install script
INSOWNER=()			# default installation parameter
INSGROUP=bin			# default installation parameter
INSMODE=775			# default installation parameter
2) mkfile
</$objtype/mkfile

DIRS=lib9 libbsd libc libl libnet libregexp libv

none:V:
	echo mk all, install, installall, clean, or nuke

all clean nuke install installall:V:
	for (i in $DIRS) @{
		cd $i
		mk $target
	}
3) mksyslib
AFLAGS=

all:V:	$LIB

$LIB:V:	$OFILES			# force archive even when not neede
	ar vu $LIB $newprereq

&:n:	&.$O
	ar vu $LIB $stem.$O

%.$O:	$HFILES			# don't combine with following %.$O rules

%.$O:	%.c
	$CC $CFLAGS $stem.c
	mv $stem.o $stem.$O

%.$O:	%.s
	$AS $AFLAGS $stem.s

install:V: $LIB

installall:V:
	for(objtype in $CPUS) mk install

%.all:V:
	for(objtype in $CPUS) mk $stem

%.installall:V:
	for(objtype in $CPUS) mk $stem

clean:V:
	rm -f *.[$OS] [$OS].out $CLEANFILES

%.clean:V:
	rm -f $stem.[$OS] [$OS].$stem $stem.acid $stem

nuke:V:
	rm -f *.[$OS] [$OS].out $CLEANFILES

%.acid: %.$O $HFILES
	$CC $CFLAGS -a $stem.c >$target

update:V:
	update $UPDATEFLAGS $UPDATE

Those I copied from somewhere, and make small changes, but I forgot it.

Kenji



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-10  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-09 11:25 [9fans] gcc install help needed cej
2003-10-10  6:48 ` okamoto
2003-10-10  6:54   ` okamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).