mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Carlos Breviglieri <carbrevi@gmail.com>
To: musl@lists.openwall.com
Subject: Re: glfw - x11 and opengl
Date: Thu, 3 Jul 2014 18:22:26 -0300	[thread overview]
Message-ID: <CABX9KDuzs6dxDKh72JFbX1t8FYS+K-qVCs+5OM7g-RkxyZOHVA@mail.gmail.com> (raw)
In-Reply-To: <20140703205039.GB179@brightrain.aerifal.cx>

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

Rich, thanks for clarifying those points.

I believe the reasonable approach now is to use musl on the numerical side
of things and leave the more system-wide apps (GUI) using the default libc.
The whole point of this exercise is to evaluate the benefits of static
linking with numerical intensive computations, possibly in parallel
(clusters). And that does not involve the graphical side of things.

I didn't know of lxc and it looks interesting to research latter.. I also
keep an eye on aboriginal linux for other architectures testings, which,
just now, announced basic musl compatibility... sweet.

Thanks,

Carlos Breviglieri
Instituto Tecnologico de Aeronautica
Brazil


On Thu, Jul 3, 2014 at 5:50 PM, Rich Felker <dalias@libc.org> wrote:

> On Thu, Jul 03, 2014 at 04:16:54PM -0300, Carlos Breviglieri wrote:
> > Hi there, I have a quick, basic user question:
> >
> > I develop a numerical simulation software and everything builds nicely
> with
> > musl (ok, had to patch some pkgs - hdf5, mpich3, cgns, libscotch). In the
> > end I want to research how static/shared vs gnu/musl affects runtime and
> > efficiency of the numerical solver. My software also has an user
> interface
> > (basically OpenGL and custom widget toolkit) which uses glfw (
> www.glfw.org).
> >
> > I sucessfully build glfw library using musl-gcc, both as static and
> shared
> > lib. However, the example binaries and my GUI need linking to X11 and
> > OpenGL (OGL) libs. The problem is that, in my system (Arch linux) and
> most
> > distros I can think of, X11 and OpenGL are dynamic libs that use gnu
> > libc.so (ldd shows that).
> >
> > My question is: Is it possible to "tell" libX11.so and libGL.so to use
> musl
> > libc.so instead, you know at runtime? I tried the LD_PRELOAD trick and it
> > didn't work (ldd on executable prints lots of empty lines...). A portion
> of
> > the output of "objdump -x" is below.
> >
> > I understand that musl libc might not be 100% compatible with gnu libc if
> > such thing is possible... Just trying to grasp the possibility. Maybe
> some
> > ld-musl-ARCH trickery? I wouldn't like to maintain a mixed build
> toolchain
> > (musl for the numerical package and gnu libc for the GUI stuff).
>
> In general, you want to avoid doing this. The goal is to eventually
> have enough compatibility to get most "important" binary-only modules
> that people actually want to use to work, and whatever else is easy,
> but the more glibc-linked libraries you try to use, the more chance
> there is for things to go spectacularly wrong.
>
> Ideally you should have a full set of musl-linked library files for
> all of the ones that are open source, and only attempt to use binary
> compatibility for the few that you can't recompile or get musl-native
> versions for.
>
> > Moreover, I must manually tell musl-gcc wrapper to look for X11 and OGL
> > headers in /usr/include.
>
> The whole point of the musl-gcc wrapper is to prevent gcc from looking
> in /usr/include, /usr/lib, etc.
>
> > Obviously it finds gnu libc include folder and mix
> > things to a failed compilation. I circunvented this problem by creating
> > soft links to X11 and GL headers folders into another path and include
> that
> > path during compilation. Any better/correct way to do this?
>
> Yes, building them against musl and installing them in the same
> alternate prefix you installed musl in.
>
> Alternatively, you might try using a musl-based distro like Alpine,
> possibly inside your regular distro by means of lxc.
>
> Rich
>

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

  reply	other threads:[~2014-07-03 21:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 19:16 Carlos Breviglieri
2014-07-03 20:50 ` Rich Felker
2014-07-03 21:22   ` Carlos Breviglieri [this message]
2014-07-04  0:14     ` Laurent Bercot
2014-07-04  0:21       ` Josiah Worcester
2014-07-04  2:40       ` Samuel Holland
2014-07-04  3:25         ` Rich Felker
2014-07-04  5:19           ` Aboriginal musl support Isaac Dunham
2014-07-04  5:46             ` Rich Felker
2014-07-04 12:33               ` Carlos Breviglieri
2014-07-08  0:38           ` glfw - x11 and opengl Rob Landley
2014-07-08  0:43             ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABX9KDuzs6dxDKh72JFbX1t8FYS+K-qVCs+5OM7g-RkxyZOHVA@mail.gmail.com \
    --to=carbrevi@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).