Bug 115416 - LibreOffice fails to build with IJG's libjpeg - error: ‘JCS_EXT_BGRA’ was not declared in this scope
Summary: LibreOffice fails to build with IJG's libjpeg - error: ‘JCS_EXT_BGRA’ was not...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.4.2.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0 target:6.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-02 22:11 UTC by andreas.sturmlechner
Modified: 2018-02-05 11:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
build.log.gz (271.00 KB, application/gzip)
2018-02-02 22:21 UTC, andreas.sturmlechner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andreas.sturmlechner 2018-02-02 22:11:52 UTC
Description:
The build.log I am going to attach here is from 6.0.0.3, but the error was first reported with 5.4.2.2.

Last words:

libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx: In function ‘void ReadJPEG(JpegStuff&, JPEGReader*, void*, long int*, const Size&, GraphicFilterImportFlags, Bitmap::ScopedWriteAccess*)’:
libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx:249:40: error: ‘JCS_EXT_BGRA’ was not declared in this scope
                 best_out_color_space = JCS_EXT_BGRA;
                                        ^~~~~~~~~~~~
libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx:249:40: note: suggested alternative: ‘JCS_BG_RGB’
                 best_out_color_space = JCS_EXT_BGRA;
                                        ^~~~~~~~~~~~
                                        JCS_BG_RGB
libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx:255:40: error: ‘JCS_EXT_RGBA’ was not declared in this scope
                 best_out_color_space = JCS_EXT_RGBA;
                                        ^~~~~~~~~~~~
libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx:255:40: note: suggested alternative: ‘JCS_BG_RGB’
                 best_out_color_space = JCS_EXT_RGBA;
                                        ^~~~~~~~~~~~
                                        JCS_BG_RGB
libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx:261:40: error: ‘JCS_EXT_ARGB’ was not declared in this scope
                 best_out_color_space = JCS_EXT_ARGB;
                                        ^~~~~~~~~~~~
libreoffice-6.0.0.3/vcl/source/filter/jpeg/jpegc.cxx:261:40: note: suggested alternative: ‘JCS_BG_RGB’
                 best_out_color_space = JCS_EXT_ARGB;
                                        ^~~~~~~~~~~~
                                        JCS_BG_RGB
make[1]: *** [libreoffice-6.0.0.3/solenv/gbuild/LinkTarget.mk:293: libreoffice-6.0.0.3/workdir/CxxObject/vcl/source/filter/jpeg/jpegc.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Steps to Reproduce:
build LO --with-system-libs and libjpeg from ijg.org

Actual Results:  
build failure.

Expected Results:
build success.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 andreas.sturmlechner 2018-02-02 22:21:04 UTC
Created attachment 139539 [details]
build.log.gz

full build.log
Comment 2 Julien Nabet 2018-02-03 07:54:19 UTC
It seems the Gentoo build is configured to use external jpeg library instead of using the one retrieved by LO libjpeg-turbo-1.5.2.tar.gz.
Perhaps we should add a version check.

Would it be possible you attach autogen.input?

Meanwhile, considering the logs, let's put this one to NEW
Comment 3 andreas.sturmlechner 2018-02-03 10:59:14 UTC
Gentoo provides the option of external libjpeg-turbo or IJG's libjpeg. I was under the impression both should be supported, at least until some commit that broke it.

If you say that externally only libjpeg-turbo is supported, we can change that dependency downstream.
Comment 4 Julien Nabet 2018-02-03 15:26:12 UTC
Caolán: thought you might be interested in this one since the specific symbols quoted in the error building log have been used since https://cgit.freedesktop.org/libreoffice/core/commit/?id=f239ef0faa9e2b8c9ab0dec4c5ec6772a8c36845
Is it a Gentoo pb (I mean they should add some dependencies) or is it a LO pb? (eg: should we check version in configure.ac)
Comment 5 Caolán McNamara 2018-02-03 16:42:46 UTC
https://gerrit.libreoffice.org/#/c/49187/ might work to build with classic libjpeg if someone is willing to test that configuration.

Though classic libjpeg presumably will have a some performance loss there wrt the default configuration
Comment 6 Julien Nabet 2018-02-03 18:44:51 UTC
(In reply to Caolán McNamara from comment #5)
> https://gerrit.libreoffice.org/#/c/49187/ might work to build with classic
> libjpeg if someone is willing to test that configuration.
> 
> Though classic libjpeg presumably will have a some performance loss there
> wrt the default configuration

Thank you Caolán for your feedback and this patch!
Andreas, could you give a try to the patch?
Comment 7 andreas.sturmlechner 2018-02-04 12:27:06 UTC
Thanks, I'm away from my testing box right now but it was tested-by the original downstream bug reporter: https://bugs.gentoo.org/638520#c13
Comment 8 Commit Notification 2018-02-04 15:46:07 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5184506ffddca982f22eede24cffad64ff3576e3

tdf#115416 allow build with classic libjpeg

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Caolán McNamara 2018-02-04 15:48:55 UTC
based on that then committed and backport to 6-0 in gerrit
Comment 10 Commit Notification 2018-02-05 11:02:20 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd855591f49d688e116c3da63d913315c62028c1&h=libreoffice-6-0

tdf#115416 allow build with classic libjpeg

It will be available in 6.0.1.

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

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