www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - recls on linux -> lots of unresolved symbols

reply andre <afo zlug.org> writes:
hello *,

playing with recls on linux gives me lots of unresolved symbols
during linking.

e.g.
	...
	Recls_CloseDetails 4
	Recls_CopyDetails 8
	...

searching libphobos shows that the symbols are defined as

[/pkg/dmd/lib] nm libphobos.a.orig|grep Recls_C
...
         U Recls_CloseDetails 4
         U Recls_CopyDetails 8
000000f0 T Recls_CloseDetails
00000100 T Recls_CopyDetails
...

reason is, that these symbols are defined in std/recls.d as

extern (Windows)
{
	...
	private void Recls_CloseDetails(in recls_info_t fileInfo);
	private recls_rc_t Recls_CopyDetails(in recls_info_t fileInfo, in recls_info_t
*pinfo);
	...
}

changing it to 'extern (C)' compiles to the - expected - symbols

[/pkg/dmd/lib]nm libphobos.a|grep Recls_C 
...
         U Recls_CloseDetails
         U Recls_CopyDetails
000000f0 T Recls_CloseDetails
00000100 T Recls_CopyDetails
...

and linking succeeds now.

any comments (Matthew ?) ?

thanks for your help!

ps: if anyone cares - i'm using dmd 0.97 on slackware 10.0
-- 
// Andre  -> afo <at> zlug <dot> org
Jul 30 2004
parent reply "Matthew" <admin.hat stlsoft.dot.org> writes:
Andre

[comments embedded]

"andre" <afo zlug.org> wrote in message
news:slrncgkc9a.2ap.afo sam.fornacon.org...
 hello *,

 playing with recls on linux gives me lots of unresolved symbols
 during linking.

 e.g.
 ...
 Recls_CloseDetails 4
 Recls_CopyDetails 8
 ...

 searching libphobos shows that the symbols are defined as

 [/pkg/dmd/lib] nm libphobos.a.orig|grep Recls_C
 ...
          U Recls_CloseDetails 4
          U Recls_CopyDetails 8
 000000f0 T Recls_CloseDetails
 00000100 T Recls_CopyDetails
 ...

 reason is, that these symbols are defined in std/recls.d as

 extern (Windows)
 {
 ...
 private void Recls_CloseDetails(in recls_info_t fileInfo);
 private recls_rc_t Recls_CopyDetails(in recls_info_t fileInfo, in recls_info_t
*pinfo);
 ...
 }

 changing it to 'extern (C)' compiles to the - expected - symbols

 [/pkg/dmd/lib]nm libphobos.a|grep Recls_C
 ...
          U Recls_CloseDetails
          U Recls_CopyDetails
 000000f0 T Recls_CloseDetails
 00000100 T Recls_CopyDetails
 ...

 and linking succeeds now.

 any comments (Matthew ?) ?

I've known about this and similar issues for a while. I made a significant update for D quite a while ago, and send it through to Walter, but it's not been put in. I keep asking, but ... big-W, can we put it in? Please.
 thanks for your help!

 ps: if anyone cares - i'm using dmd 0.97 on slackware 10.0

I care. A lot! In my entirely unbiased opinion, I think recls is a great library, and I'm saddened the D community is not making more use of it. It's partly my fault, of course, since I didn't do any D-compatible documentation. (It is Doxygenated, but that's also a bit stuck <blush> I'm hoping to get dfilter to work with version(), but time's a killer ...) If you've got it working, then no worries, but you can also obtain the latest from http://recls.org/ Cheers Matthew
Jul 30 2004
parent reply andre <afo zlug.org> writes:
Hello Matthew,

first  - thank you very much for your very fast reply !

i run into another issue with the recls stuff in the 0.97 release,
- looks like ShortFile stuff isnt availabe on Linux ?!
- does the Entry.IsLink() works only on Windows ?!

i will try the latest recls from your site later,

a question to the installation - is it enough to put the .o files
into libphobos and recls into the d std dir ?

In digitalmars.D.bugs, you wrote:
 Andre

 [comments embedded]

 I've known about this and similar issues for a while.

 I made a significant update for D quite a while ago, and send it through to
Walter, but it's not been put in. I keep
 asking, but ...

 big-W, can we put it in?

 Please.


 thanks for your help!

 ps: if anyone cares - i'm using dmd 0.97 on slackware 10.0

I care. A lot! In my entirely unbiased opinion, I think recls is a great library, and I'm saddened the D community is not making more use of it. It's partly my fault, of course, since I didn't do any D-compatible documentation. (It is Doxygenated, but that's also a bit stuck <blush> I'm hoping to get dfilter to work with version(), but time's a killer ...)

usually i'm using plain opendir/readdir/closedir combo for this case but this my code has to work on windows and i'm not very familar with the win32 api. thats why i tried recls. looks very poweful. more power than i need ;-) what i dont like is the dependency to libsupc++ on linux but thats the tribut you have to pay writing in c++ ... greetings -- // Andre -> afo <at> zlug <dot> org
Jul 30 2004
parent reply "Matthew" <admin.hat stlsoft.dot.org> writes:
"andre" <afo zlug.org> wrote in message
news:slrncgkhpd.2nj.afo sam.fornacon.org...
 Hello Matthew,

 first  - thank you very much for your very fast reply !

You're welcome. :)
 i run into another issue with the recls stuff in the 0.97 release,
 - looks like ShortFile stuff isnt availabe on Linux ?!

Correct. I have an arguably minority view on cross-platform source. I believe that common functionality should be available in as platform-independent a fashion as possible, but platform-specific aspects should only be available for the platform for which they'll meaningfully work. Since UNIX has no concept of the hideous short-file stuff, recls does not have it outside the Win32 version.
 - does the Entry.IsLink() works only on Windows ?!

Yes and no. The function is callable, but will always return false. Links on Win32 only work on NT 5+ (2000 + XP), and they are a very simplistic implementation, whereby they reference count file entries at a low level. There's no easy way to detect whether something is a link (other than using a second attribute stream).
 i will try the latest recls from your site later,

 a question to the installation - is it enough to put the .o files
 into libphobos and recls into the d std dir ?

I guess so, but cannot say definitively off the top of my head. Right at this minute, you're the world's authority on recls linking. ;)
 In digitalmars.D.bugs, you wrote:
 Andre

 [comments embedded]

 I've known about this and similar issues for a while.

 I made a significant update for D quite a while ago, and send it through to
Walter, but it's not been put in. I keep
 asking, but ...

 big-W, can we put it in?

 Please.


 thanks for your help!

 ps: if anyone cares - i'm using dmd 0.97 on slackware 10.0

I care. A lot! In my entirely unbiased opinion, I think recls is a great library, and I'm saddened the D community


 not making more use of it. It's partly my fault, of course, since I didn't do
any D-compatible documentation. (It is
 Doxygenated, but that's also a bit stuck <blush> I'm hoping to get dfilter to
work with version(), but time's a


 ...)

usually i'm using plain opendir/readdir/closedir combo for this case but this my code has to work on windows and i'm not very familar with the win32 api. thats why i tried recls. looks very poweful. more power than i need ;-)

I think you should go for recls. If you don't specify the recursive flag, then you get logically the same behaviour as with readdir(), but the Entry instances returned have all the information to hand.
 what i dont like is the dependency to libsupc++ on linux
 but thats the tribut you have to pay writing in c++ ...

That's a fair point. My counter is that most "big" applications for the foreseeable future will be hybrids of D/C/C++, so you'll be likely including it anyway. 100% D applications is quite a way off, IMO. In any case, it's a case of paying a little for the power of recls. Currently recls supports FTP searching on Win32, and updating the D mapping (and the other mappings: Ruby, C#, COM, STL) were done very simply. If there were separate implementations of recls for each language, that would not be the case. btw, if you know the FTP enumeration APIs for Linux, please give me a shout, as I want to support it for Linux soon. Cheers Matthew
Jul 30 2004
parent andre <afo zlug.org> writes:
On 2004-07-30, Matthew <admin.hat stlsoft.dot.org> wrote:

 - does the Entry.IsLink() works only on Windows ?!

Yes and no. The function is callable, but will always return false.

any chance to map this on linux/unix to the symlink stuff ?! recls_api_unix.cpp: Recls_IsFileLink() { ... return S_ISLNK(fileInfo->attributes); }
 Links on Win32 only work on NT 5+ (2000 + XP), and they are a very simplistic
implementation, whereby they reference
 count file entries at a low level. There's no easy way to detect whether
something is a link (other than using a second
 attribute stream).

 i will try the latest recls from your site later,

 a question to the installation - is it enough to put the .o files
 into libphobos and recls into the d std dir ?

I guess so, but cannot say definitively off the top of my head.

tried it (1.5.2) and run into this : [src/phobos/std]dmd -c recls.d recls.d(121): variable platform_not_discriminated conflicts with recls.platform_not_discriminated at recls.d(86) recls.d(255): identifier 'recls_filesize_t' is not defined
 Right at this minute, you're the world's authority on recls linking. ;)

question on this : is this good or not sooo good ?! ;-) SCNR ;-)
 In any case, it's a case of paying a little for the power of recls. Currently
recls supports FTP searching on Win32, and
 updating the D mapping (and the other mappings: Ruby, C#, COM, STL) were done
very simply. If there were separate
 implementations of recls for each language, that would not be the case.

 btw, if you know the FTP enumeration APIs for Linux, please give me a shout,
as I want to support it for Linux soon.

what do you mean with ^^^^^^^^^^^^^^^^^^^^ ?! greetings -- // Andre -> afo <at> zlug <dot> org // // "Why do I get this urge to go bowling everytime I see Tux?" ;-)
Jul 30 2004