# Problem with building toolchain for OS/161



## Giorgos (Jan 20, 2010)

I have a course in my college operating system and i have to install to my Freebsd partition an emulator for os/161 called sys161 plus the source tree of os/161. Before that i have to build a toolchain for them as the os is for MIPS CPU. So i build the cs161-binutils-1.4 fine but when i execute the script in cs161-gcc-1.4 an error appears:


```
checking for main in -lunwind... no
Please update *-*-freebsd* in gcc/config.gcc
Configure in /usr/home/giorgos/OS_TAR/toolchain/cs161-gcc-1.4/gcc failed, exiting.
```

Don't know how to fix this ( either if it can be fixed )

Sorry i tried to attach the files but is 14M each so i cannot.


```
Checking directory... /home/gfot/cs161
Checking where the files are... /usr/home/gfot/toolchain/cs161-gcc-1.4/./gcc-3.3.2+cs161
******** Configuring gcc ********
Configuring for a i386-unknown-freebsd7.2 host.
Created "Makefile" in /usr/home/gfot/toolchain/cs161-gcc-1.4 using "mt-frag"
./config.status is unchanged
Configuring libiberty...
loading cache ../config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... (cached) makeinfo
checking for perl... (cached) perl
checking host system type... i386-unknown-freebsd7.2
checking build system type... i386-unknown-freebsd7.2
checking for ar... (cached) ar
checking for ranlib... (cached) ranlib
checking for gcc... (cached) gcc
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking whether gcc and cc understand -c and -o together... (cached) yes
checking for POSIXized ISC... no
checking for working const... (cached) yes
checking for inline... (cached) inline
checking for a BSD compatible install... (cached) /usr/bin/install -c
xhost-mkfrag is unchanged
checking how to run the C preprocessor... (cached) gcc -E
checking for sys/file.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for limits.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for malloc.h... (cached) no
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for time.h... (cached) yes
checking for sys/resource.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/mman.h... (cached) yes
checking for fcntl.h... (cached) yes
checking for alloca.h... (cached) no
checking for sys/pstat.h... (cached) no
checking for sys/sysmp.h... (cached) no
checking for sys/sysinfo.h... (cached) no
checking for machine/hal_sysinfo.h... (cached) no
checking for sys/table.h... (cached) no
checking for sys/sysctl.h... (cached) yes
checking for sys/systemcfg.h... (cached) no
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes
checking whether time.h and sys/time.h may both be included... (cached) yes
checking whether errno must be declared... (cached) no
checking for ANSI C header files... (cached) yes
checking for uintptr_t... (cached) yes
checking for pid_t... (cached) yes
checking whether the C compiler (gcc -g -O2 ) works... yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler... no
checking for asprintf... (cached) yes
checking for atexit... (cached) yes
checking for basename... (cached) yes
checking for bcmp... (cached) yes
checking for bcopy... (cached) yes
checking for bsearch... (cached) yes
checking for bzero... (cached) yes
checking for calloc... (cached) yes
checking for clock... (cached) yes
checking for ffs... (cached) yes
checking for getcwd... (cached) yes
checking for getpagesize... (cached) yes
checking for index... (cached) yes
checking for insque... (cached) yes
checking for memchr... (cached) yes
checking for memcmp... (cached) yes
checking for memcpy... (cached) yes
checking for memmove... (cached) yes
checking for memset... (cached) yes
checking for mkstemps... (cached) yes
checking for putenv... (cached) yes
checking for random... (cached) yes
checking for rename... (cached) yes
...
checking for working strncmp... (cached) yes
creating ./config.status
creating Makefile
creating testsuite/Makefile
creating config.h
config.h is unchanged
Configuring gcc...
loading cache ../config.cache
checking LIBRARY_PATH variable... ok
checking GCC_EXEC_PREFIX variable... ok
checking host system type... i386-unknown-freebsd7.2
checking target system type... mips-unknown-linux-gnu
checking build system type... i386-unknown-freebsd7.2
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works... yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking whether gcc and cc understand -c and -o together... (cached) yes
checking for gnatbind... no
checking for compiler driver that understands Ada... no
checking whether gcc accepts -Wno-long-long... yes
checking how to run the C preprocessor... (cached) gcc -E
checking for inline... (cached) inline
checking for volatile... yes
checking for long double... yes
checking for long long int... yes
checking for __int64... no
checking for built-in _Bool... yes
checking size of short... 2
checking size of int... 4
checking size of long... 4
checking size of long long... 8
checking execution character set... ASCII
checking whether make sets ${MAKE}... yes
checking whether a default assembler was specified... no
checking whether a default linker was specified... no
checking for GNU C library... no
checking for mawk... no
checking for gawk... gawk
checking whether ln works... yes
checking whether ln -s works... yes
checking for ranlib... (cached) ranlib
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... (cached) yes
checking for working stdbool.h... yes
checking whether string.h and strings.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes
checking for limits.h... (cached) yes
checking for stddef.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for time.h... (cached) yes
checking for fcntl.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/file.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/mman.h... (cached) yes
checking for sys/resource.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for sys/times.h... yes
checking for sys/stat.h... (cached) yes
checking for direct.h... no
checking for malloc.h... (cached) no
checking for langinfo.h... yes
checking for thread.h... no
checking for pthread.h... yes
checking for CHAR_BIT... yes
checking byte ordering... little-endian
checking floating point format... IEEE (little-endian)
checking for mktemp... yes
checking for makeinfo... (cached) makeinfo
checking for modern makeinfo... yes
checking for recent Pod::Man... yes
checking for flex... flex
checking for bison... bison
checking for collect2 libraries... none required
checking for library containing exc_resume... no
checking for library containing ldexp... none required
checking for preprocessor stringizing operator... yes
checking for inttypes.h... yes
checking for times... (cached) yes
checking for clock... (cached) yes
checking for dup2... yes
checking for kill... yes
checking for getrlimit... yes
checking for setrlimit... yes
checking for atoll... yes
checking for atoq... no
checking for sysconf... (cached) yes
checking for strsignal... (cached) yes
checking for putc_unlocked... yes
checking for fputc_unlocked... no
checking for fputs_unlocked... no
checking for fwrite_unlocked... no
checking for fprintf_unlocked... no
checking for getrusage... (cached) yes
checking for nl_langinfo... yes
checking for lstat... yes
checking for scandir... yes
checking for alphasort... yes
checking for gettimeofday... (cached) yes
checking for mmap... yes
checking for ssize_t... yes
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking whether the printf functions support %p... yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking for pid_t... (cached) yes
checking for vfork.h... (cached) no
checking for working vfork... (cached) yes
checking for iconv... no, consider installing GNU libiconv
checking whether getenv is declared... yes
checking whether atol is declared... yes
checking whether sbrk is declared... yes
checking whether abort is declared... yes
checking whether atof is declared... yes
checking whether getcwd is declared... yes
checking whether getwd is declared... yes
checking whether strsignal is declared... yes
checking whether putc_unlocked is declared... yes
checking whether fputs_unlocked is declared... no
checking whether fwrite_unlocked is declared... no
checking whether fprintf_unlocked is declared... no
checking whether strstr is declared... yes
checking whether errno is declared... yes
checking whether vasprintf is declared... yes
checking whether malloc is declared... yes
checking whether realloc is declared... yes
checking whether calloc is declared... yes
checking whether free is declared... yes
checking whether basename is declared... no
checking whether getopt is declared... yes
checking whether clock is declared... yes
checking whether getrlimit is declared... yes
checking whether setrlimit is declared... yes
checking whether getrusage is declared... yes
checking whether times is declared... yes
checking for struct tms... yes
checking for clock_t... yes
checking for .preinit_array/.init_array/.fini_array support... no
checking if mkdir takes one argument... no
checking for main in -lunwind... no
Please update *-*-freebsd* in gcc/config.gcc
```


----------



## aragon (Jan 21, 2010)

I'm guessing it depends on libunwind, but that library is not a part of FreeBSD, nor has it been ported it seems.

Have you tried installing libunwind manually?


----------



## Giorgos (Jan 22, 2010)

no, do i have to do something special to compile a library ( just some general notes - if any - regarding this subject; i downloaded the corresponding tar and give it a try ).

ps: i managed to compile the toolchain in cygwin by adding the ncurses-devel package.


----------

