stat !

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
hamei
Posts: 10433
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

stat !

Unread postby hamei » Sun Sep 20, 2015 7:14 pm

I would like to build a static executable for portability ... no shared libaries, build it all into the executable. MIPSPro 7.4.4, Irix 6.5.21

Is this possible ? How ?
I spent a fortune on booze, birds, and fast cars ... the rest I just squandered

User avatar
foetz
Moderator
Moderator
Posts: 6546
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: stat !

Unread postby foetz » Sun Sep 20, 2015 9:10 pm

in most cases you don't wanna link system libs statically but only 3rd party such as libxml or whatever else doesn't come with a default installation. to do so you have 3 options:

1. put the archive files (.a) on the link line right after your object files (.o)
2. the libs in question are only static anyway. nothing to do then
3. explicitly tell the linker to link the mentioned stuff statically by using "-B static" on the link line

if you're going for option 3 make sure to change back to dynamic for system libs after the static parts. an example that combines all 3 options:

Code: Select all

cc proggy.c /usr/local/lib/libxml.a -B static -lcurl -lssl -B dynamic -lSgm -lXm -lXt -lX11 -lmalloc

here xml, ssl and curl are added to the resulting binary while the default irix libs remain dynamic. you can mix option 1 and 3 at will.
also note that static linking may require more libs on the link line than the dynamic counterparts so you might need a few runs before all deps are satisfied

User avatar
hamei
Posts: 10433
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

Re: stat !

Unread postby hamei » Mon Sep 21, 2015 2:12 am

foetz wrote:if you're going for option 3 make sure to change back to dynamic for system libs after the static parts. an example that combines all 3 options:

Code: Select all

cc proggy.c /usr/local/lib/libxml.a -B static -lcurl -lssl -B dynamic -lSgm -lXm -lXt -lX11 -lmalloc


Perfect ! thank you, thank you very much :)

Now ... ah ... would anyone with an Octane happen to have a zipped-up unix file ? I did gmake uninstall and fontforge helpfully rm /*-ed me. As root. Luckily there's not much in there and rm won't delete directories but my backup is from an O350. That won't work with an Octane, I presume ?

Meanwhile, we're going to enter the uptime competition :P
I spent a fortune on booze, birds, and fast cars ... the rest I just squandered

User avatar
nongrato
Posts: 215
Joined: Thu May 15, 2014 5:24 am
Location: SPb, RU
Contact:

Re: stat !

Unread postby nongrato » Mon Sep 21, 2015 4:42 am

hamei wrote:. would anyone with an Octane happen to have a zipped-up unix file ?


PM sent.
:Octane2: :320:

User avatar
hamei
Posts: 10433
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

Re: stat !

Unread postby hamei » Mon Sep 21, 2015 5:01 am

nongrato wrote:PM sent.

Thank you ! I think the backup is okay but you know how that goes ....
I spent a fortune on booze, birds, and fast cars ... the rest I just squandered

User avatar
nongrato
Posts: 215
Joined: Thu May 15, 2014 5:24 am
Location: SPb, RU
Contact:

Re: stat !

Unread postby nongrato » Mon Sep 21, 2015 5:16 am

hamei wrote:Thank you !.


;) you're welcome. Nice User-Agent btw.
:Octane2: :320:

User avatar
foetz
Moderator
Moderator
Posts: 6546
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: stat !

Unread postby foetz » Mon Sep 21, 2015 12:08 pm

let me guess:

Code: Select all

Mozilla 9.99 [en] (X11; U; Loonix V666 AppleWatch)

User avatar
hamei
Posts: 10433
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

Re: stat !

Unread postby hamei » Mon Sep 21, 2015 5:54 pm

foetz wrote:let me guess:

Code: Select all

Mozilla 9.99 [en] (X11; U; Loonix V666 AppleWatch)

Not exactly :P But we should make this a contest, see who can come up with the best user-agent :D
I spent a fortune on booze, birds, and fast cars ... the rest I just squandered


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 2 guests