[Olsr-dev] Makefiles patch for pthreads

Gianni Costanzi (spam-protected)
Fri Aug 24 09:57:30 CEST 2007


> But then I would activate -O2 per default and comment out the -g option.
> It
> doesn't fell right to have per default a "primarily debugging
> configuration".
> If someone develops and/or debugs, he can fix the options.

Yes, you are right... Since I'm developing code, I've forgot final
users, which are not interested in debugging olsrd :)

> Is the lack of synchronization is a problem or concern for the Bmf
> plugin
> (or the others)?

For the plugin I'm working on the lack of synchronization has been a
major issue, which I solved adding a lot of complexity to my plugin
(which is multi-threaded and which needs to access olsrd internal data
structures), since I didn't want to modify olsrd code.

>
> > - libraries should be specified before the source files.
>
> Why this?
> - It shouldn't really matter for shared libraries (*.so*)[0].
> - Static libraries (*.a) - which are merely an aggregation of *.o files
> -
>   must be placed after the objects (and in the correct order if they are
>   dependencies between libraries) because objects from the .a are only
> pulled
>   in from if there is an unresolved symbol at that point.
> If you look at make's default rules (`make -p /dev/null`), you will see
> that
> LDLIBS is also at the end of the commandline (and LDFLAGS is at the
> front).
> So I clearly think this is wrong.

Yes, again, you are right... reading carefully the GNU ld
documentation it is explained very well :)
"The  linker  will  search an archive only once, at the location where
it is specified on the command line.  If the archive defines a symbol
which was undefined in some object which appeared before the archive
on the command line, the linker will include the appropriate file(s)
from the archive.  However, an  undefined  symbol  in  an object
appearing later on the command line will not cause the linker to
search the archive again."

>
> > - $(CFLAGS) is missing when compiling/linking olsrd
>
> We have at that line no .c files there so that should not be needed.
> Or did I miss something?

Sorry.... it seems that the only useful info that I gave you was
adding the -pthread CFLAG :D
CFLAGS is not needed since we are only linking in that stage..

>
>         Bernd
>

Gianni

-- 
--------------------------------------------------------------------------------------------------------------
|  Gianni Costanzi ((spam-protected))
|       (http://utenti.lycos.it/giannicostanzi/)
|
|  Gentoo Documentation Project (GDP) Member - Italian Translator
|       (http://www.gentoo.org/proj/en/gdp/)
|
|  Free Software Foundation Member #3844 (www.fsf.org)
|       "Free Software is a matter of Liberty not price"
|
|  Sun Valley in Rock Staff Member (www.sunvalleyinrock.net/forum)
--------------------------------------------------------------------------------------------------------------




More information about the Olsr-dev mailing list