libbrotlienc.so and libbrotlidec.so should both require libbrotlicommon.so #212

Closed
opened 2026-01-29 20:39:58 +00:00 by claunia · 4 comments
Owner

Originally created by @rcanavan on GitHub (Feb 2, 2018).

both libbrotlidec and libbrotlienc use BrotliGetDictionary from libbrotlicommon, but rely on the binary using brotli to also load libbrotlicommon. It may be more convenient for end users to link the enc and dec libraries against libbrotlicommon.so. The mod_brotli included in apache httpd 2.4.29 does not automatically pick up this dependency, and as a consequence, build a mod_brotli that can only be used by LD_PRELOADind libbrotlicommon.so.

Proposed patch:

+++ ../brotli-1.0.2-autoconf/Makefile.am        2018-02-02 13:51:24.773377900 +0100
@@ -22,9 +22,9 @@
 libbrotlicommon_la_SOURCES = $(BROTLI_COMMON_C) $(BROTLI_COMMON_H)
 libbrotlicommon_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS)
 libbrotlidec_la_SOURCES = $(BROTLI_DEC_C) $(BROTLI_DEC_H)
-libbrotlidec_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) -lbrotlicommon
+libbrotlidec_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS)
 libbrotlienc_la_SOURCES = $(BROTLI_ENC_C) $(BROTLI_ENC_H)
-libbrotlienc_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) -lbrotlicommon
+libbrotlienc_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS)
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = \
Originally created by @rcanavan on GitHub (Feb 2, 2018). both libbrotlidec and libbrotlienc use BrotliGetDictionary from libbrotlicommon, but rely on the binary using brotli to also load libbrotlicommon. It may be more convenient for end users to link the enc and dec libraries against libbrotlicommon.so. The mod_brotli included in apache httpd 2.4.29 does not automatically pick up this dependency, and as a consequence, build a mod_brotli that can only be used by LD_PRELOADind libbrotlicommon.so. Proposed patch: ```--- Makefile.am 2018-02-02 14:04:26.544647322 +0100 +++ ../brotli-1.0.2-autoconf/Makefile.am 2018-02-02 13:51:24.773377900 +0100 @@ -22,9 +22,9 @@ libbrotlicommon_la_SOURCES = $(BROTLI_COMMON_C) $(BROTLI_COMMON_H) libbrotlicommon_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) libbrotlidec_la_SOURCES = $(BROTLI_DEC_C) $(BROTLI_DEC_H) -libbrotlidec_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) -lbrotlicommon +libbrotlidec_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) libbrotlienc_la_SOURCES = $(BROTLI_ENC_C) $(BROTLI_ENC_H) -libbrotlienc_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) -lbrotlicommon +libbrotlienc_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = \ ```
Author
Owner

@rcanavan commented on GitHub (Feb 2, 2018):

That patch is obviously rubbish and fails when building in parallel. My understanding is that a proper solution would require the libraries to be separated into separate directories.

@rcanavan commented on GitHub (Feb 2, 2018): That patch is obviously rubbish and fails when building in parallel. My understanding is that a proper solution would require the libraries to be separated into separate directories.
Author
Owner

@eustas commented on GitHub (Feb 6, 2018):

Doesn't libbrotlidec_la_LIBADD = libbrotlicommon.la -lm and libbrotlienc_la_LIBADD = libbrotlicommon.la -lm do that?

@eustas commented on GitHub (Feb 6, 2018): Doesn't `libbrotlidec_la_LIBADD = libbrotlicommon.la -lm` and `libbrotlienc_la_LIBADD = libbrotlicommon.la -lm` do that?
Author
Owner

@eustas commented on GitHub (Feb 6, 2018):

Oh, it is not in 1.0.2! Going to release 1.0.3 very soon.

@eustas commented on GitHub (Feb 6, 2018): Oh, it is not in 1.0.2! Going to release 1.0.3 very soon.
Author
Owner

@rcanavan commented on GitHub (Feb 6, 2018):

Doesn't libbrotlidec_la_LIBADD = libbrotlicommon.la -lm and libbrotlienc_la_LIBADD = libbrotlicommon.la -lm do that?

it does. Those two changes on top of 1.0.2 work flawlessly for me. Thanks.

@rcanavan commented on GitHub (Feb 6, 2018): > Doesn't libbrotlidec_la_LIBADD = libbrotlicommon.la -lm and libbrotlienc_la_LIBADD = libbrotlicommon.la -lm do that? it does. Those two changes on top of 1.0.2 work flawlessly for me. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#212