views:

45

answers:

1

We are getting these constraint errors wherver OSAF calls like m_NCS_SEL_OBJ_ZERO(&nSelObjSet) is called in our code. This is while cross compiling using tilera compiler - tile-g++. With g++ it always compiles fine. Any pointers would be helpful.

Note: m_NCS_SEL_OBJ_ZERO is a macro and replaced by FD_ZERO

Sample Code:

// initialise and set selection object set
m_NCS_SEL_OBJ_ZERO(&nSelObjSet);
m_NCS_SEL_OBJ_SET(nMdsSelObj, &nSelObjSet);**

Errors are as follows:

/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/ConfigManagerThread.cxx:
"/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/ConfigManagerThread.cxx", line 103: error:
          unknown asm constraint letter 'c'
         m_NCS_SEL_OBJ_ZERO(&nSelObjSet);
         ^

"/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/ConfigManagerThread.cxx", line 103: error:
          unknown asm constraint letter 'D'
         m_NCS_SEL_OBJ_ZERO(&nSelObjSet);
         ^

"/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/ConfigManagerThread.cxx", line 103: error:
          unknown asm constraint letter 'a'
         m_NCS_SEL_OBJ_ZERO(&nSelObjSet);
         ^

"/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/ConfigManagerThread.cxx", line 110: error:
          unknown asm constraint letter 'q'
             if (m_NCS_SEL_OBJ_ISSET(nMdsSelObj, &nSelObjSet))
                 ^

4 errors detected in the compilation of "/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/ConfigManagerThread.cxx".
/u/TILERA/STACK/DEV/lte/lte_enb/enb_cfgmgr/src/EnbCfgMgr.cxx:

Arun L.

A: 

The problem is that your cross-compiled build is picking up headers from the host system, rather than headers that are suitable for the target.

These "unknown" asm constraint letters are i386-specific ones that are used in glibc's i386-specific definitions of FD_ZERO() and FD_ISSET().

Matthew Slattery
Yes, cross-compiler was picking up the host headers. Now it is corrected to pick up target header for FD_ZERO and compilation is through. Matthew, I thank you for the answer.
arun