Bug 269317 - security/xmlsec1 1.2.37 fails to build with LibreSSL
Summary: security/xmlsec1 1.2.37 fails to build with LibreSSL
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-04 11:31 UTC by jakub_lach
Modified: 2023-03-18 18:47 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (hrs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2023-02-04 11:31:35 UTC
FreeBSD 13.2-PRERELEASE #0 stable/13-3901be6a1 amd64

DEFAULT_VERSIONS+=ssl=libressl

FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
Target: x86_64-unknown-freebsd13.2

<...>

x509.c:1257:11: error: implicit declaration of function 'ASN1_TIME_to_tm' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    ret = ASN1_TIME_to_tm(t, &tm);
          ^
x509.c:1257:11: note: did you mean 'ASN1_TIME_set_tm'?
/usr/local/include/openssl/asn1.h:728:12: note: 'ASN1_TIME_set_tm' declared here
ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm);
           ^
1 error generated.
gmake[5]: *** [Makefile:717: libxmlsec1_openssl_la-x509.lo] Error 1
gmake[5]: *** Waiting for unfinished jobs....
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../.. -DPACKAGE=\"xmlsec1\" -I../../include -I../../include -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -I/usr/local/include -I/usr/local/include/openssl -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/libxml2 -isystem /usr/local/include -O2 -pipe -march=penryn -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -Werror -fno-builtin-memset -MT libxmlsec1_openssl_la-x509vfy.lo -MD -MP -MF .deps/libxmlsec1_openssl_la-x509vfy.Tpo -c x509vfy.c  -fPIC -DPIC -o .libs/libxmlsec1_openssl_la-x509vfy.o
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../.. -DPACKAGE=\"xmlsec1\" -I../../include -I../../include -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -I/usr/local/include -I/usr/local/include/openssl -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/libxml2 -isystem /usr/local/include -O2 -pipe -march=penryn -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -Werror -fno-builtin-memset -MT libxmlsec1_openssl_la-x509vfy.lo -MD -MP -MF .deps/libxmlsec1_openssl_la-x509vfy.Tpo -c x509vfy.c -o libxmlsec1_openssl_la-x509vfy.o >/dev/null 2>&1
mv -f .deps/libxmlsec1_openssl_la-x509vfy.Tpo .deps/libxmlsec1_openssl_la-x509vfy.Plo
gmake[5]: Leaving directory '/usr/obj/usr/ports/security/xmlsec1/work/xmlsec1-1.2.37/src/openssl'
gmake[4]: *** [Makefile:692: all-recursive] Error 1
gmake[4]: Leaving directory '/usr/obj/usr/ports/security/xmlsec1/work/xmlsec1-1.2.37/src'
gmake[3]: *** [Makefile:747: all-recursive] Error 1
gmake[3]: Leaving directory '/usr/obj/usr/ports/security/xmlsec1/work/xmlsec1-1.2.37'
gmake[2]: *** [Makefile:565: all] Error 2
gmake[2]: Leaving directory '/usr/obj/usr/ports/security/xmlsec1/work/xmlsec1-1.2.37'
===> Compilation failed unexpectedly.
Comment 1 jakub_lach 2023-02-04 12:41:42 UTC
Added 

.if ${.CURDIR:M*/ports/security/xmlsec1}
CFLAGS += -w
.endif

for now
Comment 2 tjlegg 2023-02-04 13:24:18 UTC
when I check the differences between /usr/include/openssl/asn1.h (base openssl) and /usr/local/include/openssl/asn1.h (ports libressl)
$ grep ASN1_TIME_to_tm /usr/include/openssl/asn1.h
int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm);
$ grep ASN1_TIME_to_tm /usr/local/include/openssl/*
$ grep ASN1_TIME_set_tm /usr/include/openssl/asn1.h
$ grep ASN1_TIME_set_tm /usr/local/include/openssl/asn1.h
ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm);
Comment 3 Ivan Rozhuk 2023-02-17 11:17:27 UTC
ASN1_TIME_to_tm() was added to libressl, but in 3.5.x it is private.
We must wait for 3.7.x stable release to update.

Backporting is possible, but this will change API/ABI and will require to rebuild other ports, as far I understand.
Comment 4 Ivan Rozhuk 2023-03-18 18:47:32 UTC
With libressl 3.6.2 - build ok.