Operating System - Linux
1751922 Members
4716 Online
108783 Solutions
New Discussion юеВ

Re: Perl OpenSSL::Cipher compiling grief

 
Ralph Grothe
Honored Contributor

Perl OpenSSL::Cipher compiling grief

Hi,

anyone who installed OpenSSL::Cipher on B.11.11 here?
When running make I get an undefined symbol "*" error from the compiler:

$ make
cc -c -I. -I/opt/openssl/include -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -D_
LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit -DVERSION=\"0.09\" -DXS_VERSIO
N=\"0.09\" +Z "-I/opt/perl5/lib/5.8.0/PA-RISC2.0/CORE" OpenSSL.c
cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration of "sendfile" with
a different storage class specifier: "sendfile" will have internal linkage.
cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration of "sendpath" with
a different storage class specifier: "sendpath" will have internal linkage.
cc: "OpenSSL.xs", line 46: error 1000: Unexpected symbol: "*".
cc: panic 2017: Cannot recover from earlier errors, terminating.
*** Error exit code 1


Line 46 of the Perl XS file is this:

$ sed -n 46p OpenSSL.xs
static inline SV* output_ASN1_INTEGER(ASN1_INTEGER *ai, SV *sv)


I'm not that much into C syntax.
I only wonder whether there should be a space between type and pointer on it in "SV*" ?

Regards
Ralph

Madness, thy name is system administration
6 REPLIES 6
Ralph Grothe
Honored Contributor

Re: Perl OpenSSL::Cipher compiling grief

Oh my, I think I should have word with the module author about distributing F****** Hacks through CPAN ;-)
("nichts fuer die Goldwaage", can be loosely translated to "don't weigh my words"; literally, "nothing for the gold scale")


$ cat README
THIS IS A F****** HACK (nichts f r die Goldwaage..)

Don't read the man-pages/*.pm's (they are dummy), check t/*
and fix OpenSSL.xs

Don't forget to try -
print OpenSSL::CRL::new_from_file("crl.pem")->info
- it's the only CRL stuff that's supported :)

OpenSSL::HMAC is dummy.
OpenSSL::BN is untested.
Madness, thy name is system administration
Dennis Handly
Acclaimed Contributor

Re: Perl OpenSSL::Cipher compiling grief

static inline SV* output_ASN1_INTEGER(ASN1_INTEGER *ai, SV *sv)

The C99 inline keyword is not valid. Compile with: -Dinline=

>wonder whether there should be a space between type and pointer on it in "SV*"?

This IS the "correct" spacing to declare a function returning a pointer. ;-)
Ralph Grothe
Honored Contributor

Re: Perl OpenSSL::Cipher compiling grief

Hi Denis,

do you mean that type attribute "inline" has only been added to the ANSI C99 standard than my version of HP ansic compiler doesn't understand?
Then I am bemused that its manpage lists these inlining related optimization flags:


+O[no]inline[=name1,name2,...,nameN]
Request [disable] inlining for the specified
procedures. If specified without a namelist,
+O[no]inline requests [disables] inlining for all
procedures in the compilation unit. This option can be
used at optimization levels 3 and 4. The default is
+Oinline.

+O[no]inline:filename
Perform the same operation as
+O[no]inline[=name1,name2,...,nameN] but fetch the
symbols from a text file, instead of from the command
line. Symbols referenced in the text file must be
separated by white space within the file.

+Oinlinebudget=n
The +Oinlinebudget option controls the aggressiveness
of inlining. n is an integer in the range 1 - 1000000
that specifies the level of aggressiveness as follows:

n Meaning

= 100 Default level on inlining.
> 100 More aggressive inlining.
2 - 99 Less aggressive inlining.
= 1 Only inline if it reduces code size.

This optimization can occur at optimization levels 3,
and 4. The default is +Oinlinebudget=100.



I wonder if I should try +0noinline to supress inlining attempts altogether?

Anyway, I defined that macro -Dinline= to nothing in the Makefile as you suggested,
but the compilation now aborts with some
"Incorrect initialization" error at line 933 of the XS file:

# sed -n 933p OpenSSL.xs
EVP_MD *mds[] = { EVP_md5(), EVP_md2(), EVP_sha1() };


Btw, this kind of pointer notation (even if the above line choked the compiler) to me looks syntacticly "more" correct for what I could recall.

e.g.

static inline SV *output_ASN1_INTEGER(...)

But probably a meaningless aesthetical point?
(not to say pointer ;-)





cc -c -I. -I/opt/openssl/include -Ae -Dinline= -D_HPUX_SOURCE -Wl,+vnocompatwarnings -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit -DVERSION=\"0.09\" -DXS_VERSION=\"0.09\" +Z "-I/opt/perl5/lib/5.8.0/PA-RISC2.0/CORE" OpenSSL.c
cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration of "sendfile" with a different storage class specifier: "sendfile" will have internal linkage.
cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration of "sendpath" with a different storage class specifier: "sendpath" will have internal linkage.
cc: "OpenSSL.xs", line 199: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 225: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 235: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 235: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 248: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 248: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 248: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 248: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 268: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 269: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 270: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 271: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 272: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 273: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 274: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 276: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 288: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 288: warning 563: Argument #4 is not the correct type.
cc: "OpenSSL.xs", line 291: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 291: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 293: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 363: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 363: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 363: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 364: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 364: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 364: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 365: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 365: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 365: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 366: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 366: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 366: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 367: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 370: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 370: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 377: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 377: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 377: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 378: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 378: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 378: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 381: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 381: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 382: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 382: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 385: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 385: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 386: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 386: warning 611: Type conversion loses "const" qualifier.
cc: "OpenSSL.xs", line 562: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 562: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 563: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 563: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 568: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 568: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 570: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 570: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 572: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 572: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 574: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 574: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 576: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 576: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 578: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 578: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 580: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 580: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 582: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 582: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 610: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 610: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 611: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 611: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 635: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 635: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 636: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 636: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 637: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 637: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 638: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 638: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 639: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 639: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 640: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 640: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 641: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 641: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 642: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 642: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 661: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 661: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 661: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 661: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 680: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 680: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 680: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 680: warning 563: Argument #3 is not the correct type.
cc: "OpenSSL.xs", line 704: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 704: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 705: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 705: warning 563: Argument #2 is not the correct type.
cc: "OpenSSL.xs", line 737: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 737: warning 563: Argument #4 is not the correct type.
cc: "OpenSSL.xs", line 740: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 740: warning 563: Argument #4 is not the correct type.
cc: "OpenSSL.xs", line 771: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 771: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 823: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 823: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 833: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 833: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 836: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 836: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 933: error 1521: Incorrect initialization.
cc: "OpenSSL.xs", line 933: error 1521: Incorrect initialization.
cc: "OpenSSL.xs", line 933: error 1521: Incorrect initialization.
cc: "OpenSSL.xs", line 1131: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1131: warning 563: Argument #3 is not the correct type.
cc: "OpenSSL.xs", line 1131: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1131: warning 563: Argument #4 is not the correct type.
cc: "OpenSSL.xs", line 1150: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1155: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1156: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1156: warning 563: Argument #3 is not the correct type.
cc: "OpenSSL.xs", line 1175: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1178: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1178: warning 563: Argument #3 is not the correct type.
cc: "OpenSSL.xs", line 1257: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1257: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 1323: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1323: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 1384: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1384: warning 563: Argument #4 is not the correct type.
cc: "OpenSSL.xs", line 1388: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1388: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 1454: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1454: warning 563: Argument #1 is not the correct type.
cc: "OpenSSL.xs", line 1663: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1664: warning 604: Pointers are not assignment-compatible.
cc: "OpenSSL.xs", line 1664: warning 563: Argument #2 is not the correct type.
*** Error exit code 1

Stop.
Madness, thy name is system administration
Dennis Handly
Acclaimed Contributor

Re: Perl OpenSSL::Cipher compiling grief

>do you mean that type attribute "inline" has only been added to the ANSI C99 standard than my version of HP ansic compiler doesn't understand?

You need to add -AC99 to get it recognized but only the IPF compiler supports C99 fully.

>Then I am bemused that its manpage lists these inlining related optimization flags:

These predate C99. They are related to the optimizer inlining it without keywords. And they are also for a real compiler, C++. :-)

>I wonder if I should try +0noinline to supress inlining attempts altogether?

Why bother?

>"Incorrect initialization" error at line 933 of the XS file:
EVP_MD *mds[] = { EVP_md5(), EVP_md2(), EVP_sha1() };

Again a C99 construct.

>this kind of pointer notation to me looks syntacticly "more" correct for what I could recall.

You are correct. For data, you put it near the variable. For function return, you put it near the type.

>But probably a meaningless aesthetical point?

(Not to me. ;-)
Ralph Grothe
Honored Contributor

Re: Perl OpenSSL::Cipher compiling grief

> You need to add -AC99 to get it recognized but only the IPF compiler supports C99 fully.

Sigh, I consulted the manpage again
but it only refers to these three compilation standards -A{c|a|e}
I can merely provoke this error:

cc: error 1412: Unrecognized argument "C99" to option -A.

> EVP_MD *mds[] = { EVP_md5(), EVP_md2(), EVP_sha1() };
> Again a C99 construct.

Hm, does this mean declaration of array elements by assignment through function return values is C99 compliant but not pre 99, even if the compiler already knows the types and sizeof functions' return values for memory allocation?
Sorry, for my stupid questions but I am used to untyped languages such as Perl.

> These predate C99. They are related to the optimizer inlining it without keywords. And they are also for a real compiler, C++. :-)

So only language atrocity literate compilers as for C++ deserve the title "real compiler"? ;-)
But wait, we have an HP box of a customer who has licensed aCC.
Maybe I could try to compile this stuff there?
Er, execution of the surrogate compiled binaries on another box doesn't infringe any license?


Madness, thy name is system administration
Dennis Handly
Acclaimed Contributor

Re: Perl OpenSSL::Cipher compiling grief

>cc: error 1412: Unrecognized argument "C99" to option -A.

Your compiler is too old.

>does this mean declaration of array elements by assignment through function return values is C99 compliant but not pre 99

Exactly. C89 says it is an error.

>even if the compiler already knows the types and sizeof functions' return values for memory allocation?

That's not the problem. The C89 Standard says they must be constant expressions.

>we have an HP box of a customer who has licensed aCC.  Maybe I could try to compile this stuff there?
>execution of the surrogate compiled binaries on another box doesn't infringe any license?

As long as you have a license for every user on that box. Starting last year, aC++ was changed to be for every CPU, to match C. In fact, you can now get both for "one low price". :-)