Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidden visibility for the static library / building with -DOPJ_STATIC against shared lib #802

Closed
akien-mga opened this issue Jul 22, 2016 · 8 comments
Labels

Comments

@akien-mga
Copy link

Hi there,

We recently updated openjpeg from 2.1 to 2.1.1 in Mageia to address the various security issues it fixes (Mageia bug report for the reference).

The release announcement promises no API/ABI break, but our experience of rebuilding some openjpeg reverse dependencies seems to show otherwise:

build/debug/libmupdf.a(load-jpx.o): In function `fz_load_jpx':
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:98: undefined reference to `opj_set_default_decoder_parameters'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:102: undefined reference to `opj_create_decompress'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:103: undefined reference to `opj_set_info_handler'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:104: undefined reference to `opj_set_warning_handler'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:105: undefined reference to `opj_set_error_handler'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:106: undefined reference to `opj_setup_decoder'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:112: undefined reference to `opj_stream_default_create'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:117: undefined reference to `opj_stream_set_read_function'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:118: undefined reference to `opj_stream_set_skip_function'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:119: undefined reference to `opj_stream_set_seek_function'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:120: undefined reference to `opj_stream_set_user_data'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:122: undefined reference to `opj_stream_set_user_data_length'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:124: undefined reference to `opj_read_header'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:131: undefined reference to `opj_decode'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:139: undefined reference to `opj_stream_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:140: undefined reference to `opj_destroy_codec'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:236: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:211: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:126: undefined reference to `opj_stream_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:127: undefined reference to `opj_destroy_codec'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:133: undefined reference to `opj_stream_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:134: undefined reference to `opj_destroy_codec'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:135: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:150: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:155: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:160: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:165: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/mupdf-1.8-source/source/fitz/load-jpx.c:108: undefined reference to `opj_destroy_codec'
./soobj/sjpx_openjpeg.o: In function `s_opjd_release':
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:605: undefined reference to `opj_image_destroy'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:609: undefined reference to `opj_stream_destroy'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:613: undefined reference to `opj_destroy_codec'
./soobj/sjpx_openjpeg.o: In function `s_opjd_set_codec_format':
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:119: undefined reference to `opj_set_default_decoder_parameters'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:122: undefined reference to `opj_create_decompress'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:127: undefined reference to `opj_set_error_handler'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:128: undefined reference to `opj_set_info_handler'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:129: undefined reference to `opj_set_warning_handler'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:136: undefined reference to `opj_setup_decoder'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:143: undefined reference to `opj_stream_default_create'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:150: undefined reference to `opj_stream_set_read_function'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:151: undefined reference to `opj_stream_set_skip_function'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:152: undefined reference to `opj_stream_set_seek_function'
./soobj/sjpx_openjpeg.o: In function `s_opjd_process':
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:563: undefined reference to `opj_stream_set_user_data'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:567: undefined reference to `opj_stream_set_user_data_length'
./soobj/sjpx_openjpeg.o: In function `decode_image':
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:242: undefined reference to `opj_read_header'
/home/pterjan/rpmbuild/BUILD/ghostscript-9.19/./base/sjpx_openjpeg.c:249: undefined reference to `opj_decode'

Is this an expected change, or an unwanted API breakage?

@malaterre
Copy link
Collaborator

There has been no ABI change. On debian here is what I used to check.

I would check my compilation option, and make sure the openjpeg lib is being passed on the linker line.

I would close that as invalid, once OP double check.

@akien-mga
Copy link
Author

Thanks, I'll have a look to see if it's an underlinking issue. It's puzzling though as those two packages built flawlessly against openjpeg 2.1 and there were no big packaging changes on our side.

I'll report back once I've investigated further.

@akien-mga
Copy link
Author

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203327 for mupdf, which mentions that this issue happens on FreeBSD too due to 3ed5858.

Apparently they went with patching mupdf, so I guess I'll try to do the same, and see what can be done for ghostscript.

@akien-mga
Copy link
Author

I believe this issue can be closed as invalid, unless you consider that those build issues as a consequence of 3ed5858 are an upstream bug and not a downstream misuse of the library.

@akien-mga akien-mga changed the title API breakage between 2.1 and 2.1.1 mupdf and ghoscript build issues with 2.1.1 due to hidden visibility for the static library Jul 22, 2016
@akien-mga
Copy link
Author

For the reference, I hacked ghostscript with this patch and it seems to build properly: http://svnweb.mageia.org/packages/cauldron/ghostscript/current/SOURCES/ghostscript-9.19-openjpeg2-non-static.patch?view=markup&pathrev=1043163

@boxerab
Copy link
Contributor

boxerab commented Jul 23, 2016

This is also an issue for FFmpeg: #766

@malaterre malaterre changed the title mupdf and ghoscript build issues with 2.1.1 due to hidden visibility for the static library [regression in 2.1.1] hidden visibility for the static library Jul 25, 2016
@malaterre malaterre changed the title [regression in 2.1.1] hidden visibility for the static library hidden visibility for the static library / building with -DOPJ_STATIC against shared lib Jul 25, 2016
@detonin
Copy link
Contributor

detonin commented Jul 28, 2016

@malaterre what would be your advice to fix this issue (and #766) ?

@malaterre
Copy link
Collaborator

@detonin other than keeping this issue open for reference, I believe this can simply be closed. If I understand correctly @mayeut from: #804 (comment) it seems OPJ does not use an old hack to get symbol export from static lib anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants