Dear Ferenc,

The problem occurs during linking of nsthreadtest, which is a utility 
for testing and not needed for the operations of naviserver. 
Nevertheless, it should certainly work.... and it does work for me.

when i go to the directory naviserver/nsthread and issue there

    rm *.o
    rm nsthreadtest
    make

i see
    /bin/rm -Rf libnsthread.so
    gcc -shared -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC  
-pipe -m64  -I../include -I"/usr/local/ns/include"  -DHAVE_CONFIG_H  
-L../nsthread -L../nsd -L../nsdb -o libnsthread.so error.o master.o 
memory.o mutex.o cslock.o rwlock.o reentrant.o sema.o thread.o tls.o 
time.o pthread.o fork.o signal.o winthread.o   -L/usr/local/ns/lib 
-ltcl8.5 -ldl -lgcc_s  -lieee -lm  -Wl,--export-dynamic  
-L/usr/local/ns/lib -Wl,-rpath,:/usr/local/ns/lib
gcc -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC  -pipe -m64  
-I../include -I"/usr/local/ns/include"  -DHAVE_CONFIG_H   -c -o 
nsthreadtest.o nsthreadtest.c
    /bin/rm -Rf nsthreadtest
    gcc -L../nsthread -L../nsd -L../nsdb -o nsthreadtest nsthreadtest.o 
-lpthread  libnsthread.so -L/usr/local/ns/lib -ltcl8.5 -ldl -lgcc_s  
-lieee -lm  -Wl,--export-dynamic  -L/usr/local/ns/lib 
-Wl,-rpath,:/usr/local/ns/lib

i.e. the program "nsthreadtest" links correctly.

Notice, that the default complile steps on my machine don't include as 
your case the option "-fvisibility=hidden".

My Machine data:
    gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC)
    Linux alice.wu-wien.ac.at 3.2.2-1.fc16.x86_64 #1 SMP Thu Jan 26 
03:21:58 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
    ./configure --prefix=/usr/local/ns --enable-threads 
--with-tcl=/usr/local/ns/lib --enable-64bit


Notice the following difference:
library libnsthread.so (and all *.o components) built with 
-fvisibility=hidden
   $ nm libnsthread.so | fgrep Ns_Tls
      0000000000002b20 t Ns_TlsAlloc
      0000000000002c00 t Ns_TlsGet
      0000000000002ba0 t Ns_TlsSet

ibrary libnsthread.so (and all *.o components) built without 
-fvisibility=hidden
   $ nm libnsthread.so | fgrep Ns_Tls
      0000000000004260 T Ns_TlsAlloc
      0000000000004360 T Ns_TlsGet
      00000000000042f0 T Ns_TlsSet

You see, the external symbols are only included in the .so-file without 
the hidden visibility.
The question is, where is the "-fvisibility=hidden" coming from. Have 
you added it manually to the Makefile?
If so, why?

-gustaf neumann


Am 14.02.12 08:24, schrieb Kulcsár Ferenc:
> Hello!
>
> When I compile naviserver-4.99.4 the following error occures:
>
> gcc -shared -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC  -pipe 
> -fvisibility=hidden -m64  -I../include -I"/home/feri/tanul/include"  
> -DHAVE_CONFIG_H  -L../nsthread -L../nsd -L../nsdb -o libnsthread.so error.o 
> master.o memory.o mutex.o cslock.o rwlock.o reentrant.o sema.o thread.o tls.o 
> time.o pthread.o fork.o signal.o winthread.o   -L/home/feri/tanul/lib 
> -ltcl8.6 -ldl -lgcc_s  -lieee -lm  -Wl,--export-dynamic  
> -L/home/feri/tanul/lib -Wl,-rpath,:/home/feri/tanul/lib
> gcc -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC  -pipe 
> -fvisibility=hidden -m64  -I../include -I"/home/feri/tanul/include"  
> -DHAVE_CONFIG_H   -c -o nsthreadtest.o nsthreadtest.c
> /bin/rm -Rf nsthreadtest
> gcc -L../nsthread -L../nsd -L../nsdb -o nsthreadtest nsthreadtest.o -lpthread 
>  libnsthread.so -L/home/feri/tanul/lib -ltcl8.6 -ldl -lgcc_s  -lieee -lm  
> -Wl,--export-dynamic  -L/home/feri/tanul/lib -Wl,-rpath,:/home/feri/tanul/lib
> nsthreadtest.o: In function `Pthread':
> nsthreadtest.c:(.text+0x19): undefined reference to `Ns_TlsSet'
> nsthreadtest.c:(.text+0x25): undefined reference to `Ns_MutexLock'
> nsthreadtest.c:(.text+0x47): undefined reference to `Ns_CondWait'
> nsthreadtest.c:(.text+0x5d): undefined reference to `Ns_MutexUnlock'
> nsthreadtest.c:(.text+0x67): undefined reference to `Ns_MasterLock'
> ......
>
> The compilation environment is:
>
> $ uname -a
> Linux archlap.aneder.bel 3.2.5-1-ARCH #1 SMP PREEMPT Tue Feb 7 08:34:36 CET 
> 2012 x86_64 Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz GenuineIntel 
> GNU/Linux
> Archlinux
>
> $ ./configure --prefix=/home/feri/tanul --enable-threads --enable-shared 
> --with-tcl=/home/feri/tanul/lib --enable-dependency-tracking
>
> $ make -v
> GNU Make 3.82
> Built for x86_64-unknown-linux-gnu
>
> $ gcc -vhi
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
> Target: x86_64-unknown-linux-gnu
> Configured with: /build/src/gcc-4.6-20120120/configure --prefix=/usr 
> --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man 
> --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ 
> --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared 
> --enable-threads=posix --with-system-zlib --enable-__cxa_atexit 
> --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch 
> --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id 
> --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold 
> --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold 
> --disable-multilib --disable-libssp --enable-checking=release
> Thread model: posix
> gcc version 4.6.2 20120120 (prerelease) (GCC)
>
> glibc-2.15
>
> Any help is appreciated.
>
> TIA
>
> feri
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> naviserver-devel mailing list
> naviserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/naviserver-devel

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to