Altera_Forum
Honored Contributor
20 years agoporting newlib
I downloaded newlib 1.14 and got it to compile but now I'm wondering how the NIOS build system decides where to get the libraries during linking. For now I'm just copying my rebuilt libc.a over the old one but I'd like to know how I can tell the linker to use my new newlib.
Does anyone know how to setup include paths and library search paths for the GNU stuff? For those of you interested in rebuilding newlib, there were a few catches. My tree is totally messed up now but next week I'll try a clean rebuild starting with a freshly untarred source tree and post the results here - I couldn't get the NIOS SDK shell to work with the new configure and make files from newlib so I installed the latest Cygwin and used that for rebuilding. My new Cygwin didn't have any cc or gcc so there was no danger of picking up the wrong compiler. - I had to set up the path and alias to nios2-elf-gcc but otherwise the build process worked with ../configure --target=nios2-elf after supplying a libc/machine directory and making the necessary changes to libc/include/machine/ieeefp.h - I copied the modifications Altera made to the host.configure but one of the# defines seems to have changed. We now need -DMALLOC_PROVIDED instead of -DMALLOC_LOCK_PROVIDED (or maybe both) - I had some difficulty with the libc/machine/nios2 directory. I copied over some other subdirectory and replaced setjmp.s. That seemed to do the trick Andrew