Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 2019 14:08:27 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        Gleb Popov <arrowd@freebsd.org>, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Linking Linux library to FreeBSD program.
Message-ID:  <62bb6535-f970-a2fd-634c-63fbc7890325@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
> Hello hackers@
>
> In my quest for CUDA on FreeBSD I managed to compile a simple CUDA program
> using native clang. However, it required linking to libcudart.so from Linux
> CUDA distribution.
>
> As you can guess, running this binary results in a segfault - a.out being a
> FreeBSD binary tries to load libcudart.so Linux library, which in turn
> pulls Linux libc.so.
>
> What course of action could be taken in this situation? My plan is to
> generate a native wrapper library for libcudart.so in which every exported
> function would call Linux binary linked to real libcudart.so and route
> function arguments via RPC or some other mechanism. This looks awful for
> sure, but I don't see any other solutions.
Hi;

FWIW, I don't know how much alive it still is, but Debian kFreeBSD[1] 
had a native port of glibc to FreeBSD.

Cheers,

Pedro.

[1] https://www.debian.org/ports/kfreebsd-gnu/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?62bb6535-f970-a2fd-634c-63fbc7890325>