Bug 697175 - mupdf fails to compile with the new openjpeg-2.1.2
Summary: mupdf fails to compile with the new openjpeg-2.1.2
Status: RESOLVED WORKSFORME
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: PC Linux
: P4 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-30 03:46 UTC by Agostino Sarubbo
Modified: 2016-12-27 02:05 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo 2016-09-30 03:46:08 UTC
With the latest openjpeg, the build fails in this way (at the end of the final link:

build/debug/fitz/tempfile.o: In function `fz_tempfilename':
tempfile.c:(.text+0x77): warning: the use of `tempnam' is dangerous, better use `mkstemp'
build/debug/fitz/load-jpx.o: In function `fz_load_jpx':
load-jpx.c:(.text+0x132): undefined reference to `opj_set_default_decoder_parameters'
load-jpx.c:(.text+0x146): undefined reference to `opj_create_decompress'
load-jpx.c:(.text+0x160): undefined reference to `opj_set_info_handler'
load-jpx.c:(.text+0x172): undefined reference to `opj_set_warning_handler'
load-jpx.c:(.text+0x184): undefined reference to `opj_set_error_handler'
load-jpx.c:(.text+0x191): undefined reference to `opj_setup_decoder'
load-jpx.c:(.text+0x1a3): undefined reference to `opj_stream_default_create'
load-jpx.c:(.text+0x1c7): undefined reference to `opj_stream_set_read_function'
load-jpx.c:(.text+0x1d6): undefined reference to `opj_stream_set_skip_function'
load-jpx.c:(.text+0x1e5): undefined reference to `opj_stream_set_seek_function'
load-jpx.c:(.text+0x1f4): undefined reference to `opj_stream_set_user_data'
load-jpx.c:(.text+0x1ff): undefined reference to `opj_stream_set_user_data_length'
load-jpx.c:(.text+0x20f): undefined reference to `opj_read_header'
load-jpx.c:(.text+0x227): undefined reference to `opj_decode'
load-jpx.c:(.text+0x237): undefined reference to `opj_stream_destroy'
load-jpx.c:(.text+0x23f): undefined reference to `opj_destroy_codec'
load-jpx.c:(.text+0x4e0): undefined reference to `opj_image_destroy'
load-jpx.c:(.text+0x636): undefined reference to `opj_image_destroy'
load-jpx.c:(.text+0x64e): undefined reference to `opj_stream_destroy'
load-jpx.c:(.text+0x656): undefined reference to `opj_destroy_codec'
load-jpx.c:(.text+0x660): undefined reference to `opj_image_destroy'
load-jpx.c:(.text+0x6a4): undefined reference to `opj_image_destroy'
load-jpx.c:(.text+0x6c4): undefined reference to `opj_destroy_codec'
load-jpx.c:(.text+0x6e4): undefined reference to `opj_stream_destroy'
load-jpx.c:(.text+0x6ec): undefined reference to `opj_destroy_codec'
load-jpx.c:(.text+0x71f): undefined reference to `opj_image_destroy'
load-jpx.c:(.text+0x73c): undefined reference to `opj_image_destroy'
load-jpx.c:(.text+0x759): undefined reference to `opj_image_destroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: build/debug/libmupdf.so.1.9: hidden symbol `opj_stream_destroy' isn't defined
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:398: recipe for target 'build/debug/libmupdf.so.1.9' failed
make: *** [build/debug/libmupdf.so.1.9] Error 1


Tested on 1.9a
Comment 1 Agostino Sarubbo 2016-09-30 04:03:08 UTC
since we (at gentoo) don't use the embedded openjpeg, we are applying a patch. I'll need to figure out what really happens.
Comment 2 Robin Watts 2016-09-30 04:27:10 UTC
I have updated the embedded openjpeg to the latest version as on 26/9/2016.

I am not aware of any API changes (other than the opj_malloc changes). Thus I am at a loss to understand those missing symbols.
Comment 3 Robin Watts 2016-10-05 09:42:39 UTC
(In reply to Agostino Sarubbo from comment #1)
> since we (at gentoo) don't use the embedded openjpeg, we are applying a
> patch. I'll need to figure out what really happens.

So, this isn't a bug with the code as we supply it? I am therefore closing the bug. Please reopen the bug if you find something we should change.
Comment 4 charles17 2016-12-27 01:55:20 UTC
LFS recommends

sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c

See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html

It is also used for https://github.com/gentoo/gentoo/pull/3108

Sorry, it seems I have no authorization to reopen this bug.