From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <92f58c1d82b93f0d421ece40ffb0236b@granite.cias.osakafu-u.ac.jp> To: 9fans@cse.psu.edu Subject: Re: [9fans] gcc install help needed From: okamoto@granite.cias.osakafu-u.ac.jp In-Reply-To: MIME-Version: 1.0 Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 10 Oct 2003 15:48:28 +0900 Topicbox-Message-UUID: 6baedebe-eacc-11e9-9e20-41e7f4b1d025 > 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