1831825 Members
2987 Online
110031 Solutions
New Discussion

Compile a module

 
Brian Keenan
Advisor

Compile a module

Hi,
I'm trying to compile a module using the command
make install && make restart
It errors out with message:
ld: No $UNWIND_END$ subspace has been defined (probably missing /usr/ccs/lib/crt0.o)
apxs:Break: Command failed with rc=65536
*** Error exit code 1

The file /usr/ccs/lib/crt0.o does exist.

Any clues?

regards

Brian
26 REPLIES 26
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

what module?
what C compiler?
what OS?
Enjoy, Have FUN! H.Merijn
Bill McNAMARA_1
Honored Contributor

Re: Compile a module

does /usr/ccs/lib/ exist?

attach an

swlist | more

To compile a kernel module, you'd use config (1m) and kminstall, but I don't think this is what you're doing..

See also http://www.hp.com/go/developer for general developer support..

Later,
Bill
It works for me (tm)
Steve Steel
Honored Contributor

Re: Compile a module

Hi

From the 11.00 release notes

These symbols are no longer defined in a PA64 crt0.o:

$RECOVER_END$
$RECOVER_START$
$START$
$UNWIND_END$
$UNWIND_START$
$global$
__argc_value
__argv_value
_start


See www.docs.hp.com


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

Bill, /usr/ccs/lib exists, because the file /usr/ccs/lib/crt0.o exists (from initial message)

Steve, 64bit builds are not supported from the braindead bundled compiler.

/opt/langtools/lib/crt0.o
/opt/langtools/lib/pa20_64/crt0.o

are the one's used by HP's ANSI-C compiler
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

Hi,

swlist file attached.
module is nltm_auth for apache/unix
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

OS = 11.00

Compiler = HP C-ANSI-C (I hope you *are* using it)
-- your version is B.11.01.07, consider an upgrade:

a5:/ 101 # swlist | grep ANSI
B3901BA B.11.02.04 HP C/ANSI C Developer's Bundle for HP-UX 11.00 (S800)
PHSS_25985 1.0 ANSI C compiler General patch
a5:/ 102 #

Module for Apache. Show us more output from the make. Do you *need* 64bit compile?
Enjoy, Have FUN! H.Merijn
Sean OB_1
Honored Contributor

Re: Compile a module

Have you run the .configure that most modules come with?

Then I'm assuming you ran make with no problems. Try "make test" to see if that is in there as an option.

Make sure that /usr/ccs/lib is in your path as well.
Brian Keenan
Advisor

Re: Compile a module

Full output.


make test
apxs -c -I/apps/9ias/oracle/product/9iAS/Apache/Apache/include -L/home/javadba1/mod_ntlm-0.3/smbval -Wc,-Wall mod_ntlm.c
cc -O -xildoff -DMACHINE64 -DNO_RC2 -DNO_RC5 -DNO_IDEA -DBSAFE -KPIC -DSOLARIS2=260 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI -I/include -DEAPI -DUSE_EXPAT -I../lib/expat-lite -KPIC -DSHARED_MODULE -I/include -Wall -I/apps/9ias/oracle/product/9iAS/Apache/Apache/include -c mod_ntlm.c
cc: warning 422: Unknown option "x" ignored.
cc: warning 422: Unknown option "i" ignored.
cc: warning 422: Unknown option "K" ignored.
cc: warning 422: Unknown option "K" ignored.
ld -G -o mod_ntlm.so mod_ntlm.o -L/home/javadba1/mod_ntlm-0.3/smbval
ld: Unsatisfied symbols:
memset (code)
memcpy (code)
close (code)
socket (code)
free (code)
bzero (code)
ap_requires (code)
ap_cfg_closefile (code)
toupper (code)
writev (code)
ap_pstrcat (code)
ap_palloc (code)
fputs (code)
getgid (code)
strlen (code)
ap_set_string_slot (code)
ap_getword_conf (code)
ap_table_get (code)
connect (code)
ap_clear_pool (code)
ap_table_addn (code)
gethostbyname (code)
ap_pstrdup (code)
ap_null_cleanup (code)
_islower (code)
strcasecmp (code)
strncmp (code)
inet_addr (code)
ap_set_flag_slot (code)
ap_set_file_slot (code)
strncpy (code)
ap_base64encode_len (code)
ap_psprintf (code)
ap_base64decode (code)
ap_base64decode_len (code)
vsprintf (code)
ap_table_setn (code)
ap_register_cleanup (code)
ap_make_table (code)
fclose (code)
ap_cfg_getline (code)
strchr (code)
read (code)
ap_getword_white (code)
strcmp (code)
ap_destroy_pool (code)
ap_getword (code)
ap_log_rerror (code)
strcpy (code)
gethostname (code)
ap_pcfg_openfile (code)
ap_pbase64decode (code)
fopen (code)
ap_make_sub_pool (code)
ap_note_basic_auth_failure (code)
malloc (code)
memcmp (code)
getpid (code)
ap_pcalloc (code)
alarm (code)
ap_signal (code)
__SB_masks (data)
ap_base64encode (code)
ld: No $UNWIND_END$ subspace has been defined (probably missing /usr/ccs/lib/crt0.o)
apxs:Break: Command failed with rc=65536
*** Error exit code 1
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

OK, this /does/ help. You are feeding your HP C-ANSI-C compiler gcc options. You have two choices

1. Download a working gcc, preferably the same mod_perl was built with, and use that (recent versions can be fetched from https://www.beepz.com/personal/merijn )

2. `Fix' the Makefile to pass correct arguments

-Wc,-Wall => remove, or use +w1
-xildoff => ?
-KPIC => +Z
-Wall => remove, or use +w1
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

Hi,

I went for option 2, but still getting the same error.

regards

Brian
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

The /same/? *Exactly* the same? I don't believe. Show the output again please. (not the missing symbols, I beleive those :)
Enjoy, Have FUN! H.Merijn
Olav Baadsvik
Esteemed Contributor

Re: Compile a module

Hi,

I advise you to modify your makefile so that
it invokes cc to do the link (instaed of
ld as I assume you are using now)

In this way cc will invoke ld and automatically link in /usr/ccs/lib/crt0.o
It will also link in libc. Most of the
uresolved symbols (if not all) are found
in libc

Regards
Olav
Brian Keenan
Advisor

Re: Compile a module

Hi, this is the error and I've also attached my Makefile
make install && make restart
apxs -c -I/apps/9ias/oracle/product/9iAS/Apache/Apache/include -L/home/
javadba1/mod_ntlm-0.3/smbval mod_ntlm.c
cc -O -xildoff -DMACHINE64 -DNO_RC2 -DNO_RC5 -DNO_IDEA -DBSAFE -KPIC -DSOLARIS
2=260 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI -I/include -DEAPI -DUSE_EXPAT -
I../lib/expat-lite -KPIC -DSHARED_MODULE -I/include -I/apps/9ias/oracle/product/
9iAS/Apache/Apache/include -c mod_ntlm.c
cc: warning 422: Unknown option "x" ignored.
cc: warning 422: Unknown option "i" ignored.
cc: warning 422: Unknown option "K" ignored.
cc: warning 422: Unknown option "K" ignored.
ld -G -o mod_ntlm.so mod_ntlm.o -L/home/javadba1/mod_ntlm-0.3/smbval
ld: Unsatisfied symbols:
-
-
-
-
ld: No $UNWIND_END$ subspace has been defined (probably missing /usr/ccs/lib/crt
0.o)
apxs:Break: Command failed with rc=65536
*** Error exit code 1

Stop.


regards

Brian
Sean OB_1
Honored Contributor

Re: Compile a module

Brian,

Make sure that you did a "make clean" after modifying the Makefile. Then "make", and then "make test".

Then let us see the results from the "make test".

H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

can we see 'apxs' please?

the suggestion to replace 'ld' with 'cc' is good, but we're not in that stage (yet). We first have to resolve the fact that cc is passed the wrong options
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

Hi,

Attached apxs file

regards

Brian
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

Hey, great! That's a perl script!

--8<---
my $CFG_CC = q(cc -O -xildoff -DMACHINE64 -DNO_RC2 -DNO_RC5 -DNO_IDEA -DBSAFE -KPIC); # substituted via Makefile.tmpl
my $CFG_CFLAGS = q( -DSOLARIS2=260 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI -I/include -DEAPI -DUSE_EXPAT -I../lib/expat-lite `../apaci`); # substituted via Makefile.tmpl
my $CFG_CFLAGS_SHLIB = q(-KPIC -DSHARED_MODULE); # substituted via Makefile.tmpl
my $CFG_LD_SHLIB = q(ld); # substituted via Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = q(-G); # substituted via Makefile.tmpl
my $CFG_LIBS_SHLIB = q(); # substituted via Makefile.tmpl
my $CFG_PREFIX = q(/apps/9ias/oracle/product/9iAS/Apache/Apache); # substituted via APACI install
my $CFG_SBINDIR = q(/apps/9ias/oracle/product/9iAS/Apache/Apache/bin); # substituted via APACI install
my $CFG_INCLUDEDIR = q(/include); # substituted via APACI install
my $CFG_LIBEXECDIR = q(/apps/9ias/oracle/product/9iAS/Apache/Apache/libexec); # substituted via APACI install
my $CFG_SYSCONFDIR = q(/apps/9ias/oracle/product/9iAS/Apache/Apache/conf); # substituted via APACI install
-->8---

Check and see how this works:
--8<---
my $CFG_CC = q(cc -O -DMACHINE64 -DNO_RC2 -DNO_RC5 -DNO_IDEA -DBSAFE +Z); # substituted via Makefile.tmpl
my $CFG_CFLAGS = q(-DSOLARIS2=260 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI -I/include -DEAPI -DUSE_EXPAT -I../lib/expat-lite `../apaci`); # substituted via Makefile.tmpl
my $CFG_CFLAGS_SHLIB = q(+Z -DSHARED_MODULE); # substituted via Makefile.tmpl
my $CFG_LD_SHLIB = q(cc); # substituted via Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = q(-b); # substituted via Makefile.tmpl
my $CFG_LIBS_SHLIB = q(); # substituted via Makefile.tmpl
my $CFG_PREFIX = q(/apps/9ias/oracle/product/9iAS/Apache/Apache); # substituted via APACI install
my $CFG_SBINDIR = q(/apps/9ias/oracle/product/9iAS/Apache/Apache/bin); # substituted via APACI install
my $CFG_INCLUDEDIR = q(/include); # substituted via APACI install
my $CFG_LIBEXECDIR = q(/apps/9ias/oracle/product/9iAS/Apache/Apache/libexec); # substituted via APACI install
my $CFG_SYSCONFDIR = q(/apps/9ias/oracle/product/9iAS/Apache/Apache/conf); # substituted via APACI install
-->8---

Or modify Makefile.tmpl

Since I cannot test above, I can give no guarantee :)
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

Hi,

Attached is the new error stack.

regards

Brian
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

That's an exit code of cc?

Calc > 65536
0200000 / 65536 / 0x10000
Calc >


It's causing apxc to exit. To see what happens if you just ignore it, do change

sub execute_cmds {
my (@cmds) = @_;
my ($cmd, $rc);
foreach $cmd (@cmds) {
print STDERR "$cmd\n";
$rc = system("$cmd");
if ($rc != 0) {
printf(STDERR "apxs:Break: Command failed with rc=%d\n", $rc << 8);
exit(1);
}
}
}

to

sub execute_cmds {
my (@cmds) = @_;
my ($cmd, $rc);
foreach $cmd (@cmds) {
print STDERR "$cmd\n";
$rc = system("$cmd");
if ($rc != 0) {
printf(STDERR "apxs:Break: Command failed with rc=%d\n", $rc << 8);
# exit(1);
}
}
}

The error you see does not ring a bell here. I hope someone else can help you out there ...
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

Hi,

New error after exit is ignored.

apxs:Break: Command failed with rc=65536
cc -b -o mod_ntlm.so mod_ntlm.o -L/home/javadba1/test/mod_ntlm-0.3.shh-3/smbval
cc: warning 422: Unknown option "b" ignored.
/usr/ccs/bin/ld: Can't open mod_ntlm.o
/usr/ccs/bin/ld: No such file or directory
apxs:Break: Command failed with rc=65536
apxs -i -a -n 'ntlm' mod_ntlm.so
cp mod_ntlm.so /apps/9ias/oracle/product/9iAS/Apache/Apache/libexec/mod_ntlm.so
cp: cannot access mod_ntlm.so: No such file or directory
apxs:Break: Command failed with rc=65536
chmod 755 /apps/9ias/oracle/product/9iAS/Apache/Apache/libexec/mod_ntlm.so
chmod: can't access /apps/9ias/oracle/product/9iAS/Apache/Apache/libexec/mod_ntlm.so
apxs:Break: Command failed with rc=65536
[activating module `ntlm' in /apps/9ias/oracle/product/9iAS/Apache/Apache/conf/httpd.conf]
/apps/9ias/oracle/product/9iAS/Apache/Apache/bin/apache restart
Make: Cannot load /apps/9ias/oracle/product/9iAS/Apache/Apache/bin/apache. Stop.
*** Error exit code 1

Stop.
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

put back

my $CFG_LD_SHLIB = q(cc); # substituted via Makefile.tmpl

to q(ld)
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

error stack now

cc: "mod_ntlm.c", line 493: warning 604: Pointers are not assignment-compatible.
cc: "mod_ntlm.c", line 493: warning 563: Argument #2 is not the correct type.
apxs:Break: Command failed with rc=65536
ld -b -o mod_ntlm.so mod_ntlm.o -L/home/javadba1/test/mod_ntlm-0.3.shh-3/smbval
ld: Can't open mod_ntlm.o
ld: No such file or directory
apxs:Break: Command failed with rc=65536
apxs -i -a -n 'ntlm' mod_ntlm.so
cp mod_ntlm.so /apps/9ias/oracle/product/9iAS/Apache/Apache/libexec/mod_ntlm.so
cp: cannot access mod_ntlm.so: No such file or directory
apxs:Break: Command failed with rc=65536
chmod 755 /apps/9ias/oracle/product/9iAS/Apache/Apache/libexec/mod_ntlm.so
chmod: can't access /apps/9ias/oracle/product/9iAS/Apache/Apache/libexec/mod_ntlm.so
apxs:Break: Command failed with rc=65536
[activating module `ntlm' in /apps/9ias/oracle/product/9iAS/Apache/Apache/conf/httpd.conf]
/apps/9ias/oracle/product/9iAS/Apache/Apache/bin/apache restart
Make: Cannot load /apps/9ias/oracle/product/9iAS/Apache/Apache/bin/apache. Stop.
*** Error exit code 1
H.Merijn Brand (procura
Honored Contributor

Re: Compile a module

Sorry, my help ends here. I can't see what causes mod_ntlm.o to be unable to build. Normally the error message you get only indicate a warning, but here they seem to be fatal for cc.

show the code from line 490..495 in mod_ntlm.c maybe someone recognizes the problem
Enjoy, Have FUN! H.Merijn
Brian Keenan
Advisor

Re: Compile a module

Hi,

Code lines 489..496

if (!*ntlmssp->user)
return HTTP_BAD_REQUEST;
ntlm_connection->user = ap_pstrdup(r->connection->pool, ntlmssp->user);
ntlm_connection->domain = (*ntlmssp->domain)
? ap_pstrdup(r->connection->pool, ntlmssp->domain)
: crec->ntlm_domain;
ntlm_connection->password = ap_pcalloc(r->connection->pool, RESP_LEN);
memcpy(ntlm_connection->password, ntlmssp->nt, RESP_LEN);