Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHi Ken,
This is highlighting something that has never been complete in the legacy SDK: certain C "stub" routines that are usually provided separate from the GNU tool & newlib library distribution. In Nios I, we did not include code for these routines either, just empty subroutine declarations to avoid linker warnings (CYA statement: the Nios I s/w development literature called these out and mentioned what wasn't implemented). This was done because, in Nios I, the routines just weren't needed. We had implemented our own 'custom' printf/sprintf/fprintf etc (which was easy without a filesystem). Going forward into Nios II, it was decided to do things 'right' in terms of C support and thus the HAL library was born - HAL includes things like open/close/fstat, etc., and file-IO type operation is supported. This is used in device access, printf(), etc., but more importantly, the support is there for future OS and filesystem support. Now the legacy SDK, on the other hand, was designed to carry over s/w support from Nios I, nothing more: this means that the open/close/fstat routines, etc., are still not supported. The difference: in Nios I we had a C file, nios_cstubs.c, which had the empty subroutines for these.. in the Nios II legacy SDK, these "stubs" don't exist, and hence the link warnings.