[CMake] Compiling x86 executable on amd64

John Doe ufnoise at gmail.com
Fri May 2 15:07:04 EDT 2008


Mathieu,

It is perfectly ok to redistribute libstdc++.  You put it in your
directory tree, not in the standard system location.

Setting LD_LIBRARY_PATH to the directory of your libstdc++ allows only
applications started in that shell environment to find it.  You can
use a wrapper script to set this environment variable and exec your
binary.  This is the same stuff that firefox has been doing for years
for all of their dependencies.

Use ldd on your binary to determine which shared libraries you link
against.  Use ldd on the shared libraries to determine the shared
libraries they link against.  Make sure that the appropriate libraries
are redistributed with your app.  Of course certain one's cannot be
redistributed since they are directly linked against your particular
kernel and would be useless to your customer.

Statically link as much as you can.  The p4 client works fine on my
gentoo box.  So does the intel compiler the last time I checked.  See
what libraries they redistribute.

To get around this issue, many vendors say which distributions are
supported by their application so they don't have to build and support
every linux distribution out there.

Creating a chroot jail (or using vmware) are other alternatives.

How is trying to help you redistribute linux applications make me a
Microsoft spy?  How is insulting your customers by saying they don't
know how to compile things not make you a Microsoft spy?

The hard reality is that it isn't easy to guarantee compatibility
across all of your applications.

How is g++ 4.3 that much of a step up from g++ 3.4?  Why not use the
intel compiler or the one from the portland group?

Good luck,

Juan


On Fri, May 2, 2008 at 1:50 PM, Mathieu Malaterre
<mathieu.malaterre at gmail.com> wrote:
> John,
>
>
>  On Fri, May 2, 2008 at 8:11 PM, John Doe <ufnoise at gmail.com> wrote:
>  >
>  > On Fri, May 2, 2008 at 12:54 PM, Mathieu Malaterre
>  >  <mathieu.malaterre at gmail.com> wrote:
>  >  > Hi there,
>  >  >
>  >  >   Not really a cmake issue, but people maybe know the answer here...
>  >  >  1.
>  >  >   I am trying to generate package for x86 linux platform, since I have
>  >  >  all the multilib (lib32 thingy) I thought this should be trivial to
>  >  >  cross compile for this target (this is not a true cross compilation as
>  >  >  the target can be run on the host sytem).
>  >  >
>  >  >  2.
>  >  >   What are the gcc flags to use the older glibc symbol so that I don't
>  >  >  get report of people telling: I cannot run your executable it says:
>  >  >
>  >  >   libstdc++.so.6: version `GLIBCXX_3.4.9' not found
>  >
>  >  As far as I know you can't.
>
>  =O ... of course you can. How do you think cmake binaries is working
>  on all kind of linux system, and even on my amd64 system via the i32
>  layer.
>
>
>  >  Options:
>  >  1. Give them a copy of your libstdc++.so.6 (find with "libstdc++.so.6)
>  >  and use LD_LIBRARY_PATH or LD_PRELOAD to tell where it is.
>
>  I am talking about packaging here. Shipping a libstdc++.6 that could
>  potentially override my user libstdc++ is clearly a real bad *bad*
>  idea !
>
>
>  >  2. Tell them to use the same os as you.
>
>  ...seriously. Are you some kind of Microsoft spy ? What I am asking is
>  trivial stuff, just cannot find the documentation. One straight
>  solution is get an old linux box myself and compile my package on
>  it... I do not have a spare box for that, nor do I want to do that.
>
>
>  >  3. Create some sort of chroot system to replicate all of their system libraries.
>
>  I was thinking that maybe runing vmware in XEN, in another system
>  emulation could be even better ...
>
>
>  >  4. Give them the source code.
>
>  make package != make package_source.
>
>  I know how to build source package. But you cannot seriously ask a
>  simple user to build an app like paraview to open a vtk file and then
>  never use paraview again ...
>
>  If I cannot get anything more usefull, I'll switch to using gcc 3.4.0
>  which is the oldest AFAIK wich implement CXX=ABI 2 for g++. I still
>  prefer my g++4.3 (better compilation time, better optimization...).
>
>  --
>  Mathieu
>


More information about the CMake mailing list