|
From: Dean K. <kol...@qw...> - 2004-12-13 03:48:30
|
I reproduced the link problem with ./configure CFLAGS="-fPIC" and rebuilding from scratch. I did some reading of the gcc man page, and it seems that even functions that are explicitly inlined will not be inlined without optimizations turned on, unless you further specify that the function is to be inlined even without optimizations turned on. There are a lot of inlining options, but they're mostly to control implicit inlining and limiting inlining of large functions. It built when I used ./configure CFLAGS="-fPIC -O1" to turn on minimal optimization. Without -O dovlc.o was generated with an actual call to dv_peek_vlc, but there is no .o with a separate dv_peek_vlc that can be called, so the link failed. dv_peek_vlc was written to always be inlined. The problem wasn't the presence of -fPIC, it was the lack of -O. At 06:29 PM 12/12/2004, sean darcy wrote: >Dean Kolosiek wrote: >........... >>I can't reproduce the linking problem. dv_peek_vlc is an inlined function >>in vlc.h, so it should be >compiled into each .o that calls it, and not >>need to be linked. Something must be preventing the >compiler from >>inlining dv_peek_vlc into dovlc.o, but I don't see how that can happen. I >>don't think it's >related to the x86-64 code. > >Ok. I got it to build. The problem was I had a CFLAGS with fPIC. Took that >out, built like a charm. > >But, of course, that prompts the question: why does -fPIC not work? > >Does it build for you with fPIC? > >sean > > |