Altera_Forum
Honored Contributor
14 years agoGlobal Pointer problem with linker under Nios tools 11.0sp1
I'm attempting to port a very large C++ project (about 1000 source files) from Nios tools version 9.0 (where it builds successfully) to version 11.0sp1. The project is built using the command line tools.
Under version 11, the build fails with a linker error: /opt/altera/11.0sp1/nios2eds/bin/gnu/H-i686-pc-linux-gnu/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/libstdc++.a(locale.o): In function `std::locale::id::_M_id() const': /build/swbuild/SJ/nightly/11.0sp1/208/l32/work/ip/sopc/app/gnu/BUILD/gnu/build-0-gcc.nios2-elf.i686-pc-linux-gnu/nios2-elf/libstdc++-v3/src/../../../../src/gcc-4.1/libstdc++-v3/src/locale.cc:436: warning: Unable to reach (null) (at 0x00e77e74) from the global pointer (at 0x00d217f0) because the offset (1402500) is out of the allowed range, -32678 to 32767. I think we encountered a similar problem several years ago with an earlier version of the Altera tools, and the application makefile already has the -G0 flag set to turn off the use of the Global Pointer Register. I've also added to flag to our bsp settings, using: --set hal.make.bsp_cflags_user_flags -G0 Something, somewhere still seems to be accessing the Global Pointer Register for this error to occur, but I can't work out how to turn it off. Has anyone else encountered this problem ?