- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Linking 32 and 64 bit code. Can it be done?
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
Forums
Discussions
Discussions
Discussions
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
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
02-20-2004 03:34 AM
02-20-2004 03:34 AM
Our developers have hit a wall. We have a legacy data acquisition library that is only available as a 32-bit version. We also have a database library that only is available as 64-bit. Our problem is that we MUST use both and the developers are convinced this is not possible. Of course, the customer was told that this would be no problem at all. Does anyone have a workaround for this? I have searched all the man pages and the entire ITRC but haven't found anything other than it can't be done. The 32-bit library was developed on ANSI C for HP-UX 10.20. It works perfectly on HP-UX 11.11 by itself. The database library also works perfectly by itself. THey just can't be made to link or work together.
Please help!!
Thanks,
Derek
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2004 03:38 AM
02-20-2004 03:38 AM
Re: Linking 32 and 64 bit code. Can it be done?
Use, shared memory, pipes, sockets or even files, but HP-UX does not allow linking of mixed 32 and 64bit objects.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2004 03:42 AM
02-20-2004 03:42 AM
Re: Linking 32 and 64 bit code. Can it be done?
May be you can have some shared memory and the applications writing to that region and signalled back and forth when data available.
But too generic a solution.
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2004 03:51 AM
02-20-2004 03:51 AM
SolutionSplit the task into two components, a 64-bit executable and a 32-bit executable. Because mixing 32-bit and 64-bit IPCS can be tricky (you have to be very careful) I would fall back on plain old pipes.
I would launch the 64-bit application and then have it do a pair of pipe() calls, followed by a fork(), and finally exec() a 32-bit child process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2004 04:28 AM
02-20-2004 04:28 AM
Re: Linking 32 and 64 bit code. Can it be done?
Thanks,
Derek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2004 06:36 AM
02-20-2004 06:36 AM
Re: Linking 32 and 64 bit code. Can it be done?
Pay attention to the Start_uproc function.
Use it like this:
cc = Start_uproc("my32bitexe",1,"arg1 arg2 arg3");
if (cc == 0)
{
/* all is well */
}
That creates a pair of fdes on the parent process, one for output and the other for input, and on the child ("my32bitexe") these pipes are connected to stdin and stdout.
The dup() system call is leveraged. Dup returns the lowest file descriptor available so that the child can close(0) to close stdin and then dup() the pipe file descriptor and because dup returns to lowest avail file descriptor, stdin (0) can now be assigned to the pipe file descriptor. Stdout (fdes 1) is handled exactly the same.
There is a Send_Uproc function that is used like this:
cc = Send_Uproc("my32bitexe",1,"string1","string2",string3);
it always expect 3 string values to be sent to a child although they might be null strings);
Send_uproc writes these 3 args onto stdin of the child process.
Similarly, there is a Recv_uproc that reads stdout of the child process.
There is also a Finish_uproc function to kill the child when finished.
The code as written will actually accomodate upto 8 child processes.
This should at least get you started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2004 08:01 AM
02-20-2004 08:01 AM
Re: Linking 32 and 64 bit code. Can it be done?
Thanks,
Derek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 04:48 AM
02-23-2004 04:48 AM
Re: Linking 32 and 64 bit code. Can it be done?
http://www.hp.com/products1/unix/operating/infolibrary/whitepapers/WP_MixedMode_on_Itanium.pdf
You need to watch out for address space differences with shared memory. A shmget from a 64-bit process will need a IPC_SHARE32 flag to allow 32-bit process to attach it. 64-bit to 32-bit interoperability is discussed in
http://docs.hp.com/hpux/onlinedocs/5966-9844/00/00/1-con.html