caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Bug in libunix.a + Patch
@ 2012-07-20 14:45 Keyan
  2012-07-20 16:32 ` Xavier Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Keyan @ 2012-07-20 14:45 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

Hi,

_envrion was not found, when linking libunix.a to a library on Mac OS X:

Undefined symbols for architecture x86_64:
  "_environ", referenced from:
      _unix_execvpe in libunix.a(execvp.o)
      _unix_environment in libunix.a(envir.o)

I added the following lines:

#ifdef __APPLE__ 
#include <crt_externs.h> 
#define environ (*_NSGetEnviron()) 
#else 
 extern char **environ; 
#endif 

to the flies:

otherlibs/unix/envir.c
otherlibs/unix/execvp.c

as they it was suggested here:

http://trac.macports.org/browser/trunk/dports/lang/hugs98/files/patch-packages-base-include-HsBase.h.diff?rev=81676

patches are attached to this email.

best,
Keyan


[-- Attachment #2: envir-patch.txt --]
[-- Type: text/plain, Size: 153 bytes --]

22a23,31
> 
> #ifdef __APPLE__ 
> #include <crt_externs.h> 
> #define environ (*_NSGetEnviron()) 
> #else 
>  extern char **environ; 
> #endif 
>    
> 

[-- Attachment #3: execvp-patch.txt --]
[-- Type: text/plain, Size: 156 bytes --]

24a25,34
> 
> #ifdef __APPLE__ 
> #include <crt_externs.h> 
> #define environ (*_NSGetEnviron()) 
> #else 
>  extern char **environ; 
> #endif 
>    
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-20 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 14:45 [Caml-list] Bug in libunix.a + Patch Keyan
2012-07-20 16:32 ` Xavier Leroy
2012-07-20 17:13   ` Keyan
2012-07-20 18:49     ` Benedikt Meurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).