- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Static gcc compilation in HP-UX 10.20/11.x
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 05:39 AM
тАО07-09-2003 05:39 AM
I'm currently trying to develop a toolkit of static binaries for HP-UX 10.20 and 11.x. I can build a majority of the binaries I need, but they all come out dynamically linked. Anybody have any advice for me besides using "gcc -static"? I'm very new to HP-UX, so I could be missing some fundamental concept (e.g. it's impossible) that's standing in my way..
any help/suggestions????
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 06:49 AM
тАО07-09-2003 06:49 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
Sorry, maybe it 's me, But what you mean by static binaries? Do you mean the link between library and binaries?
If that 's the case, then you need to link to static library in order to have static binary.
If you don't specify static library, linker will link to the shared library rather than static library.
__Mehdi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 07:26 AM
тАО07-09-2003 07:26 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
Basically, what I'm doing is taking the source for a bunch of different regular binaries (cp,mv,dd, all that stuff) and compiling it statically. (no dependence on any outside files, not dynamically linked).
Just to clarify: when I do--
$ ldd (mybinary)
I want to see:
'not a dynamic executable'
hope this clears it up :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2003 07:39 AM
тАО07-09-2003 07:39 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2003 10:20 AM
тАО08-04-2003 10:20 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2003 12:27 AM
тАО08-05-2003 12:27 AM
SolutionCan you provide more details:
* What is the full command line you are using to build the executable?
* What shared libraries end up being linked in?
* Can you run "chatr" on one of the executables and post the output?
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2003 12:29 AM
тАО08-05-2003 12:29 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
from man gcc :
Linker Options
-llibrary -nostartfiles -nostdlib -static -shared -symbolic
-Xlinker option -Wl,option -u symbol
and
-static
On systems that support dynamic linking, this prevents linking
with the shared libraries. On other systems, this option has no
effect.
i think the -static seems to be what you want.
hth
Benoit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2003 12:31 AM
тАО08-05-2003 12:31 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
If 'LDFLAGS' does not contain '-static', the final exacutable is still dynamic :(
[ Who just found out this morning in building a static less-381-pa1.1 with pcre for use on SEP's machine. It's now available on my site ]
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2003 07:23 AM
тАО08-05-2003 07:23 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
Basically, I'm trying to do this:
http://www.netadmintools.com/part279.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2003 07:25 AM
тАО08-05-2003 07:25 AM
Re: Static gcc compilation in HP-UX 10.20/11.x
to keep it all in one place, and avoid clicking links.. here's an example:
[blah@asdf coreutils-5.0]$ ./configure
[blah@asdf coreutils-5.0]$ make CC="gcc -static"
[urbana@hazel binutils]$ ./configure
[urbana@hazel binutils]$ make -e LDFLAGS=-all-static
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-07-2003 10:25 PM
тАО08-07-2003 10:25 PM
Re: Static gcc compilation in HP-UX 10.20/11.x
1.
# env CFLAGS=-static LDFLAGS=-static ./configure ...
2.
# export CONFIG_SITE=/tmp/static.pol
# cat >/tmp/static.pol
CFLAGS=-static
LDFLAGS=-static
^D
#
All GNU configure scripts will use the script set in $CONFIG_SITE when it exists. You can make several. Here the head of mine:
a5:/pro/3gl/GNU 103 > head -20 Policy.sh
# $CONFIG_SITE -> /pro/3gl/GNU/policy.sh
echo "OSTYPE: $OSTYPE, CC: $CC, CFLAGS: $CFLAGS, LDFLAGS: $LDFLAGS"
if [ $OSTYPE = hpux -a ${CC:-x} = x ]; then
CC=cc
# CFLAGS="-Ae -fast +Onolimit"
LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
CFLAGS="-Ae +O2 +Onolimit $CFLAGS"
if [ $HOST = d3 ]; then
CFLAGS=$CFLAGS" +DAportable"
fi
elif [ $OSTYPE = aix -a ${CC:-x} = x ]; then
CC=cc
CFLAGS="-O2 -qmaxmem=204800"
elif [ $OSTYPE = osf1 ]; then
CC=cc
CFLAGS="-O2 -std"
elif [ ${CC:-x} = gcc -o ${CC:-x} = gcc32 -o ${CC:-x} = gcc64 ]; then
CFLAGS="-O4 $CFLAGS"
else
a5:/pro/3gl/GNU 104 >
Enjoy, have FUN! H.Merijn