This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline function


Hi,

I don't know if this helps, but at least under Linux you have to turn optimization on to have the inline functions work. You could try the option -O or -O1 or -O2.

Andres



in an header file there is: __inline__ void ios_di(void) __attribute__ ((always_inline)); __inline__ void ios_ei(void) __attribute__ ((always_inline));

extern __inline__ void ios_di(void)
{
  asm ("orc.b #-128:8,ccr");
}
extern __inline__ void ios_ei(void)
{
  asm ("andc.b #127:8,ccr");
}


I obtain no error in compilation, but when I link:


C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.o: In function
`ios_init': C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:139:
undefined reference to `_ios_di'
C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:195: undefined
reference to `_ios_ei'
C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.o: In function
`ios_semwait': C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:375:
undefined reference to `_ios_di'
C:/Lavori/quadrante/provegnuh8/provegnuh8/ios_kern.c:377: undefined
reference to `_ios_ei'

command lines are:
h8300-elf-gcc-wrapper.exe -c -x c -o
"C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.o"-g3
-Wa,-ahls="C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\ios_kern.lst"
-Wall

h8300-elf-ld-wrapper.exe -L
"c:\hew\tools\kpit\gnuh8-elf\v0301\h8300-elf\lib\gcc-lib\h8300-elf\3.2-
GNUH8_v0301\h8300s"-L "c:\hew\tools\kpit
gnuh8-elf\v0301\h8300-elf\h8300-elf\lib\h8300s"
-o"C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\provegnuh8.x"
<Default>-Map
"C:\Lavori\quadrante\provegnuh8\provegnuh8\Debug\provegnuh8.map"
-e_ios_init -( -l "m" -l "c" -l "gcc" -)




Any idea?


--
Massimiliano Cialdi
cialdi at firenze dot net
m dot cialdi at oksys dot it
cialdi at control dot dsi dot unifi dot it


_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: http://messenger.yupimsn.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]