Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Jul 2014 16:16:54 -0300
From: Carlos Breviglieri <carbrevi@...il.com>
To: musl@...ts.openwall.com
Subject: glfw - x11 and opengl

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

Perhaps the purest way to achieve what I want is to recompile X11 and OGL
with musl-gcc, but I don't think it is a viable alternative, for OGL
depends on the vendor (nvidia/ati/intel/mesa) dynamic libs. I do need to
distribute my software.

Moreover, I must manually tell musl-gcc wrapper to look for X11 and OGL
headers in /usr/include. 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?

Well, I guess it wasn't a quick question after all... I appreciate any
feedback.

Regards,

Carlos


boing:     file format elf64-x86-64
boing
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000403df0

Program Header:
    PHDR off    0x0000000000000040 vaddr 0x0000000000400040 paddr
0x0000000000400040 align 2**3
         filesz 0x0000000000000150 memsz 0x0000000000000150 flags r-x
  INTERP off    0x0000000000000190 vaddr 0x0000000000400190 paddr
0x0000000000400190 align 2**0
         filesz 0x0000000000000055 memsz 0x0000000000000055 flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000000400000 paddr
0x0000000000400000 align 2**21
         filesz 0x0000000000012c54 memsz 0x0000000000012c54 flags r-x
    LOAD off    0x0000000000013000 vaddr 0x0000000000613000 paddr
0x0000000000613000 align 2**21
         filesz 0x0000000000001420 memsz 0x0000000000001e10 flags rw-
 DYNAMIC off    0x0000000000013018 vaddr 0x0000000000613018 paddr
0x0000000000613018 align 2**3
         filesz 0x0000000000000220 memsz 0x0000000000000220 flags rw-
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**4
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Dynamic Section:
  NEEDED               libm.so.6
  NEEDED               libGL.so.1
  NEEDED               libGLU.so.1
  NEEDED               libX11.so.6
  NEEDED               libXrandr.so.2
  NEEDED               libXi.so.6
  NEEDED               libXxf86vm.so.1
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6
  INIT                 0x0000000000403348
  FINI                 0x000000000040ff77
  INIT_ARRAY           0x0000000000613000
  INIT_ARRAYSZ         0x0000000000000008
  FINI_ARRAY           0x0000000000613008
  FINI_ARRAYSZ         0x0000000000000008
  HASH                 0x00000000004001e8
  STRTAB               0x0000000000401778
  SYMTAB               0x00000000004006c8
  STRSZ                0x00000000000009fd
  SYMENT               0x0000000000000018
  DEBUG                0x0000000000000000
  PLTGOT               0x0000000000613238
  PLTRELSZ             0x0000000000000fd8
  PLTREL               0x0000000000000007
  JMPREL               0x0000000000402370
  VERNEED              0x00000000004022e0
  VERNEEDNUM           0x0000000000000003
  VERSYM               0x0000000000402176

Version References:
  required from libc.so.6:
    0x06969194 0x00 07 GLIBC_2.14
    0x09691974 0x00 06 GLIBC_2.3.4
    0x06969197 0x00 05 GLIBC_2.17
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libm.so.6:
    0x09691a75 0x00 03 GLIBC_2.2.5
  required from libpthread.so.0:
    0x09691a75 0x00 02 GLIBC_2.2.5

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.