Page MenuHomeFreeBSD

security/testssl.sh: Fix build on !amd64
ClosedPublic

Authored by tobik on Jul 1 2017, 4:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 12:07 PM
Unknown Object (File)
Wed, Apr 10, 11:11 AM
Unknown Object (File)
Feb 27 2024, 6:33 AM
Unknown Object (File)
Feb 19 2024, 4:27 PM
Unknown Object (File)
Feb 19 2024, 4:27 PM
Unknown Object (File)
Feb 19 2024, 4:27 PM
Unknown Object (File)
Feb 19 2024, 4:27 PM
Unknown Object (File)
Feb 19 2024, 4:27 PM
Subscribers
None

Details

Summary
Only use enable-ec_nistp_64_gcc_128 on amd64 since it requires a
64-bit little-endian architecture and fix the build on !amd64

ecp_nistp224.c:43:9: error: unknown type name '__uint128_t'
typedef __uint128_t uint128_t;	/* nonstandard; implemented by gcc on 64-bit
	^

PR:		220403
Reported by:	dewayne@heuristicsystems.com.au
Approved by:	??? (mentor)
Differential Revision:	https://reviews.freebsd.org/D11436
MFH:		2017Q3
Test Plan

poudriere testport 10.3/i386, 11.0/i386, 11.0/amd64 ok

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Maybe it could be conditional on it being i386 ?

Maybe it could be conditional on it being i386 ?

Sure, I have copied security/openssl's approach now.

security/testssl.sh/Makefile
53–59 ↗(On Diff #30352)

Mmmm, this is absolutely not the same thing as "does not work on i386". Also, it makes it possible to disable it on amd64.

I was more thinking in the way of

.if ${ARCH} == "i386"
CONFIGURE_ARGS+= blah
.else
CONFIGURE_ARGS+= blurb
.endif

tobik added inline comments.
security/testssl.sh/Makefile
53–59 ↗(On Diff #30352)

The real problem is that enable-ec_nistp_64_gcc_128 requires a 64-bit
little-endian architecture, so it'll likely break on powerpc, armv6,
... too.

it makes it possible to disable it on amd64.

Sure, but this isn't a problem on amd64 and it'll still build fine
without it since it just disables an optimization.

But I can use something like this you think it's better than using
options:

.if ${ARCH} == "amd64"
CONFIGURE_ARGS+=	enable-ec_nistp_64_gcc_128
.else
CONFIGURE_ARGS+=	no-ec_nistp_64_gcc_128
.endif
security/testssl.sh/Makefile
53–59 ↗(On Diff #30352)

That looks better, yes. (But then again, the review was "fix on i386", it should be "fix on !amd64")

tobik edited the summary of this revision. (Show Details)
  • Use .if ${ARCH} instead of options to only enable-ec_nistp_64_gcc_128 on amd64
tobik retitled this revision from security/testssl.sh: Fix build on i386 to security/testssl.sh: Fix build on !amd64.Jul 4 2017, 6:25 PM
tobik edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jul 5 2017, 7:11 AM
This revision was automatically updated to reflect the committed changes.