A static binary

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

A static binary

Rob Rohan-2
My apologies if I am using the wrong terms - I only dabble in C.

Is it possible to build sox as a single, self contained binary?  I've gotten most of what I need it to do installed and compiling, but if I try to run the binary on another system I run into problems (because of missing libraries is what I am thinking).

I am compiling with:

        ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
        make

and then trying to run the binary in .libs/sox directly.

I thought --enable-static would stop sox from requiring libraries, but now I think it's only keeping it from using _dynamic libraries_ not all external libraries.


Anyway, is it possible to build sox as a single, self contained binary?  Or any pointers in the right direction?


Cheers,
rob


P.S. somehow I feel a linker is involved...


             Rob Rohan (罗汉伦)
             http://robrohan.com
             http://twitter.com/robrohan


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

hendrikus godvliet
Rohan

Off topic but I lover your pic flash, I use it as a youtube list:


Hendrikus



On Mon, Jan 16, 2012 at 9:16 AM, Rob Rohan <[hidden email]> wrote:
My apologies if I am using the wrong terms - I only dabble in C.

Is it possible to build sox as a single, self contained binary?  I've gotten most of what I need it to do installed and compiling, but if I try to run the binary on another system I run into problems (because of missing libraries is what I am thinking).

I am compiling with:

       ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
       make

and then trying to run the binary in .libs/sox directly.

I thought --enable-static would stop sox from requiring libraries, but now I think it's only keeping it from using _dynamic libraries_ not all external libraries.


Anyway, is it possible to build sox as a single, self contained binary?  Or any pointers in the right direction?


Cheers,
rob


P.S. somehow I feel a linker is involved...


            Rob Rohan (罗汉伦)
            http://robrohan.com
            http://twitter.com/robrohan


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users



--




------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

Chris Bagwell
In reply to this post by Rob Rohan-2
Included with the source packet is a script called "mingwbuild.sh".
It is used to build and packet up the official sox.exe.  There is also
a cygwinbuild.sh but not used any more.

We do currently distribute 2 DLL's: zlib1.dll and libgomp-1.dll.  The
first is not needed if you disable the PNG support and the second is
not needed if you disable gomp support (parallel processing).

If you work at it hard enough, you could probably get zlib1 statically
linked inside the executable.  I forget now why we are distributing it
but probably has to do with how Fedora packages up their mingw
compiler (I cross compile the binary from Linux).

Chris

On Mon, Jan 16, 2012 at 2:16 AM, Rob Rohan <[hidden email]> wrote:

> My apologies if I am using the wrong terms - I only dabble in C.
>
> Is it possible to build sox as a single, self contained binary?  I've gotten most of what I need it to do installed and compiling, but if I try to run the binary on another system I run into problems (because of missing libraries is what I am thinking).
>
> I am compiling with:
>
>        ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
>        make
>
> and then trying to run the binary in .libs/sox directly.
>
> I thought --enable-static would stop sox from requiring libraries, but now I think it's only keeping it from using _dynamic libraries_ not all external libraries.
>
>
> Anyway, is it possible to build sox as a single, self contained binary?  Or any pointers in the right direction?
>
>
> Cheers,
> rob
>
>
> P.S. somehow I feel a linker is involved...
>
>
>             Rob Rohan (罗汉伦)
>             http://robrohan.com
>             http://twitter.com/robrohan
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

Rob Rohan-2
Thanks everyone - after Chris' suggestion I started to look through some of the build scripts, and it looks like the Mac OSX build script is doing exactly what I want.  I am trying to do this on linux so hopefully it shouldn't be too hard to manipulate that script into a linux version.

Thanks for the pointer


On Jan 16, 2012, at 7:46 AM, Chris Bagwell wrote:

> Included with the source packet is a script called "mingwbuild.sh".
> It is used to build and packet up the official sox.exe.  There is also
> a cygwinbuild.sh but not used any more.
>
> We do currently distribute 2 DLL's: zlib1.dll and libgomp-1.dll.  The
> first is not needed if you disable the PNG support and the second is
> not needed if you disable gomp support (parallel processing).
>
> If you work at it hard enough, you could probably get zlib1 statically
> linked inside the executable.  I forget now why we are distributing it
> but probably has to do with how Fedora packages up their mingw
> compiler (I cross compile the binary from Linux).
>
> Chris
>
> On Mon, Jan 16, 2012 at 2:16 AM, Rob Rohan <[hidden email]> wrote:
>> My apologies if I am using the wrong terms - I only dabble in C.
>>
>> Is it possible to build sox as a single, self contained binary?  I've gotten most of what I need it to do installed and compiling, but if I try to run the binary on another system I run into problems (because of missing libraries is what I am thinking).
>>
>> I am compiling with:
>>
>>        ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
>>        make
>>
>> and then trying to run the binary in .libs/sox directly.
>>
>> I thought --enable-static would stop sox from requiring libraries, but now I think it's only keeping it from using _dynamic libraries_ not all external libraries.
>>
>>
>> Anyway, is it possible to build sox as a single, self contained binary?  Or any pointers in the right direction?
>>
>>
>> Cheers,
>> rob
>>
>>
>> P.S. somehow I feel a linker is involved...
>>
>>
>>             Rob Rohan (罗汉伦)
>>             http://robrohan.com
>>             http://twitter.com/robrohan
>>
>>
>> ------------------------------------------------------------------------------
>> RSA(R) Conference 2012
>> Mar 27 - Feb 2
>> Save $400 by Jan. 27
>> Register now!
>> http://p.sf.net/sfu/rsa-sfdev2dev2
>> _______________________________________________
>> Sox-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users


             Rob Rohan (罗汉伦)
             http://robrohan.com
             http://twitter.com/robrohan


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

dennis garber
In reply to this post by Rob Rohan-2
With windows, anyone with level 1 computer knowlege and a few minutes, can do this with autohotkey.com, using fileinstall and their compiler.  The lack of an ahk linux equivalent or port is enough to keep me using windows.  If python is so good, you could download python, navigate the help as a newbie, and compile your first exe in 35 minutes, like I did once with ahk, while waiting for wife to do her makeup.

On Mon, Jan 16, 2012 at 3:16 AM, Rob Rohan <[hidden email]> wrote:
My apologies if I am using the wrong terms - I only dabble in C.

Is it possible to build sox as a single, self contained binary?  I've gotten most of what I need it to do installed and compiling, but if I try to run the binary on another system I run into problems (because of missing libraries is what I am thinking).

I am compiling with:

       ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
       make

and then trying to run the binary in .libs/sox directly.

I thought --enable-static would stop sox from requiring libraries, but now I think it's only keeping it from using _dynamic libraries_ not all external libraries.


Anyway, is it possible to build sox as a single, self contained binary?  Or any pointers in the right direction?


Cheers,
rob


P.S. somehow I feel a linker is involved...


            Rob Rohan (罗汉伦)
            http://robrohan.com
            http://twitter.com/robrohan


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

Rob Rohan-2
That's great Dennis!

I did get this working using the Mac OSX build script as a base, and compiling all the dependencies into static libraries before building the final binary. 

Is the script something I can contribute back to the sox project? Or is this a rare thing to do?  It's more of a process than code...



On Jan 18, 2012, at 6:15 AM, dennis garber <[hidden email]> wrote:

With windows, anyone with level 1 computer knowlege and a few minutes, can do this with autohotkey.com, using fileinstall and their compiler.  The lack of an ahk linux equivalent or port is enough to keep me using windows.  If python is so good, you could download python, navigate the help as a newbie, and compile your first exe in 35 minutes, like I did once with ahk, while waiting for wife to do her makeup.

On Mon, Jan 16, 2012 at 3:16 AM, Rob Rohan <[hidden email]> wrote:
My apologies if I am using the wrong terms - I only dabble in C.

Is it possible to build sox as a single, self contained binary?  I've gotten most of what I need it to do installed and compiling, but if I try to run the binary on another system I run into problems (because of missing libraries is what I am thinking).

I am compiling with:

       ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
       make

and then trying to run the binary in .libs/sox directly.

I thought --enable-static would stop sox from requiring libraries, but now I think it's only keeping it from using _dynamic libraries_ not all external libraries.


Anyway, is it possible to build sox as a single, self contained binary?  Or any pointers in the right direction?


Cheers,
rob


P.S. somehow I feel a linker is involved...


            Rob Rohan (罗汉伦)
            http://robrohan.com
            http://twitter.com/robrohan


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

Sergei Steshenko-2
In reply to this post by Rob Rohan-2
Yes, it is possible, though not automatically (with existing 'configure').


The adhoc way is:

1) build it the automatic way, saving 'make' screen output;
2) locate in the 'make' screen output calls to linker - it most likely will be calls to gcc or g++, but with no compilation involved, i.e. inputs are .o files and libraries

3) extract the command lines;
4) modify them to use only static libraries - pay special attention to

       -Bstatic
       -dn
       -non_shared
       -static

in 'man ld';

5) in order to avoid library order problems read 'man ld' paying special attention to:
"

       -( archives -)
       --start-group archives --end-group
".

It takes time - one needs a number of iterations to find all the needed libraries, but the approach works.

Regards,
  Sergei.




----- Original Message -----

> From: Rob Rohan <[hidden email]>
> To: [hidden email]
> Cc:
> Sent: Monday, January 16, 2012 10:16 AM
> Subject: [SoX-users] A static binary
>
> My apologies if I am using the wrong terms - I only dabble in C.
>
> Is it possible to build sox as a single, self contained binary?  I've gotten
> most of what I need it to do installed and compiling, but if I try to run the
> binary on another system I run into problems (because of missing libraries is
> what I am thinking).
>
> I am compiling with:
>
>     ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
>     make
>
> and then trying to run the binary in .libs/sox directly.
>
> I thought --enable-static would stop sox from requiring libraries, but now I
> think it's only keeping it from using _dynamic libraries_ not all external
> libraries.
>
>
> Anyway, is it possible to build sox as a single, self contained binary?  Or any
> pointers in the right direction?
>
>
> Cheers,
> rob
>
>
> P.S. somehow I feel a linker is involved...
>
>
>              Rob Rohan (罗汉伦)
>              http://robrohan.com
>              http://twitter.com/robrohan
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: A static binary

Rob Rohan-2
Sorry, I must not have sent the last email correctly...

I have this working well, I used the OSX    script included in the source.

Would it be of use to submit the code back into sox? It's more of a
process than code, but others might want to do the same thing.

Sent from my cassette tape

On Jan 19, 2012, at 11:04 AM, Sergei Steshenko <[hidden email]> wrote:

> Yes, it is possible, though not automatically (with existing 'configure').
>
>
> The adhoc way is:
>
> 1) build it the automatic way, saving 'make' screen output;
> 2) locate in the 'make' screen output calls to linker - it most likely will be calls to gcc or g++, but with no compilation involved, i.e. inputs are .o files and libraries
>
> 3) extract the command lines;
> 4) modify them to use only static libraries - pay special attention to
>
>        -Bstatic
>        -dn
>        -non_shared
>        -static
>
> in 'man ld';
>
> 5) in order to avoid library order problems read 'man ld' paying special attention to:
> "
>
>        -( archives -)
>        --start-group archives --end-group
> ".
>
> It takes time - one needs a number of iterations to find all the needed libraries, but the approach works.
>
> Regards,
>   Sergei.
>
>
>
>
> ----- Original Message -----
>> From: Rob Rohan <[hidden email]>
>> To: [hidden email]
>> Cc:
>> Sent: Monday, January 16, 2012 10:16 AM
>> Subject: [SoX-users] A static binary
>>
>> My apologies if I am using the wrong terms - I only dabble in C.
>>
>> Is it possible to build sox as a single, self contained binary?  I've gotten
>> most of what I need it to do installed and compiling, but if I try to run the
>> binary on another system I run into problems (because of missing libraries is
>> what I am thinking).
>>
>> I am compiling with:
>>
>>     ./configure --with-gsm --with-mp3 --enable-static --with-distro=Testing
>>     make
>>
>> and then trying to run the binary in .libs/sox directly.
>>
>> I thought --enable-static would stop sox from requiring libraries, but now I
>> think it's only keeping it from using _dynamic libraries_ not all external
>> libraries.
>>
>>
>> Anyway, is it possible to build sox as a single, self contained binary?  Or any
>> pointers in the right direction?
>>
>>
>> Cheers,
>> rob
>>
>>
>> P.S. somehow I feel a linker is involved...
>>
>>
>>              Rob Rohan (罗汉伦)
>>              http://robrohan.com
>>              http://twitter.com/robrohan
>>
>>
>> ------------------------------------------------------------------------------
>> RSA(R) Conference 2012
>> Mar 27 - Feb 2
>> Save $400 by Jan. 27
>> Register now!
>> http://p.sf.net/sfu/rsa-sfdev2dev2
>> _______________________________________________
>> Sox-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users