Re: Statically linking and figuring out the build system

Chuck Atkins <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <CAOXZzG4koXYGodDykJdQzS4ci3viAb1BMfrnALDZbq83x4HtKw@mail.gmail.com>
Hi Reepca,

I want to compile llvmpipe and get a nice, shiny, libGL.so that I can
> toss on another machine I have little control over


This is a pretty typical use case and a well exercised one so you should be
in well-tested waters here.


>
> ran ./configure, ran "make linux-llvm" like
> the instructions said, and got the message
>
> make: *** No rule to make target 'llvm-linux'.  Stop.
>

Just 'make' with no target name should be sufficient.



> - How to get a statically-linked libGL.so when building with make
>

You'll need to clarify that some.  libGL.so is by it's very nature a shared
library so static doesn't apply there.  If you mean a fully static library,
i.e. libGL.a, then you--enable-static shoudl do that.  However, I suspect
what you actually want is to compile in the llvm libraries statically and
still get a shared libGL.so.  In that case, I believe
--disable-llvm-shared-libs is what you're looking for.  I typically use the
following configuration for a bare-bones libGL.so with llvmpipe (these are
the binaries we ship with ParaView):

$ ./configure \
  --prefix=<INSTALL_DIR>                                    \
  --enable-opengl --disable-gles1 --disable-gles2           \
  --disable-va --disable-gbm --disable-xvmc --disable-vdpau \
  --enable-shared-glapi                                     \
  --disable-dri --with-dri-drivers=                         \
  --enable-llvm --disable-llvm-shared-libs                  \
  --with-gallium-drivers=swrast                             \
  --disable-egl --disable-gbm                               \
  --disable-gallium-osmesa --enable-glx --with-platforms=x11

Some of those options are automatic but I like to be explicit with them so
know for sure how they'll end up configuring.  The end result is a libGL.so
with relatively few dependencies that should be available just about
everywhere at runtime:

$ readelf -d libGL.so
[chuck.atkins@hal9000 lib]$ readelf -d libGL.so

Dynamic section at offset 0x180aac8 contains 39 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libX11.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libXext.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libtinfo.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library:
[ld-linux-x86-64.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
...

I also typically build on a RHEL6 mahcine wth GCC4.9, and then the
resulting binary seems to be able to work everywhere (RHEL7, Ubuntu, SLES,
etc.).

- Chuck

- How to build llvmpipe with make
> - Most importantly, where can I find up-to-date information about this
> stuff if not at mesa3d.org?
>
> Thanks.
> _______________________________________________
> mesa-users mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-users
>

_______________________________________________
mesa-users mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.