Author |
Message
|
bbburson |
Posted: Tue Oct 12, 2004 11:56 am Post subject: HP-UX security exit compile |
|
|
Partisan
Joined: 06 Jan 2004 Posts: 378 Location: Nowhere near a queue manager
|
I'm trying to compile a channel security exit on HP-UX 11 using the commands shown in the Intercommunications manual:
Code: |
$ c89 -c +z +e exit.c
$ ld -o exit exit.o +b : -c exit.exp +IMQStart +eMQStart -b
|
The link fails with
Code: |
ld: Can't open exit.exp
ld: No such file or directory
|
I've also tried several other forms of compile/link that I've found in threads on this site; some of them give me executable files but none of them will work as an exit (my mqclient gets 2059 return whenever one of these exits is in place).
Any ideas what might be wrong?
Thanks |
|
Back to top |
|
 |
Anirud |
Posted: Tue Oct 12, 2004 12:42 pm Post subject: |
|
|
 Master
Joined: 12 Feb 2004 Posts: 285 Location: Vermont
|
I wish I could help you on this, but I know nothing about it. I think you will get a better response if you post this under General Support forum. It doesn't mean to start another thread, but moderators can move it.
Regards |
|
Back to top |
|
 |
vennela |
Posted: Tue Oct 12, 2004 12:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
|
Back to top |
|
 |
bbburson |
Posted: Tue Oct 12, 2004 1:16 pm Post subject: |
|
|
Partisan
Joined: 06 Jan 2004 Posts: 378 Location: Nowhere near a queue manager
|
Yes, that's one of the ones I tried; no luck. |
|
Back to top |
|
 |
Nigelg |
Posted: Thu Oct 14, 2004 2:52 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Here is a makefile that works on HPUX:
MQIDIR = /opt/mqm
MQILIBDIR = $(MQIDIR)/lib
MQIINCDIR = $(MQIDIR)/inc
LIBEXIT = -lmqm
ALL : clean MQCHLSRX
MQCHLSRX : mqchlsrx.o
ld -o MQCHLSRX -b mqchlsrx.o -c mqchlsrx.exp +IMQStart
cp MQCHLSRX /var/mqm/exits
mqchlsrx.o : mqchlsrx.c
cc -Aa -c +z mqchlsrx.c -I$(MQIINCDIR)
clean :
rm -f mqchlsrx.o MQCHLSRX
and the associated mqchlsrx.exp
#!
+e ChlSndExit
+e ChlRcvExit
+e MQStart |
|
Back to top |
|
 |
bbburson |
Posted: Fri Oct 15, 2004 11:53 am Post subject: Got it compiled |
|
|
Partisan
Joined: 06 Jan 2004 Posts: 378 Location: Nowhere near a queue manager
|
Thanks, Nigelg!
I had to remove "-c mqchlsrx.exp" from the link statement in your makefile (the exp file still does not get created during the compile), and then the exit compiled and linked successfully. And, most importantly of all, it runs and does what it's supposed to do. |
|
Back to top |
|
 |
Nigelg |
Posted: Mon Oct 18, 2004 1:34 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Thanks for the feedback.
The point of the mqchlsrx.exp file is to define a list of exported functions in the shared library to the linker.
In the above example, as well as the obligatory function MQStart, necessary syntax for WMQ, the library also contains functions ChlSndExit and ChlRcvExit defined as exit functions. The mqchlsrx.exp file contains these definitions, which is why it is on the link line. Note that it is not necessary to have these functions in a separate file; the '+e functionname' can be added to the link line itself.
I found it necessary to export these explicitly in HPUX when building a shared library, otherwise the functions are not found when the library is loaded and searched. |
|
Back to top |
|
 |
|