unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] foreign-library: fix darwin detection
@ 2021-09-02  5:27 Aleix Conchillo Flaqué
  2021-09-02  5:38 ` Aleix Conchillo Flaqué
  0 siblings, 1 reply; 4+ messages in thread
From: Aleix Conchillo Flaqué @ 2021-09-02  5:27 UTC (permalink / raw)
  To: guile-devel; +Cc: Aleix Conchillo Flaqué

* module/system/foreign-library.scm (system-library-extensions): fix
darwin host detection. darwin host types have "-darwin" but not
"-darwin-".
---
 module/system/foreign-library.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/system/foreign-library.scm b/module/system/foreign-library.scm
index d53e293ef..dc426385f 100644
--- a/module/system/foreign-library.scm
+++ b/module/system/foreign-library.scm
@@ -48,7 +48,7 @@
 
 (define system-library-extensions
   (cond
-   ((string-contains %host-type "-darwin-")
+   ((string-contains %host-type "-darwin")
     '(".bundle" ".so" ".dylib"))
    ((or (string-contains %host-type "cygwin")
         (string-contains %host-type "mingw")
-- 
2.33.0




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

* Re: [PATCH] foreign-library: fix darwin detection
  2021-09-02  5:27 [PATCH] foreign-library: fix darwin detection Aleix Conchillo Flaqué
@ 2021-09-02  5:38 ` Aleix Conchillo Flaqué
  2021-09-02  6:53   ` Aleix Conchillo Flaqué
  2021-09-02  7:22   ` lloda
  0 siblings, 2 replies; 4+ messages in thread
From: Aleix Conchillo Flaqué @ 2021-09-02  5:38 UTC (permalink / raw)
  To: guile-devel

Without this change dynamic libraries in macOS are not loaded
properly. This has happened since 3.0.6.

scheme@(guile-user)> %host-type
$1 = "x86_64-apple-darwin20.5.0"

--------------------------------

scheme@(guile-user)> (use-modules (git))
While compiling expression:
In procedure git_libgit2_init: Function not implemented

--------------------------------

scheme@(guile-user)> (use-modules (system foreign))
scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure load-foreign-library: file: "/usr/local/lib/libgit2",
message: "file not found"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>

--------------------------------

After this fix:

scheme@(guile-user)> (use-modules (system foreign))
scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
$2 = #<<foreign-library> filename: "/usr/local/lib/libgit2" handle:
#<pointer 0x7ffed3104ac0>>

On Wed, Sep 1, 2021 at 10:28 PM Aleix Conchillo Flaqué
<aconchillo@gmail.com> wrote:
>
> * module/system/foreign-library.scm (system-library-extensions): fix
> darwin host detection. darwin host types have "-darwin" but not
> "-darwin-".
> ---
>  module/system/foreign-library.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/module/system/foreign-library.scm b/module/system/foreign-library.scm
> index d53e293ef..dc426385f 100644
> --- a/module/system/foreign-library.scm
> +++ b/module/system/foreign-library.scm
> @@ -48,7 +48,7 @@
>
>  (define system-library-extensions
>    (cond
> -   ((string-contains %host-type "-darwin-")
> +   ((string-contains %host-type "-darwin")
>      '(".bundle" ".so" ".dylib"))
>     ((or (string-contains %host-type "cygwin")
>          (string-contains %host-type "mingw")
> --
> 2.33.0
>



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

* Re: [PATCH] foreign-library: fix darwin detection
  2021-09-02  5:38 ` Aleix Conchillo Flaqué
@ 2021-09-02  6:53   ` Aleix Conchillo Flaqué
  2021-09-02  7:22   ` lloda
  1 sibling, 0 replies; 4+ messages in thread
From: Aleix Conchillo Flaqué @ 2021-09-02  6:53 UTC (permalink / raw)
  To: guile-devel

And there are also more errors, for example in guile-gcrypt:

dyld: lazy symbol binding failed: Symbol not found: __gcry_check_version
  Referenced from: /usr/local/lib/libgcrypt.dylib
  Expected in: flat namespace

dyld: Symbol not found: __gcry_check_version
  Referenced from: /usr/local/lib/libgcrypt.dylib
  Expected in: flat namespace

This is because it's trying to find the symbol __gcry_check_version
but it doesn't take into account that in gcrypt symbols are prefixed
with an underscore.

I'm trying to understand why this is and how to fix it.

Aleix

On Wed, Sep 1, 2021 at 10:38 PM Aleix Conchillo Flaqué
<aconchillo@gmail.com> wrote:
>
> Without this change dynamic libraries in macOS are not loaded
> properly. This has happened since 3.0.6.
>
> scheme@(guile-user)> %host-type
> $1 = "x86_64-apple-darwin20.5.0"
>
> --------------------------------
>
> scheme@(guile-user)> (use-modules (git))
> While compiling expression:
> In procedure git_libgit2_init: Function not implemented
>
> --------------------------------
>
> scheme@(guile-user)> (use-modules (system foreign))
> scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> In procedure load-foreign-library: file: "/usr/local/lib/libgit2",
> message: "file not found"
>
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(guile-user) [1]>
>
> --------------------------------
>
> After this fix:
>
> scheme@(guile-user)> (use-modules (system foreign))
> scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
> $2 = #<<foreign-library> filename: "/usr/local/lib/libgit2" handle:
> #<pointer 0x7ffed3104ac0>>
>
> On Wed, Sep 1, 2021 at 10:28 PM Aleix Conchillo Flaqué
> <aconchillo@gmail.com> wrote:
> >
> > * module/system/foreign-library.scm (system-library-extensions): fix
> > darwin host detection. darwin host types have "-darwin" but not
> > "-darwin-".
> > ---
> >  module/system/foreign-library.scm | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/module/system/foreign-library.scm b/module/system/foreign-library.scm
> > index d53e293ef..dc426385f 100644
> > --- a/module/system/foreign-library.scm
> > +++ b/module/system/foreign-library.scm
> > @@ -48,7 +48,7 @@
> >
> >  (define system-library-extensions
> >    (cond
> > -   ((string-contains %host-type "-darwin-")
> > +   ((string-contains %host-type "-darwin")
> >      '(".bundle" ".so" ".dylib"))
> >     ((or (string-contains %host-type "cygwin")
> >          (string-contains %host-type "mingw")
> > --
> > 2.33.0
> >



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

* Re: [PATCH] foreign-library: fix darwin detection
  2021-09-02  5:38 ` Aleix Conchillo Flaqué
  2021-09-02  6:53   ` Aleix Conchillo Flaqué
@ 2021-09-02  7:22   ` lloda
  1 sibling, 0 replies; 4+ messages in thread
From: lloda @ 2021-09-02  7:22 UTC (permalink / raw)
  To: Aleix Conchillo Flaqué; +Cc: guile-devel

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


Patch is applied in 1f100a4f20c3a6e57922fb26fce212997e2a03cb, thanks.

However I cannot build Guile on macos at the moment bc of an error in lib/basename-lgpl.h, this seems caused by the last gnulib update :-\


> On 2 Sep 2021, at 07:38, Aleix Conchillo Flaqué <aconchillo@gmail.com> wrote:
> 
> Without this change dynamic libraries in macOS are not loaded
> properly. This has happened since 3.0.6.
> 
> scheme@(guile-user)> %host-type
> $1 = "x86_64-apple-darwin20.5.0"
> 
> --------------------------------
> 
> scheme@(guile-user)> (use-modules (git))
> While compiling expression:
> In procedure git_libgit2_init: Function not implemented
> 
> --------------------------------
> 
> scheme@(guile-user)> (use-modules (system foreign))
> scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> In procedure load-foreign-library: file: "/usr/local/lib/libgit2",
> message: "file not found"
> 
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(guile-user) [1]>
> 
> --------------------------------
> 
> After this fix:
> 
> scheme@(guile-user)> (use-modules (system foreign))
> scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
> $2 = #<<foreign-library> filename: "/usr/local/lib/libgit2" handle:
> #<pointer 0x7ffed3104ac0>>
> 
> On Wed, Sep 1, 2021 at 10:28 PM Aleix Conchillo Flaqué
> <aconchillo@gmail.com> wrote:
>> 
>> * module/system/foreign-library.scm (system-library-extensions): fix
>> darwin host detection. darwin host types have "-darwin" but not
>> "-darwin-".
>> ---
>> module/system/foreign-library.scm | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/module/system/foreign-library.scm b/module/system/foreign-library.scm
>> index d53e293ef..dc426385f 100644
>> --- a/module/system/foreign-library.scm
>> +++ b/module/system/foreign-library.scm
>> @@ -48,7 +48,7 @@
>> 
>> (define system-library-extensions
>>   (cond
>> -   ((string-contains %host-type "-darwin-")
>> +   ((string-contains %host-type "-darwin")
>>     '(".bundle" ".so" ".dylib"))
>>    ((or (string-contains %host-type "cygwin")
>>         (string-contains %host-type "mingw")
>> --
>> 2.33.0
>> 
> 


[-- Attachment #2: Type: text/html, Size: 4148 bytes --]

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

end of thread, other threads:[~2021-09-02  7:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  5:27 [PATCH] foreign-library: fix darwin detection Aleix Conchillo Flaqué
2021-09-02  5:38 ` Aleix Conchillo Flaqué
2021-09-02  6:53   ` Aleix Conchillo Flaqué
2021-09-02  7:22   ` lloda

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 read-only IMAP folder(s) and NNTP newsgroup(s).