Go to the first, previous, next, last section, table of contents.


Missing strtoul or bsearch

On SunOS4 systems, linking the f771 program used to produce an error message concerning an undefined symbol named `_strtoul', because the `strtoul' library function is not provided on that system.

Other systems have, in the past, been reported to not provide their own `strtoul' or `bsearch' function.

Some versions g77 tried to default to providing bare-bones versions of bsearch and strtoul automatically, but every attempt at this has failed for at least one kind of system.

To limit the failures to those few systems actually missing the required routines, the bare-bones versions are still provided, in `gcc/f/proj.c', if the appropriate macros are defined. These are NEED_BSEARCH for `bsearch' and NEED_STRTOUL for `NEED_STRTOUL'.

Therefore, if you are sure your system is missing bsearch or strtoul in its library, define the relevant macro(s) before building g77. This can be done by editing `gcc/f/proj.c' and inserting either or both of the following `#define' statements before the comment shown:

/* Insert #define statements here.  */

#define NEED_BSEARCH
#define NEED_STRTOUL

Then, continue configuring and building g77 as usual.

Or, you can define these on the make command line. To build with the bundled cc on SunOS4, for example, try:

make bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL'

If you then encounter problems compiling `gcc/f/proj.c', it might be due to a discrepancy between how `bsearch' or `strtoul' are defined by that file and how they're declared by your system's header files.

In that case, you'll have to use some basic knowledge of C to work around the problem, perhaps by editing `gcc/f/proj.c' somewhat.


Go to the first, previous, next, last section, table of contents.