Re: dlsym() on implicit loaded symbols

2006-07-16 Thread Roland Dittel



Simon 'corecode' Schubert wrote:

Roland Dittel wrote:

Hi all,

We have a issue with dlsym() on symbols imported by a library that was 
loaded with dlopen(). Our code loads the libssl with dlopen() and then 
do a dlsym() on several symbols. This works for all symbols exported 
by libssl itself but fails for symbols exported by libcrypto. Libssl 
is dynamically linked to libcrypto and should be loaded for libssl. I 
did a truss and the FreeBSD loader loads libcrypto but does not read 
anything from the file pointer.


could you post a sample code fragment which illustrates the problem you 
are seeing?


Sure, attached is a simple example that tries to load the symbol 
CRYPTO_set_id_callback from a libssl handle. The symbol is located in 
libcrypto and NOT in libssl. Because libssl is dynamically linked to 
libcrypto I would expect the loader is able to find the symbol, but 
that's not the case on freebsd.




cheers
 simon

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]

Re: dlsym() on implicit loaded symbols

2006-07-16 Thread Simon 'corecode' Schubert

Roland Dittel wrote:
We have a issue with dlsym() on symbols imported by a library that 
was loaded with dlopen(). Our code loads the libssl with dlopen() and 
then do a dlsym() on several symbols. This works for all symbols 
exported by libssl itself but fails for symbols exported by 
libcrypto.

[..]

  func = dlsym(handle, CRYPTO_set_id_callback);


you have to use RTLD_DEFAULT instead of handle, but I agree, this is not in 
conformance with SUSv3:

   The dlsym() function shall search for the named symbol in all objects loaded 
automatically as a result of loading the object referenced by handle (see 
dlopen()). Load ordering is used in dlsym() operations upon the global symbol 
object. The symbol resolution algorithm used shall be dependency order as 
described in dlopen().

   The RTLD_DEFAULT and RTLD_NEXT flags are reserved for future use.

Note in all objects loaded automatically.  Good catch!

cheers
 simon

--
Serve - BSD +++  RENT this banner advert  +++ASCII Ribbon   /\
Work - Mac  +++  space for low €€€ NOW!1  +++  Campaign \ /
Party Enjoy Relax   |   http://dragonflybsd.org  Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz   Mail + News   / \



signature.asc
Description: OpenPGP digital signature


Re: dlsym() on implicit loaded symbols

2006-07-16 Thread Roland Dittel


Am 16.07.2006 um 14:33 schrieb Simon 'corecode' Schubert:


Roland Dittel wrote:
We have a issue with dlsym() on symbols imported by a library that 
was loaded with dlopen(). Our code loads the libssl with dlopen() 
and then do a dlsym() on several symbols. This works for all 
symbols exported by libssl itself but fails for symbols exported by 
libcrypto.

[..]

  func = dlsym(handle, CRYPTO_set_id_callback);


you have to use RTLD_DEFAULT instead of handle, but I agree, this is 
not in conformance with SUSv3:


That's it. Thank you very much.

Roland



   The dlsym() function shall search for the named symbol in all 
objects loaded automatically as a result of loading the object 
referenced by handle (see dlopen()). Load ordering is used in dlsym() 
operations upon the global symbol object. The symbol resolution 
algorithm used shall be dependency order as described in dlopen().


   The RTLD_DEFAULT and RTLD_NEXT flags are reserved for future use.

Note in all objects loaded automatically.  Good catch!

cheers
 simon

--
Serve - BSD +++  RENT this banner advert  +++ASCII Ribbon   /\
Work - Mac  +++  space for low €€€ NOW!1  +++  Campaign \ /
Party Enjoy Relax   |   http://dragonflybsd.org  Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz   Mail + News   / \



___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Bob Richards
Hi Folks:

I believe this is a hacker issue, at least any possible solution is.

I recently moved from Linux to FreeBSD as my primary work environment.
My development system of choice is FreePascal. I installed FPC-2.0.2
from the official FreePascal distribution tar ball, and all
compiled/installed without a hitch; all my CVS sources compile and run.

My next step was to install Lazarus, the FPC IDE, and here is where I
have run into troubles.

A tar-ball install ran well until Lazarus was being Linked. The errors were:

the following libraries were not found by ld: glib12, gdk12, and gtk12.

a grep -r in the FPC-2.0.2 source tree revealed the problems, in every
case of:

packages/extra/ glib, gtk, and  gdk the linklib statements were wrong thus:

 {$ifdef FreeBSD}
   gtkdll='gtk12';
   {$linklib gtk12}

So, I created a patch to fix the above constructs to:

  {$ifdef FreeBSD}
 gtkdll='gtk-12';
 {$linklib gtk-12}

For all three libraries; since freebsd names these libraries with a -

I recompiled and reinstalled FPC-2.0.2 with the patches applied,
re-tested the compiler; all OK!

I went back to the Lazarus source tree gmake clean; gmake and received
the following error:

  Free Pascal Compiler version 2.0.2 [2006/07/14] for i386
  Copyright (c) 1993-2005 by Florian Klaempfl
  Target OS: FreeBSD/ELF for i386
  Compiling lazarus.pp
  Linking ../lazarus
  /usr/bin/ld: cannot find -lgdk_pixbuf
  lazarus.pp(113,1) Error: Error while linking

a locate gdk_pixbuf finds: /usr/X11R6/lib/libgdk_pixbuf-2.0

So, at this point I just sym-linked my libgdk_pixbuf-2.0 to
libgdk_pixbuf: ln -s libgdk_pixbuf-2.0.a libgdk_pixbuf.a

and ran gmake again, only to produce:

Linking ../lazarus
/usr/home/bob/lazarus/lcl/units/i386-freebsd/gtk/gtkint.o(.text+0x6f65):
In function `DATASOURCEINITIALIZE':
gtkobject.inc:2309: undefined reference to `gdk_pixbuf_get_from_drawable'

Many many more undefined reference to something missing in  gdk_pixbuf.

so: freebsd's stock-installed gdk_pixbuf does not contain the functions
needed! So, I went to ports and found ruby18-gdk_pixbuf2-0.14.1 a make
install provided gdk_pixbuf2.so but no gdk_pixbuf2.a !! I find it
odd that no provision is provided to link to this lib!

Funny! I moved away from Linux mainly because of Library-Hell issues :-)

Any thoughts on this would be greatly appreciated. I seem to have run
out of things to try here. Surely someone has successfully compiled
Lazarus on freebsd

Bob

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Steve Kargl
On Sun, Jul 16, 2006 at 03:51:05PM -0400, Bob Richards wrote:
 
 I recently moved from Linux to FreeBSD as my primary work environment.
 My development system of choice is FreePascal. I installed FPC-2.0.2
 from the official FreePascal distribution tar ball, and all
 compiled/installed without a hitch; all my CVS sources compile and run.
 
 My next step was to install Lazarus, the FPC IDE, and here is where I
 have run into troubles.
 

Are you aware of the Ports Collections?

See /usr/ports/lang/fpc and /usr/ports/editors/fpc-ide


-- 
Steve
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Ivan Voras

Are you aware of the Ports Collections?

See /usr/ports/lang/fpc and /usr/ports/editors/fpc-ide


Lazarus != FPC-IDE, despite parent post :)

It's inconvenient to use lang/fpc port with Lazarus becuase sometime 
there's a need to recompile runtime libraries.


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Steve Kargl
On Mon, Jul 17, 2006 at 12:01:43AM +0200, Ivan Voras wrote:
 Are you aware of the Ports Collections?
 
 See /usr/ports/lang/fpc and /usr/ports/editors/fpc-ide
 
 Lazarus != FPC-IDE, despite parent post :)

I realized this.  However, the OP had 2 problems.  
He had problems installing fpc because of library 
issues.  lang/fpc will remove those problem.  The
2nd problem was with Lazarus.  If he had a working
coherent fpc, it may be easier to build Lazarus.
He could even submit a port.
 
-- 
Steve
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Error Api OpenLdap

2006-07-16 Thread Eder

Hi all,

I am having problems to use the API of ldap simply when I compile the code
says that the archive does not exist.

#include ldap.h
int main(void)
{
}

% cc test.c
test.c:2:18: ldap.h: No such file or directory

Being that the archive is in include.

% cat /usr/local/include/ldap.h

Somebody knows what it can be !

Ederson de Moura
--
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Bob Richards
Steve Kargl wrote:

 
 Are you aware of the Ports Collections?
 

Yup.

 See /usr/ports/lang/fpc and /usr/ports/editors/fpc-ide
 
 

The first is a binary-only install (I need the full sources), the second
is the text-mode IDE, not Lazarus.

Bob


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Bob Richards
Steve Kargl wrote:

 
 I realized this.  However, the OP had 2 problems.  
 He had problems installing fpc because of library 
 issues.  

No, I had a problem compiling Lazarus because of an incorrect library
call in FPC. FPC installed/compiled correctly from the freepascal
_sources_ (Not available via ports). What's called sources in ports is
nothing more than a collection of pre-built binaries and libs.

To compile Lazarus, you need FPC-2.0.2 source tree,


 lang/fpc will remove those problem.  

Whether or not the pre-built ports FPC has the proper libs compiled in
or not is meaningless, since I need a good source tree. The only way to
get one of those on freebsd is to manually patch the freepascal sources.

Do you know of a freebsd-patched FPC-2.0.2 source?

 2nd problem was with Lazarus.  If he had a working
 coherent fpc, it may be easier to build Lazarus.
 He could even submit a port.
  

I will submit a port if I can get Lazarus to compile. What's needed to
compile Lazarus is a proper 2.0.2 source tree (binaries won't do), and a
Lazarus source tree which properly calls for available/proper freebsd
libs. Neither of which exist AFAIK.

Bob


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: LinkLib Issues In freebsd Lazarus

2006-07-16 Thread Jeremy Messenger

On Sun, 16 Jul 2006 14:51:05 -0500, Bob Richards [EMAIL PROTECTED] wrote:

snip

I went back to the Lazarus source tree gmake clean; gmake and received
the following error:

  Free Pascal Compiler version 2.0.2 [2006/07/14] for i386
  Copyright (c) 1993-2005 by Florian Klaempfl
  Target OS: FreeBSD/ELF for i386
  Compiling lazarus.pp
  Linking ../lazarus
  /usr/bin/ld: cannot find -lgdk_pixbuf
  lazarus.pp(113,1) Error: Error while linking

a locate gdk_pixbuf finds: /usr/X11R6/lib/libgdk_pixbuf-2.0

So, at this point I just sym-linked my libgdk_pixbuf-2.0 to
libgdk_pixbuf: ln -s libgdk_pixbuf-2.0.a libgdk_pixbuf.a

and ran gmake again, only to produce:

Linking ../lazarus
/usr/home/bob/lazarus/lcl/units/i386-freebsd/gtk/gtkint.o(.text+0x6f65):
In function `DATASOURCEINITIALIZE':
gtkobject.inc:2309: undefined reference to `gdk_pixbuf_get_from_drawable'

Many many more undefined reference to something missing in  gdk_pixbuf.


libgdk_pixbuf-2.0 is a GTK2 stuff, not GTK1. If it's GTK1  
(libgdk_pixbuf.a) is what you need, install graphics/gdk-pixbuf. The 'ln  
-s libgdk_pixbuf-2.0.a libgdk_pixbuf.a' is incorrect and will causing more  
break stuff.



so: freebsd's stock-installed gdk_pixbuf does not contain the functions
needed! So, I went to ports and found ruby18-gdk_pixbuf2-0.14.1 a make
install provided gdk_pixbuf2.so but no gdk_pixbuf2.a !! I find it
odd that no provision is provided to link to this lib!


It is a Ruby binding, which it is not a gdk_pixbuf library that you are  
looking for.


Cheers,
Mezz


--
[EMAIL PROTECTED]  -  [EMAIL PROTECTED]
FreeBSD GNOME Team  -  FreeBSD Multimedia Hat (ports, not src)
http://www.FreeBSD.org/gnome/  -  [EMAIL PROTECTED]
http://wiki.freebsd.org/multimedia  -  [EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Error Api OpenLdap

2006-07-16 Thread Dan Nelson
In the last episode (Jul 16), Eder said:
 I am having problems to use the API of ldap simply when I compile the
 code says that the archive does not exist.
 
 #include ldap.h
 int main(void)
 {
 }
 
 % cc test.c
 test.c:2:18: ldap.h: No such file or directory

You want cc -I/usr/local/include test.c, and if you intend on linking
to the library, you will also need to add -L/usr/local/lib -lldap.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]