Bug 146392 - LO build broken due to x509.h
Summary: LO build broken due to x509.h
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Roland Kurmann
URL:
Whiteboard: target:7.4.0 target:7.3.0.2 target:7.2.6
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-23 16:25 UTC by Roland Kurmann
Modified: 2022-01-10 16:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Kurmann 2021-12-23 16:25:48 UTC
Description:
My LO build is broken since commit be446d81e07b5499152efeca6ca23034e51ea5ff "only use X509Data" (https://cgit.freedesktop.org/libreoffice/core/commit/?id=be446d81e07b5499152efeca6ca23034e51ea5ff).
When I checkout the previous commit, the build is successful.

Steps to Reproduce:
1. Checkout be446d81e07b5499152efeca6ca23034e51ea5ff
2. Call make

Actual Results:
[CXX] xmlsecurity/inc/pch/precompiled_xsec_xmlsec.cxx
[CXX] xmlsecurity/source/xmlsec/biginteger.cxx
[CXX] xmlsecurity/source/xmlsec/certificateextension_certextn.cxx
[CXX] xmlsecurity/source/xmlsec/errorcallback.cxx
[CXX] xmlsecurity/source/xmlsec/saxhelper.cxx
[CXX] xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
[CXX] xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
[CXX] xmlsecurity/source/xmlsec/xmlsec_init.cxx
[CXX] xmlsecurity/source/xmlsec/xmlstreamio.cxx
[CXX] xmlsecurity/source/gpg/CertificateImpl.cxx
[CXX] xmlsecurity/source/gpg/CipherContext.cxx
[CXX] xmlsecurity/source/gpg/DigestContext.cxx
[CXX] xmlsecurity/source/gpg/SecurityEnvironment.cxx
[CXX] xmlsecurity/source/gpg/SEInitializer.cxx
[CXX] xmlsecurity/source/gpg/XMLEncryption.cxx
[CXX] xmlsecurity/source/gpg/XMLSecurityContext.cxx
[CXX] xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
[CXX] xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
[CXX] xmlsecurity/source/xmlsec/nss/digestcontext.cxx
[CXX] xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
[CXX] xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
[CXX] xmlsecurity/source/xmlsec/nss/secerror.cxx
[CXX] xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
[CXX] xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
[CXX] xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
[CXX] xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
/devel/libreoffice/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:524:36: error: use of undeclared identifier '__CERT_NewTempCertificate'; did you mean 'CERT_NewTempCertificate'?
        CERTCertificate* certTmp = CERT_NewTempCertificate(certDb, &item,
                                   ^~~~~~~~~~~~~~~~~~~~~~~
                                   CERT_NewTempCertificate                                                                                                                                                                                                                     
/devel/libreoffice/xmlsecurity/source/xmlsec/nss/nssrenam.h:37:33: note: expanded from macro 'CERT_NewTempCertificate'
#define CERT_NewTempCertificate __CERT_NewTempCertificate
                                ^
/devel/libreoffice/workdir/UnpackedTarball/nss/dist/public/nss/cert.h:286:25: note: 'CERT_NewTempCertificate' declared here
extern CERTCertificate *CERT_NewTempCertificate(CERTCertDBHandle *handle,
                        ^
1 error generated.
make[1]: *** [/devel/libreoffice/solenv/gbuild/LinkTarget.mk:332: /devel/libreoffice/workdir/CxxObject/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/devel/libreoffice/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx:311:12: error: use of undeclared identifier '__CERT_DecodeDERCertificate'; did you mean 'CERT_DecodeDERCertificate'?
    cert = CERT_DecodeDERCertificate( &certItem, PR_TRUE, nullptr ) ;
           ^~~~~~~~~~~~~~~~~~~~~~~~~
           CERT_DecodeDERCertificate                                                                                                                                                                                                                                           
/devel/libreoffice/xmlsecurity/source/xmlsec/nss/nssrenam.h:39:35: note: expanded from macro 'CERT_DecodeDERCertificate'
#define CERT_DecodeDERCertificate __CERT_DecodeDERCertificate
                                  ^
/devel/libreoffice/workdir/UnpackedTarball/nss/dist/public/nss/cert.h:403:25: note: 'CERT_DecodeDERCertificate' declared here
extern CERTCertificate *CERT_DecodeDERCertificate(SECItem *derSignedCert,
                        ^
1 error generated.
make[1]: *** [/devel/libreoffice/solenv/gbuild/LinkTarget.mk:329: /devel/libreoffice/workdir/CxxObject/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.o] Error 1
make: *** [Makefile:290: build] Error 2

Expected Results:
LO build successful


Reproducible: Always


User Profile Reset: No



Additional Info:
My configuration:
./autogen.sh CC=clang CXX=clang++ --enable-pch=full --without-doxygen --without-system-libxml --without-krb5 --disable-randr --disable-gtk3 --disable-gstreamer-1-0 --without-gssapi --with-theme=breeze --enable-dbgutil

My OS:
Linux 5.3.18-59.37-preempt #1 SMP PREEMPT Mon Nov 22 12:29:04 UTC 2021 (d10168e) x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Roland Kurmann 2021-12-23 16:28:48 UTC
Author and committer of commit added.

I assume this build problem is environment specific.
Comment 2 Roland Kurmann 2021-12-23 16:31:19 UTC
Compiler:

clang version 11.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/7
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/7
Candidate multilib: .;@m64
Selected multilib: .;@m64
Comment 3 Caolán McNamara 2021-12-23 19:45:25 UTC
seeing as --enable-pch=full is uncommon, maybe try toggling that off and see if it makes a difference
Comment 4 Roland Kurmann 2021-12-24 10:28:59 UTC
Building with only --enable-pch is successful.

My commands:

make clean
./autogen.sh CC=clang CXX=clang++ --enable-pch --without-doxygen --without-system-libxml --without-krb5 --disable-randr --disable-gtk3 --disable-gstreamer-1-0 --without-gssapi --with-theme=breeze --enable-dbgutil
make
Comment 5 Caolán McNamara 2021-12-24 15:04:00 UTC
At the top of each file in xmlsecurity/inc/pch/precompiled_x*hxx there is a line to update the pch e.g. ./bin/update_pch ... If you run each of the update_pch suggestions and retry with --enable-pch=full does it make a difference. If it does you can commit and submit the change as a fix for this.
Comment 6 Roland Kurmann 2021-12-30 16:00:20 UTC
I've created a patch: https://gerrit.libreoffice.org/c/core/+/127744
Comment 7 Commit Notification 2022-01-06 16:35:02 UTC
scito committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/67fb363eed88b15eec7821fe604eb23d142d84cc

tdf#146392 fix --enable-pch=full build

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2022-01-10 13:52:59 UTC
scito committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/a787ae33c9c3c20043c89893859cafdc45061a3a

tdf#146392 fix --enable-pch=full build

It will be available in 7.3.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2022-01-10 16:40:47 UTC
scito committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/511056fa1609d523206ce995c42555451b59e80b

tdf#146392 fix --enable-pch=full build

It will be available in 7.2.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.