Skip to content

crypto/bn/build.info: define OPENSL_IA32_SSE2 globally when needed#9679

Closed
levitte wants to merge 2 commits intoopenssl:masterfrom
levitte:fix-sse2
Closed

crypto/bn/build.info: define OPENSL_IA32_SSE2 globally when needed#9679
levitte wants to merge 2 commits intoopenssl:masterfrom
levitte:fix-sse2

Conversation

@levitte
Copy link
Member

@levitte levitte commented Aug 23, 2019

This required an extension of the DEFINE syntax, to allow DEFINE[]=def

DEFINE[] definitions end up pushed in @{$config{defines}} instead of
being added to the output file list of defines. This allows for the
unusual case where we need something to be defined globally, so it
gets picked up by anything using $(CPPFLAGS).

@levitte levitte added the branch: master Applies to master branch label Aug 23, 2019
@levitte levitte requested a review from bernd-edlinger August 23, 2019 13:13
@bernd-edlinger
Copy link
Member

No not yet working.

        $(CC) $(LIB_CFLAGS) $(LIB_CPPFLAGS) -c -o $@ crypto/modes/ghash-x86.s
crypto/modes/ghash-x86.s: ../openssl/crypto/modes/asm/ghash-x86.pl
        CC="$(CC)" $(PERL) ../openssl/crypto/modes/asm/ghash-x86.pl $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR) $@

the asm module does not define gcm_*_clmul
because it is not invoked with -DOPENSSL_IA32_SSE2

uildtest_c_asn1t-bin-buildtest_asn1t.d.tmp -MT test/buildtest_c_asn1t-bin-buildtest_asn1t.o -c -o test/buildtest_c_asn1t-bin-buildtest_asn1t.o test/buildtest_asn1t.c
crypto/modes/fips-dso-gcm128.o: In function `CRYPTO_gcm128_init':
gcm128.c:(.text+0xdd): undefined reference to `gcm_init_clmul'
gcm128.c:(.text+0xe3): undefined reference to `gcm_gmult_clmul'
gcm128.c:(.text+0xef): undefined reference to `gcm_ghash_clmul'
collect2: error: ld returned 1 exit status
make[1]: *** [providers/fips.so] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/ed/OPC/asm'
make: *** [all] Fehler 2

it has this nice gadget:

$sse2=0;
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }

all of them have that, but mostly it is beinign just lost performance.

@levitte
Copy link
Member Author

levitte commented Aug 23, 2019

That's odd. It should have ended up in LIB_CPPFLAGS... I think, but I will have another look to make sure.

@bernd-edlinger
Copy link
Member

LIB_CPPFLAGS=-DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"$(OPENSSLDIR)\"" -DENGINESDIR="\"$(ENGINESDIR)\"" -DMODULESDIR="\"$(MODULESDIR)\"" $(CNF_CPPFLAGS) $(CPPFLAGS)
CNF_CPPFLAGS=-DNDEBUG
CPPFLAGS=
-DOPENSSL_IA32_SSE2 w/o using $(CFLAGS) or so is on all compile rules, but not on the
assembler perl scripts.

@levitte
Copy link
Member Author

levitte commented Aug 23, 2019

Gotcha. Will fix soon

DEFINE[] definitions end up pushed in @{$config{defines}} instead of
being added to the output file list of defines.  This allows for the
unusual case where we need something to be defined globally, so it
gets picked up by anything using $(CPPFLAGS).
@levitte
Copy link
Member Author

levitte commented Aug 23, 2019

How about now?

@levitte levitte changed the title Build info typo: $BNDEF_sse2 should be $BNDEF crypto/bn/build.info: define OPENSL_IA32_SSE2 globally when needed Aug 23, 2019
Copy link
Member

@bernd-edlinger bernd-edlinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good now

levitte added a commit that referenced this pull request Aug 23, 2019
DEFINE[] definitions end up pushed in @{$config{defines}} instead of
being added to the output file list of defines.  This allows for the
unusual case where we need something to be defined globally, so it
gets picked up by anything using $(CPPFLAGS).

Reviewed-by: Bernd Edlinger <[email protected]>
(Merged from #9679)
levitte added a commit that referenced this pull request Aug 23, 2019
This is done conditionally.

Reviewed-by: Bernd Edlinger <[email protected]>
(Merged from #9679)
@levitte
Copy link
Member Author

levitte commented Aug 23, 2019

Merged.

ef57f79 Configure: Allow 'DEFINE[]=def'
00372d7 crypto/bn/build.info: define OPENSL_IA32_SSE2 globally when needed

@levitte levitte closed this Aug 23, 2019
levitte pushed a commit that referenced this pull request Sep 26, 2019
Commit b6b6657 (PR #9679) renamed most POD files. This change causes
find-doc-nits to flag misnamed files.
Also fix the two misnamed files that it found.

Reviewed-by: Richard Levitte <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants