Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Managed Libraries

Altera_Forum
Honored Contributor II
1,002 Views

I am running into a bit of a problem with the Managed Libraries. I have existing common code that I am trying to build into a library. But this code uses the types defined in alt_types.h. So, since this is part of the HAL, it won't build. This seems like a serious limitation. In the Software Dev, Guide it states that we should use these types and then Altera prevents us from using them in a library. I am totally off them mark here or should I just forget using Managed Libraries?

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
325 Views

I think there is a little bug in the library makefiles that prevents the inclusion of alt_types.h . It is in one of the topics I sent recently on the forum. 

 

go into components/altera_hal/build/lib.mk 

 

search the line 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

CPPFLAGS += -I.. -I$(GTF_GENERATED)                   

            $(foreach dir, $(HAL_INC_DIRS), -I$(dir))[/b] 

--- Quote End ---  

 

 

and change it in 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

CPPFLAGS += -I..                   

            $(foreach dir, $(HAL_INC_DIRS), -I$(dir))[/b] 

--- Quote End ---  

 

 

...and enjoy :-) 

 

... in general, the standard libraries will allow you to include only the header files into altera_hal and altera_nios2. 

 

If you need more, you need some more hacking in the library makefiles :-) 

 

bye 

 

PJ
0 Kudos
Altera_Forum
Honored Contributor II
325 Views

Thanks, I&#39;ll give it a try.

0 Kudos
Altera_Forum
Honored Contributor II
325 Views

Has this been reported as a bug to Altera? Paolo.gai&#39;s post is from 15 months ago, yet we also just encountered this problem still in NIOS 6.0SP1. 

 

It&#39;s amusing what goes wrong. When GTF_GENERATED is undefined the buggy line introduces a "-I" with no directory argument suffix. GCC then interprets this as an include directive using its space-separated syntax, and gobbles the the next valid -I<alteralib> directive as gibberish, thus removing the valid library path that ought to have been included. 

 

I&#39;m always loath to modify the system files for fear of breaking on the next upgrade, so we&#39;ve worked around this problem by predefining GTF_GENERATED as ".".
0 Kudos
Reply